@martin, I would love to be able to manipulate the MIDI message object associated with the value object of a control in Lua. I think I need this to be able to make my controls dynamic for Triton, since the sysex data sent on parameter changes need to refer to different ‘parameter ids’ and ‘sub ids’ (Triton MIDI implementation is pretty nasty ).
My use case: I am going to have an oscillator selector on screen which allows to pick osc 1 or osc 2. All the other controls on the screen will be now associated with the selected oscillator. For example, after choosing an oscillator, if I change the waveform, the correct parameter change message needs to be passed to either osc 1 waveform or osc 2 waveform.
Normally, this should be easy. But, for Triton, if I pick osc 1, I need to send param id 2A and sub id 01 as part of the param change sysex. If I pick osc 2, I need to send param id 2B and sub id 01 (just one example. these ids differ by control). I can maintain these param ids and sub ids in Lua arrays, but to send the right ones, I still need to be able to update the MIDI message object with these values.
There are a couple of ways to build this:
- I can have a lua function on osc change, which updates all the ‘child’ control midi message data. This is a bit verbose and may lead to a heavy lua script.
- If there is an onChange function associated with every control, then I can just update the midi message on the function itself referring to some Lua arrays holding the param ids. Maybe this will be less verbose code-wise?
I see a reference to TransformIn and TransformOut functions in the doc as ‘to be built’, but they sound more focused on changing the midi value as opposed to the midi message object.