midiMessageChannel confusion

Home Forums General Programming midiMessageChannel confusion

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #49877
    Puppeteer
    Participant
      • Topics: 16
      • Replies: 185
      • Total: 201
      • ★★

      Hi,

      I’m using a combo to set the MIDI channel of a range of controllers on a panel. Most have complex expressions programmed in LUA, but I have some standard MIDI CC sliders as well.

      What I want to do is to set the channel override channel to the MIDI Channel value. I’m using this command to try to accomplish this.

      panel:getModulatorByName(“Vol”):getComponent():setPropertyInt(“midiMessageChannel”, cntch)

      The problem is that there are 2 parameters called midiMessageChannel. The first, and the one I want to change is the 3rd parameter in the MIDI section in the General Pane (when the controller is selected). It’s immediately under the midiMessageChannelOverride parameter (which I have ticked).

      The parameter that actually changes is further down the list (5 up from the Component Header), and it has the same name (midiMessageChannel).

      The second parameter doesn’t seem to have any effect. Can anyone let me know how I can programmatically change the first midiMessageChannel parameter?

      The Puppeteer
      http://godlike.com.au

      #49906
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★

        midiMessageChannel is not a component property, is a MIDI property, so when you write panel:getModulatorByName(“Vol”):getComponent():setPropertyInt(“midiMessageChannel”, cntch)

        you are creating a new component property called midiMessageChannel.

        You should write instead
        panel:getModulatorByName(“Vol”):getMidiMessage(0):setPropertyString(“midiMessageChannel”,tostring(cntch))

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

          OK, thanks, that makes sense. I’ll give it a go.

          The Puppeteer
          http://godlike.com.au

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

            That works fine. Thanks so much.

            Will probably have a bunch of questions on MIDI inputs soon…

            BTW – how the heck do you work this stuff out? ie how did you find out the getMidiMessage(0) part?

            I’m relying on checking other panels and doing forum searches and a bunch of trial and error…

            The Puppeteer
            http://godlike.com.au

            #50054
            dasfaker
            Keymaster
              • Topics: 80
              • Replies: 793
              • Total: 873
              • ★★★

              Been here more than 3 years, so I’ve retained something in this time 🙂

              As Ctrlr is based on Juce, you must take a look at the Juce API:

              https://www.juce.com/api/annotated.html

              • This reply was modified 8 years, 10 months ago by dasfaker.
              • This reply was modified 8 years, 10 months ago by dasfaker.
            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 106 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