user.py: _send_midi denied

160 viewsCSS Questionsuser.py
0
0 Comments

Hi,

the user.py file is a great chance to do more efficient script code. I´ve done a few nice things last week, now I´m frustrated: I call the ” self._send_midi() ” command for sysex in a function inside the user.py file. But i get an error-log kind´a:

..\..\..\output\Live\win_64_static\Release\python-bundle\MIDI Remote Scripts\_Framework\ControlSurface.py”, line 690, in _do_send_midi

2024-06-15T12:52:47.868496: error: RemoteScriptError: AttributeError: ‘css_slmkiiidevice’ object has no attribute ‘send_midi’

Does anybody know how I can use it inside a user.py function?

Regards

Dieter

Glenn Verhaeghe Answered question July 1, 2024
0

Hello again,

I found a solution to the problem that occurred with the “solution” given in my first comment, namely that we’d have to manually insert the code everytime we’d regenerate our CSS script.

The solution is to make a Reaction that dynamically adds the “send_midi” method to the class instance.

You can find the details if you follow the link (need to scroll down a bit to the section after EDIT).

Glenn Verhaeghe Edited answer July 1, 2024
You are viewing 1 out of 2 answers, click here to view all answers.