Skip to content

LUA translate CC value to pitch-wheel value (14bit MSB LSB) #220

Discussion options

You must be logged in to vote

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 :

ccValueOffset = ccValue*128  -- Translate 1byte value from CC to 2bytes Pitch Wheel value like MCU
console("Displays the ccValueOffset : "..(ccValueOffset)) -- This one is OK

local bv=BigInteger(ccValueOffset)
local FaderValueLsb = bv:getBitRangeAsInt(0,7) -- position of lsb
local FaderValueMsb = bv:getBitRangeAsInt(7,7) -- position of msb

panel:sendMidiMessageNow(CtrlrMidiMessage({0xE0,FaderValueLsb, FaderValueMsb  })) -- Send Midi Message like MCU

Now I just need to change the last nibble of the first byte with the correct midi channel related to t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by damiensellier
Comment options

You must be logged in to vote
1 reply
@damiensellier
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants