Reply To: Sysex Math

Home Forums General Programming Sysex Math Reply To: Sysex Math

#118665
dnaldoog
Participant
    • Topics: 4
    • Replies: 480
    • Total: 484
    • ★★

    Or maybe this is more concise?

    
    myMethod = function(mod,value,source)
    	
    	local bi=BigInteger(value)
    	local MS=bi:getBitRangeAsInt(7,14)
    	local LS=bi:getBitRangeAsInt(0,7)
    	for i=0,2 do
    		local lsi=LS+i
    		local ls=bit.band(127,lsi)
    		local ms=bit.rshift(lsi,7)+MS
    		local mStr=string.format("f0 41 10 00 00 00 0e 12 19 01 22 0a %.2x %.2x f7",ms,ls)
    		panel:sendMidiMessageNow(CtrlrMidiMessage(mStr))
    	end
    end
    
    • This reply was modified 3 years, 10 months ago by dnaldoog. Reason: fixed error with rshift
    Ctrlr