Incoming MIDI data

Home Forums General Panels, Components, Macros Incoming MIDI data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #69495
    proton
    Participant
      • Topics: 19
      • Replies: 94
      • Total: 113
      • ★★

      Hi everybody,
      a quick question since I might be missing something very obvious here:
      how to set up a button or a knob to react to incoming MIDI data? Lets say I have a button that is triggering a lua script if pressed and I would like to trigger this same button externally always when I press “A3” on my midi keyboard. I’m pretty sure this is doable but I can’t find a way. My Ins and Outs are set properly and I am getting midi IN data from my midi keyboard and I’m also sending all I need.
      Thanks in advance folks!

      #69496
      Puppeteer
      Participant
        • Topics: 16
        • Replies: 185
        • Total: 201
        • ★★

        You’ll need a script on the Called when panels receives a MIDI Message.

        In the script you’ll need to check the incoming MIDI message for the message received, probably using a series of IF statements.

        If the MIDI is what you want, set the Panel Object to the desired state, using a command similar to one of the ones below

        panel:getModulatorByName(“Env3A1T”):setValueMapped(EnvTimeLookup(0),true,true)
        panel:getModulatorByName(“Env3A1L”):setModulatorValue(100,false,true,true)

        The Puppeteer
        http://godlike.com.au

        #69497
        proton
        Participant
          • Topics: 19
          • Replies: 94
          • Total: 113
          • ★★

          Hi Puppeteer,
          Thank You for chiming in!
          I tried your way and so far so good – modulators are reacting to incoming midi data! Thank you!
          I will have few more questions the deeper I go with my panel but for now this works, have a great evening!
          Cheers!

          #69498
          proton
          Participant
            • Topics: 19
            • Replies: 94
            • Total: 113
            • ★★

            Ok, so I can trigger a LUA script now every time there is a MIDI coming IN but I am struggling with one more crucial thing: how to distinguish not only if there is a MIDI IN activity but to recognize what pitch or its velocity was played?
            I would like to react differently to different pitches ev. to different values/velocities. Is there a way to check for the incoming pitch (something like get midiMessageCtrlrNumber)?
            Thanks in advance!

            UPDATE:

            For now I use this solution and it works great:

            local MIDIdata = midi:getLuaData()
            local byte0 = MIDIdata:getByte(0)
            local byte1 = MIDIdata:getByte(1)
            local byte2 = MIDIdata:getByte(2) …

            I’m pretty sure it will get more complicated down the line but this is enough for now.

            Cheers!

            • This reply was modified 7 years, 10 months ago by proton.
          Viewing 4 posts - 1 through 4 (of 4 total)
          • The forum ‘Panels, Components, Macros’ is closed to new topics and replies.
          There is currently 0 users and 117 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