Sysex Math

Home Forums General Programming Sysex Math

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #118661
    ccregor
    Participant
      • Topics: 1
      • Replies: 0
      • Total: 1

      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 ) f7

      I’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!

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

        Hi 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.

        #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
          #118730
          dnaldoog
          Participant
            • Topics: 4
            • Replies: 480
            • Total: 484
            • ★★

            The 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?

            #118732
            Tedjuh
            Participant
              • Topics: 9
              • Replies: 97
              • Total: 106
              • ★★

              The 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 Mode

              Which 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-127

              LSB 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.

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

                Thanks 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!

              Viewing 6 posts - 1 through 6 (of 6 total)
              • The forum ‘Programming’ is closed to new topics and replies.
              There is currently 0 users and 81 guests online
              No users are currently active
              Forum Statistics
              Threads: 2,495, Posts: 17,374, Members: 77,605
              Most users ever online was 12 on January 22, 2019 3:47 pm
              Ctrlr