Home Forums General Panels, Components, Macros For people who use the juno 106 Reply To: For people who use the juno 106


I have pasted some info that should help, this is from the previous thread.

Count the bits from right to left thus: 76543210
So getBitRangeAsInt(0,2) means starting at the first bit (0) get two bits (2)

Some of the combobox bytes are expressed like this in the Kiwi-3P user manual:
Byte (20) DCO1 Wave/Range,
Data Type 0000yyxx,
xx =DCO 1 Range 00=16′ 01=8’10=4′
yy =DCO 1 Wave 00=Saw 01=Pulse 10=Square

So the on receiving the MIDI message from the synth Lua treats it like this:

byte = programData:getByte(20)
bi = BigInteger(byte)
panel:getModulatorByName("DCO 1 Range"):setValueMapped(bi:getBitRangeAsInt(0,2), false)
panel:getModulatorByName("DCO 1 Waveform"):setValueMapped(bi:getBitRangeAsInt(2,2), false)

And to get the data into Byte 20 for a Sysex dump Lua treats it like this:

dco1range = panel:getModulatorByName("DCO 1 Range")
dco1waveform = panel:getModulatorByName("DCO 1 Waveform")
bi = BigInteger(0)
bi:setBitRangeAsInt (0,2,dco1range:getValue())
bi:setBitRangeAsInt (2,2,dco1waveform:getValue())
byte20 = bi:getBitRangeAsInt(0,7)