Show device parameter and value on controller display

1.20K 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

I’m guessing you’ll need a condition (“if” statement) that checks if the current midi message is from the same source as the last message.

for the Hz, I’m not sure how it’s calculated. If it’s linear, then you could simply multiply the value with the max. Hz amount; but my guess is it will be logarithmic (or is it exponential?), then it’s a different calculation. Would need to look into it.

Glenn V. Edited comment

Just took a look at the frequency of EQ Eight. It seems to go from 10 Hz to 22 kHz (i.e. 22.000 Hz). It seems to progress exponentially. I’m not a math specialist, so I can’t come up with a formula on the spot here.

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