Sysex dump with parameters dumping to two bytes "ms" "ls"

Home Forums General Programming Sysex dump with parameters dumping to two bytes "ms" "ls"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #65651
    memorysplice
    Participant
      • Topics: 14
      • Replies: 59
      • Total: 73

      I managed to get a working script using this thread.

      Where I am at now, I there are parts of the sysex that require two separate bytes to update one parameter.

      Here is a example of the message.

      
      F0 41 10 00 00 00 7B 12 19 42 20 00 00 00 00 01 = first part of sysex
      
      01 03 = "01" ms and "03" ls "These two bytes correspond to a 255 byte parameter."
      
      00 0A = "00" ms and "0A" ls "These two bytes correspond to a 2nd 255 byte parameter."
      
      and so on and so on
      
      00 05 00 0B 00  00 02 04 03 02 00 00 00
      20  00 00 00 00 00 15 F7                        
      

      Here is the code that I am using. “Thanks to dasfaker

      
      
      	elseif  ( midiMessage:getData():getByte(09) == 0x42) then
      
      			modulator18= midiMessage:getData():getByte(11)
      
      		panel:getModulatorByName("Patch_EFX_1"):setModulatorValue(modulator18, false, false, false)
      
      

      My question is what kind of lua script do I need that will reference two separate bytes that will update a single parameter that has a range from 0-255?

      • This topic was modified 8 years, 4 months ago by memorysplice. Reason: Attribute credit to people helping
      #65682
      memorysplice
      Participant
        • Topics: 14
        • Replies: 59
        • Total: 73

        After doing some digging around, I found this to possibly work with. Does anyone have any thoughts?

        You commented out the name of your script and the “end”.. Those two elements should be like the bun of your sandwich, so to speak, and they shouldn’t be commented out with double dashes. One goes at the top, one goes at the bottom. This concept is important to grasp. When you start a function you must end a function.

        it should be something like:

        [code:1jfd3aiv]Patch Configure = function(modulator, newValue)

        FilterMsb = midiMessage:getLuaData():getByte(54)
        FilterLsb = midiMessage:getLuaData():getByte(55)

        FilterValue = (FilterMsb*16)+(FilterLsb)

        panel:getModulatorByName(“VCF Cutoff”):setModulatorValue(FilterValue, false, false, false)

        end[/code:1jfd3aiv]

        Source of post

        • This reply was modified 8 years, 4 months ago by memorysplice. Reason: add source of post
        #65688
        daimondamps
        Participant
          • Topics: 8
          • Replies: 80
          • Total: 88

          modvalue = 128 * programData:getByte(x) + programData:getByte(x+1)

          #65690
          memorysplice
          Participant
            • Topics: 14
            • Replies: 59
            • Total: 73

            Thank you. Will try now and get back.

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