How do I set a control to a certain value? I have a control (option list) with id 17, CC parameter 103, want to set it to value 24 for example. I have tried…
parameterMap.set(17, PT_CC7, 103, 42)
How do I set a control to a certain value? I have a control (option list) with id 17, CC parameter 103, want to set it to value 24 for example. I have tried…
parameterMap.set(17, PT_CC7, 103, 42)
On the road, so no E1 access, but look at the value() and message() Lua functions. You can use value setRange (or someting like that) and set the last parameter to true and it’ll also update the MIDI message.
The parameter map is the lowest level and the GUI stuff normally sets the parameter map entry as part of doing what they do
In particular, this might be what you are looking for:
<message>:setValue(midiValue)
Sets the MIDI value inside the Message object. This value will be sent, processed by Lua functions, and used to update all related display values.
###### Parameters
midiValue
number, the MIDI value to set and send (0 .. 16383).
The Message object holds the actual MIDI or virtual message that Control’s Value object sends and receives. Every Value object is linked to exactly one Message object.
This sets the value of control with id 17 to value 0
controls.get(17):getValue():getMessage():setValue(0)
Thank you so much for sharing this example with us. It really helped me a lot.
Very happy to hear that it helped you