Show device parameter and value on controller display
Hi all, wondering if a more experienced script writer could help me with the following:
I would like to show the device name, parameter name and value on the display of my Launchkey mk4.
I’ve figured out what the sysex strings should look like and have integrated it in a reaction that listens to a controller knob. The code below works to a certain extent (device number is m1 and parameter number is m13).
The info is sent to the launchkey and displayed on the little screen. However, the reaction is triggered with every midi step of the controller knob. Any idea how I could avoid this? Especially the device name and parameter name should not be retriggered as long as the same midi message is being received. Also, somewhat related, the value is shown as a decimal number between 0 and 1: is it possible to send the value the way it is shown in Ableton (eg. EQ8 frequency in Ableton is ‘x Hz’, while the value sent is ‘0,xxxxxx’)?
Device = str(self.song().view.selected_track.devices[self.get_modifier_value(“m1”)].name)
Parameter = str(self.song().view.selected_track.devices[self.get_modifier_value(“m1”)].parameters[self.get_modifier_value(“m13”)].name)
Value = str(self.song().view.selected_track.devices[self.get_modifier_value(“m1”)].parameters[self.get_modifier_value(“m13”)].value*10)[:3]
self._send_midi((240, 0, 32, 41, 2, 19, 4, 33, 2, 247))
self._send_midi((240, 0, 32, 41, 2, 19, 6, 33, 0) + tuple(Device.encode(“ascii”)) + (247,))
self._send_midi((240, 0, 32, 41, 2, 19, 6, 33, 1) + tuple(Parameter.encode(“ascii”)) + (247,))
self._send_midi((240, 0, 32, 41, 2, 19, 6, 33, 2) + tuple(Value.encode(“ascii”)) + (247,))
self._send_midi((240, 0, 32, 41, 2, 19, 4, 33, 127, 247))
Thank you for putting in the time and the energy Glenn. Much appreciated. You took it much further than I intended it to. I’ll experiment with it this weekend and see how far I get. I hope you got something out of it too ;;-)
Sign up
User registration is currently not allowed.
I got a learning experience out of it. I recently discovered I could use MIDI controllers with python scripts through the PyGame module. Because of this I was able to test the code for the conversion easily with my own MFT.
There’s still a chance that the calculation won’t accurately depict the same value like in Ableton. Even though it’s increasing at exponential rate, the curve of that rate might be different from Ableton’s curve. I haven’t fully checked that.