Sysex Dumps via LUA scripts…need help

Home Forums General Programming Sysex Dumps via LUA scripts…need help

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #101153
    wildthing
    Participant
      • Topics: 8
      • Replies: 12
      • Total: 20

      Hi guys, I decided to start a new project and i would like to build a controller panel for my jomox.
      I’ve already built modulators and i would like to add 2 more buttons. The first to get edit buffer values from the synth to the panel modulators and the second to send actual panel values from CTRLR to jomox.
      I would like to do it using SYSEX messages but i never manage that stuff before. I’ve understood the message structure but i need a little help to start.
      Can someone be so kind to make an example on how can i settle LUA scripts to get those goals?
      Any help would be much appreciated! Thanks in advance….

      P.S. I’ve attached midi implementation table

      Attachments:
      You must be logged in to view attached files.
      #101198
      daimondamps
      Participant
        • Topics: 8
        • Replies: 80
        • Total: 88

        Hi , you need to create LUA function and selest it in the main panel recive message method.
        Example routine could be like this:

        --
        -- Called when a panel receives a midi message (does not need to match any modulator mask)
        -- @midi   CtrlrMidiMessage object
        --
        
        Recivelist = function(midiMessage)
        
        if panel:getRestoreState() == true or panel:getProgramState() == true then
        		return
        	end
        
        	local messageType = midiMessage:getType()
        	
        
        	if (messageType == 5 and midiMessage:getSize()~=2) then
        
        		local s = midiMessage:getSize() -- Size of the midi dump received
        		console ("memory block is "..midiMessage:getSize().." bytes, data:")
        
        		local recKPAID = midiMessage:getLuaData():getRange(1,3)
            	        local recFunctionCode = midiMessage:getLuaData():getByte(6)
        		local Instance = midiMessage:getLuaData():getByte(7)
        		local recNrpnMSB = midiMessage:getLuaData():getByte(8)
        		local recNrpnLSB = midiMessage:getLuaData():getByte(9)
        
        		if (recFunctionCode == 0x7e and Instance == 0x00) then
        		
        			if (recNrpnMSB == 04 and recNrpnLSB ==03) then
        
        				local partialmessage=midiMessage:getData():getRange(10,s-12)
        
        			
        				
        		
        				elseif (recNrpnMSB == 06 and recNrpnLSB ==03) then
        
        				else
        			end
        		
        	    end
        	end
        end
        • This reply was modified 5 years, 1 month ago by daimondamps.
        #101204
        danieloberhoff
        Participant
          • Topics: 1
          • Replies: 12
          • Total: 13

          I tried this on a d110. i request a dump, and an answer comes (as seen in the monitor), but i think my function never gets called. i put a console call in there, and i cant see anything. also, is there an api reference anywhere?

          #101210
          daimondamps
          Participant
            • Topics: 8
            • Replies: 80
            • Total: 88

            You have to select this method(function) in the right men in Panel Edit Mode “luaPanelMidiRecived” “Called when a panel recives midi message”.

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

              Hi Daniel and Wildthing,

              Maybe look through this source code for clues on how to do it – you’ll need a checksum function (for the Roland D-110) – there’s one in there you can use.

              Regards,

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The forum ‘Programming’ is closed to new topics and replies.
            There is currently 0 users and 82 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