How to set a SysEx formula from Lua?

Home Forums General Using Ctrlr How to set a SysEx formula from Lua?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #741
    mb47
    Participant
      • Topics: 7
      • Replies: 8
      • Total: 15

      Hi all,

      I need to assign SysEx formulas to 88 modulators (controlling key assignments, in a panel for the Kawai XD-5).

      I am assigning other modulator properties programmatically with Lua, and was trying to do the same for the SysEx formula.
      I tried using panel:getModulatorByName(name):getMidiMessage():setSysExFormula(sysex), as in the following code, but it does not work.

      [code:2a8l68d3]
      — set properties
      for index = 1,88 do

      — ... some code here...

      — level
      mod = panel:getModulatorByName(string.format("KLEVEL-%d", index))
      c = mod:getComponent()
      midi = mod:getMidiMessage()
      c:setPropertyString("componentTabName", tabname)
      c:setPropertyString("componentTabId", tabindex)
      c:setPropertyString("componentRectangle", string.format("%d %d %d %d", x+xlevel, y, wlevel, height))
      c:setPropertyString("uiSliderValueOutlineColour", transparent)
      c:setPropertyString("uiSliderThumbColour", blue)
      c:setPropertyString("uiSliderDoubleClickValue", "100")
      c:setPropertyString("uiSliderMax", "100")
      c:setPropertyString("uiSliderValueTextColour", white)
      –c:setPropertyString("midiMessageType", "5") — THIS WON’T WORK: PROPERTY SHOULD GO INTO MIDI SECTION, NOT COMPONENT
      –c:setPropertyString("midiMessageChannelOverride", midiChannelOverride)– THIS WON’T WORK
      –c:setPropertyString("midiMessageSysExFormula", "f0 40 09 10 00 06 3c "..keyHexString.." xx f7")– THIS WON’T WORK
      –midi:setMidiChannel(midiChannel)
      midi:setSysExFormula("f0 40 09 10 00 06 3c "..keyHexString.." xx f7") — THIS ALSO DOESN’T WORK!!!

      — ...more code here....

      end[/code:2a8l68d3]

      Seems that the setSysExFormula() function, which is listed here api/class_ctrlr_midi_message.html, is not defined.
      What can I use to set the SysEx formula from Lua?

      Best,
      Marco

      #4878
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        Everything is a property
        [code:3ucvyw3c]
        midi:setPropertyString ("midiMessageSysExFormula", String(string.format ("f0 00 00 01 %x F7", newValue)))
        [/code:3ucvyw3c]
        will work

        #35710
        GunniKonn
        Participant
          • Topics: 5
          • Replies: 27
          • Total: 32

          Is this still valid?
          I get this error message:
          attempt to index global ‘midi’ (a nil value)

          #35800
          zeoka
          Participant
            • Topics: 73
            • Replies: 466
            • Total: 539
            • ★★★

            for midi properties try midi instead of c identifier

            may be this :
            your variable or identifier = idx
            if idx <= 16 then midi:setPropertyString ("midiMessageSysExFormula",string.format("f0 00 00 01 0%x xx f7",idx)) else midi:setPropertyString ("midiMessageSysExFormula",string.format("f0 00 00 01 %x xx f7",idx)) end

            #35824
            GunniKonn
            Participant
              • Topics: 5
              • Replies: 27
              • Total: 32

              Thank you for clarifying Zeoka, I will check this out, sorry for revoking an old thread, but I was just hoping I could use this for a quick experiment.

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