Home › Forums › General › Programming › Sysex Math
Tagged: Multi-midi, sysex math
- This topic has 5 replies, 3 voices, and was last updated 3 years, 10 months ago by dnaldoog.
-
AuthorPosts
-
June 1, 2020 at 11:26 am #118661
Hi All, my filter changes come in three sysex messages per filter, how do I send something like this?
f0 41 10 00 00 00 0e 12 19 01 22 0a MS LS f7
f0 41 10 00 00 00 0e 12 19 01 22 0a MS ( LS + 1 ) f7
f0 41 10 00 00 00 0e 12 19 01 22 0a MS ( LS + 2 ) f7I’d like to figure out how to do this with the multi-midi message type if possible.
But if someone can point me in the right directions for Lua, that’d be great too 🙂
I’m stuck, I can’t seem to find any real documentation out there….Thanks!
June 2, 2020 at 9:50 am #118664Hi ccregor,
I think you would have to do it in lua.
Something like
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 ls=LS+i local ms=MS if ls > 0x7f then -- 127 ls=0+(i-1) ms=ms+1 end 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 code takes into account the ‘overspill’ you get if you enter in a number like 255 which would then be sending 256 and 257. Hope I understood the question right.
June 3, 2020 at 1:14 am #118665Or 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
June 9, 2020 at 2:40 am #118730The OP has since moved on to greener pastures, but I am thinking the original question doesn’t make sense. Why change/increment the same sysex message by two values immediately in rapid succession? The value will always end up being the last value (the incremented by two value) and if this sysex message is the actual message, what is the machine ID and device ID? You list both as 00. Also, usually Roland machines have a checksum byte which is also missing in the sysex as supplied. Maybe it’s just an example sysex, but I would be interested to know what machine you are working on and why the same message gets incremented twice. Maybe each sysex message is actually different?
June 9, 2020 at 11:23 am #118732The device ID for the Roland JD XI is “00 00 00 0E”.
So he is trying to get at:
(19 00 00 00) temporary tone (Digital Synth Part 1)
( 01 00 00) Temporary SuperNatural Synth Tone
( 00 22 00) SuperNatural Synth Tone Partial (3))
( 00 0A) Filter ModeWhich goes from 0-7, to swith Bypass, lpf, hpf, bpf and so on. If this is the right parameter, the sysex from the op doesn’t make that much sense to me. Or it must send/ set the LFO Depth at the same time.
To make it more confusing there is also:
LFO Filter Depth (00 23) -63/ +63 (1-127)But also in the CC Message List (Knob operation)
LFO Filter Depth/ partial 1-3/ controller number NRPN MSB:0, LSB:18-20/ Value 0-127LSB 18-20 could explain the 3 messages if it sends the lfo depth for the three partials at once.
And yes, the checksum is also missing.
June 9, 2020 at 11:37 am #118733Thanks Tedjuh!
Yeah I had answered the post but never sat back to question the logic.
Well at least now I know there is a device from Roland with 00 and machine id of 00!
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.