How to transmit sysex message by changing a tab

Home Forums General Panels, Components, Macros How to transmit sysex message by changing a tab

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

      I am needing to know how to transmit a specific sysex message when I change a tab and how to change the sysex message for each tab. Does anyone have any ideas?

      #69463
      goodweather
      Participant
        • Topics: 45
        • Replies: 550
        • Total: 595
        • ★★★

        A tab is a modulator so you build a classical OnChange method related to it that you will connect to “Component – Called when current tab changes”
        The start of your method is like:

        --
        -- Called when a modulator value changes
        -- @mod   http://ctrlr.org/api/class_ctrlr_modulator.html
        -- @value    new numeric value of the modulator
        --
        Tab_OnChange = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
        

        value is the tab number. So you can just do something like

        if value==0 then
        sendmessage0
        elseif value == 1 then
        sendmessage1
        elseif value ==2 then
        sendmessage2
        end
        #69464
        memorysplice
        Participant
          • Topics: 14
          • Replies: 59
          • Total: 73

          Is there a way to make a button to get the current tab’s parameters if I made a lua script pertaining to those parameters, the example being a multi-timbral synth?

          #69470
          goodweather
          Participant
            • Topics: 45
            • Replies: 550
            • Total: 595
            • ★★★

            Sorry, I don’t get you… What do you want to do?
            With Lua you can retrieve any property of any modulator, thus including tabs.
            Then you can store those in variables or set other modulators with the values or…

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

              Sorry about the phrasing, Goodweather. I was up at 5am after an all night coding binge. What I was thinking of you have 3 tabs for an object with a button that request parameters based on the tab that you are on. How would I go about making it?

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

                Never mind about the get button referencing the current tab. I am trying to get the method working using the tab onchange fuction and I am getting elseif errors. can you help with syntax?

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

                  I found a solution in the demo Panels! Thanks you for your help.

                  #69476
                  goodweather
                  Participant
                    • Topics: 45
                    • Replies: 550
                    • Total: 595
                    • ★★★

                    I was going to answer that you can do as follows:

                    • for your object you need to have some kind of button to trigger the read of the tab params. In that button, you set the OnChange property to a method you will call for example ReadTabParams()
                    • In ReadTabParams() you need to test the value of your uiTabs modulator using if-elseif-elseif-else-end and you read each property within each else

                    This should work fine…

                    #70186
                    Dreetie
                    Participant
                      • Topics: 1
                      • Replies: 6
                      • Total: 7

                      Is there a way to do the inverse? Change a tab with an incoming sysex message?

                      #70187
                      goodweather
                      Participant
                        • Topics: 45
                        • Replies: 550
                        • Total: 595
                        • ★★★

                        With a modulator having Midi properties and for example a CC message associated, you can connect an OnChange method as the one I provided above.
                        As you can see, the last parameter is Source and is a number.
                        Checking for Source==2 means that the change is coming from the hardware synth.

                        I’m using this all the time, to change tabs automatically when I’m turning a knob on my Pro2 so that I get the corresponding tab in Ctlr display (see Pro2 panel).

                        Code is like:

                        if source==2 then
                        	panel:getComponent("Pro2Tabs"):setProperty ("uiTabsCurrentTab", 0, false)
                        end
                        

                        Replace 0 by the corresponding tab number…

                        To be tested if it also work when the Midi properties is on Sysex and when the sysex string is matching.

                      Viewing 10 posts - 1 through 10 (of 10 total)
                      • The forum ‘Panels, Components, Macros’ is closed to new topics and replies.
                      There is currently 0 users and 90 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