Home Forums General General MIDI discussion Help with Sysex please Reply To: Help with Sysex please


Hi Msepsis & Hecticcc, thanks for the follow up. Atom talked me through this one and together we got it sorted. But for completeness and also in case anyone else follows this thread looking for an answer here is the method used.

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)

I get a bit of a buzz from doing this kind of stuff with data, perhaps because I am new to the game… perhaps because I am just a bit odd : )