🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

Strange problem/bug sending midi sysex

Submitted by MartinJ on Wed, 06/28/2023 - 10:03
MartinJ
Control Surface Studio User

Hi, I see a strange problem/bug with self._send_midi().
I use this code to send out parameter values to display on a iPad:

This is just an example for parameter 14.

Listener: self.song().appointed_device.parameters[14].add_value_listener OR turning knob 14 on the MIDI Fighter Twister

Action:
parNr = 14
header = (240, 126, 3,)
devPar = (parNr,)
val = tuple([ord(c) for c in self.song().appointed_device.parameters[parNr].str_for_value(self.song().appointed_device.parameters[parNr].value)],)
closer = (247,)

sysexMsg = header + devPar + val + closer

self._send_midi(sysexMsg)

self.log_message("csslog: " + str(sysexMsg))

I always get the correct output in the css log and I get midi sysex output:

1. after loading a live set and in the first selected track there is a selected/bluehanded device
2. when I click a random parameter in a selected/bluehanded device > in this case not only the now selected parameter works but also every other parameter of this device...

But there is no midi sysex output when:
1. selecting (blue hand) a device with a midi controller input
2. selecting (blue hand) a device by mouse clicking on the device menu bar
3. selecting (blue hand) a device with keyboard arrows left/right

I also tried to use "selected device" rather than "appointed device" but that also doesn't work.

Any hints what might be wrong with the code ?

Regards, mj

upload files: 
Topic Category: 

6 Responses

Comments

MartinJ
Control Surface Studio User
#1

And here's the complementing Open Stage Control file - essentially the "display" to show parameter names and values etc.. This is more a sketch and work in progress. Any help would be appreciated. Regards, mj

Wim
Control Surface Studio User
#2

Hi MartinJ,
I am sorry but I could not open the last json script you sent in CSS.
In the past, I have had more luck with "selected device" rather than "appointed device" but you already tried that.
I also had mixed results with the self._send_midi() command, but haven't been able to pin down what it was what triggered the failure.
I am not at all familiar with OSC (yet), but maybe there is a way to get the parameter name and value directly through the Live Object Model via OSC?
Greetings

MartinJ
Control Surface Studio User
#3

Hi Wim, thank you to have a look at it. The second file "DeviceR light - CSS_work.json" is the session file for Open Stage Control (https://openstagecontrol.ammd.net) and not CSS although it's also a JSON file ;-). It needs to be opened with the Open Stage Control launcher app. Regards, mj

Wim
Control Surface Studio User
#4

Ok, I see.. That makes sense :-)
One of these days I will tackle OSC, for the moment I have too many other things on my plate. Still intrigued by the _send_midi() though. Please keep us posted if you find a (partial) solution, I will have another look soon too!
Till posted!

MartinJ
Control Surface Studio User
#5

I tried a little bit further and I have to correct my first statement because by changing the selected device csslog also doesn't output the parameter value string..

Wim
Control Surface Studio User
#6

That is a bummer..

Hope I am not kicking in open doors, but in the LOM there is also a 'send_receive_sysex' function. Maybe that can be of any help?

Also, I thought that send_midi (and also send_receive_sysex) is only able to send data to your Midi controller. If that is the case, then is your iPad also set as a control surface in Live? (Maybe you'll have to make a CSS script for your iPad?)

Just thinking out loud here..