Show device parameter and value on controller display

1.19K viewsCSS Community ScriptsDisplay launchkey sysex
0

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))

shasta0_6 Answered question
0

Small update: I found the solution to the screen flickering. I was calling the wrong target with the sysex code. Should be 21 for knob 1, 22 for 2, etc…

self._send_midi((240, 0, 32, 41, 2, 19, 4, 21, 2, 247))
self._send_midi((240, 0, 32, 41, 2, 19, 6, 21, 0) + tuple(Device.encode(“ascii”)) + (247,))
self._send_midi((240, 0, 32, 41, 2, 19, 6, 21, 1) + tuple(Parameter.encode(“ascii”)) + (247,))
self._send_midi((240, 0, 32, 41, 2, 19, 6, 21, 2) + tuple(Value.encode(“ascii”)) + (247,))
self._send_midi((240, 0, 32, 41, 2, 19, 4, 21, 127, 247))

And concerning the way in which the value is presented on the Launchkey display: I noticed that there is another method in the Ableton API: Live.DeviceParameter.DeviceParameter.str_for_value() 

This returns the value as it is in Ableton, eg. Hz or dB in the EQ8 example above. But at the moment I can only call the minimum and maximum values and nothing in-between. The official Novation script manages to show all values, so I’m probably still missing a piece of the puzzle.

In the meantime, I am sending the value as % of the maximum, and that’s already a big step forward. The visual feedback on the little display opens up the Ableton/Launchkey combo big time.

shasta0_6 Answered question
You are viewing 1 out of 9 answers, click here to view all answers.