switches1 = function(mod, value)
range= panel:getModulatorByName("RANGE"):getModulatorValue()
--low = 00 = 001 binary
--mid = 01 = 010 binary
--high = 02 = 100 binary
waveform= panel:getModulatorByName("WAVEFORM"):getModulatorValue()
--NONE = 00 = 00
--PULSE = 01 = 01
--TRIANGLE = 02 = 10
--PULSE AND TRI = 03 = 11
chorus= panel:getModulatorByName("CHORUS"):getModulatorValue()
--OFF = 00 = 00
--CHORUS 1 = 01
--CHORUS 2 = 11
bi111= BigInteger(0)
--range
if range == 00 then
bi111:setBit(1,0)
bi111:setBit(0,1)
bi111:setBit(1,2)
elseif range == 01 then
bi111:setBit(0,0)
bi111:setBit(1,1)
bi111:setBit(0,2)
elseif range == 02 then
bi111:setBit(0,0)
bi111:setBit(0,1)
bi111:setBit(1,2)
end
--waveform
if waveform == 00 then
bi111:setBit(0,3)
bi111:setBit(0,4)
elseif waveform == 01 then
bi111:setBit(0,3)
bi111:setBit(1,4)
elseif waveform == 02 then
bi111:setBit(1,3)
bi111:setBit(0,4)
elseif waveform == 03 then
bi111:setBit(1,3)
bi111:setBit(1,4)
end
if chorus == 00 then
bi111:setBit(0,5)
bi111:setBit(0,6)
elseif chorus == 01 then
bi111:setBit(0,5)
bi111:setBit(1,6)
elseif chorus == 02 then
bi111:setBit(1,5)
bi111:setBit(1,6)
end
hexData11= string.format ("F0 41 32 00 11 %.2x F7", bi222:getBitRangeAsInt(0,7))
midi1= CtrlrMidiMessage(hexdata11)
panel:sendMidiMessageNow(midi1)
console (string.format ("F0 41 32 00 11 %.2x F7", bi222:getBitRangeAsInt(0,7)))
end
This is some lua i wrote hoping to set switches on my juno adapted from the ctrlr panel atom created.
Its coming up with error ‘No Matching overloads found’ and im completely stumped!