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

Another small update: str_for_value() needs to be called with a number between 0 and 1. E.g. 0.5 would give the label for the value of that specific parameter. By scaling the incoming cc velocity data, I get there. My little Launchkey screen now shows me all the info I want.

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