LUA translate CC value to pitch-wheel value (14bit MSB LSB) #220
-
Good evening, I'm working on a small Ctrlr project to transform CC messages to Mackie MCU compatible messages. I send midi values with my controller from 0 to 127. if CC value is 0, the translated pitch wheel value is -8192 This part is plain simple, the final decimal value is "ccValueOffset" (ccValue * 128) -8192 I struggle finding the right LUA formula to convert the given value, to pitch-Wheel values with MSB LSB This is the documentation : Faders Received: Ei, ll, hh Move fader to position i Fader ID (00 thru 07; Master = 08) Example: E0, 40, 55 = Fader Ch. 1, position (55 << 7) + 40 This is my script
Can you please help me with that, because The values of the sent message are not good. Thanks a lot for your help ;) Damien |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Edit: I had it right at first but MidiMonitor shows me wrong values (-8192 to 8192) if the value is (0 to 16384). this is the right one :
Now I just need to change the last nibble of the first byte with the correct midi channel related to the fader #i : 0xEi |
Beta Was this translation helpful? Give feedback.
-
Salut Damien! Your basic equation is wrong. With The ccValueOffset calculation is ccValueOffset = (ccValue*16384/127) - 8192 I would also not use BigInteger and co... I struggled a bit with the conversion (nice morning exercice - thank you) but I think that this should work:
|
Beta Was this translation helpful? Give feedback.
Edit:
I had it right at first but MidiMonitor shows me wrong values (-8192 to 8192) if the value is (0 to 16384).
this is the right one :
Now I just need to change the last nibble of the first byte with the correct midi channel related to t…