kraftf wrote:mbncp wrote:
Feedback is not always needed but in case, you just need an array that keeps track of the individual CC number * channel used for each control, and refresh the control(s) on CC and/or channel change, and update the array on incoming MIDI.
Can you explain that a bit more with an eample?
If we use more than one cc and/or channel for a single fader then we need to store these values so when we switch cc/channel we can reflect their actual values.
Also in case these values are changed on feedback we need to store them as well.
For this we need a variable that stores the value for each cc/channel pair.
Then an on expression script to store the changes we make in lemur
and an On Midi script to store the values on feedback change.
Then we need another on expression function for the control that makes the cc channel selection, so we can update our fader.
If we have only different cc's or channels then we need a simple array:
example using 4 ccs, we create a variable:
myFaderValues = {0,0,0,0}
We access the correct item with something like that:
index = currentCC - lowestCC;
myFaderValues[index] = value;
In case we use different cc and channels, example 4 CC and 2 channels our variable would be like this
myFaderValues = { {0,0,0,0} , {0,0,0,0} }
in this case we access the correct value this way:
index = (currentChannel - lowestChannel - 1) * (currentCC - lowestCC);
myFaderValues[index] = value;
Then all we need to do is to get or set values from that array in the different script and update the fader when needed (external midi in or cc/channel change).
On request I could make a real example when I'm back to my machine.