You can do that with BigInteger getBitRangeAsInt() method:
To convert a Multi CC message as in:
CC,ByteValue,MSB7bitValue,23,-1
CC,ByteValue,LSB7bitValue,55,-1
In Lua:
--
-- Called when a modulator value changes
-- @mod http://ctrlr.org/api/class_ctrlr_modulator.htmla
-- @value new numeric value of the modulator
--
myMultiCC = function(mod,value,source)
local myChannel=panel:getProperty("panelMidiOutputChannelDevice")
local add=0xb0+(myChannel-1)
local bv=BigInteger(value) --break the value into 4bit nibbles
local msb=bv:getBitRangeAsInt(7,7) -- position of msb
local lsb=bv:getBitRangeAsInt(0,7) -- position of lsb
m = CtrlrMidiMessage({add, 23, msb})
l = CtrlrMidiMessage({add, 55, lsb})
panel:sendMidiMessageNow(m)
panel:sendMidiMessageNow(l)
end--f
Where 23 and 55 are the MSB/LSB Bank Select control numbers for adsr2Sustain uiSlider [ADSR Sustain] on that panel by Atom.
… or alternatively you could split the value this way:
msb=bit.rshift(value, 7)
lsb=bit.band(value, 127)
Regards,