(Solved) Radio Buttons and LUA script

Home Forums General Programming (Solved) Radio Buttons and LUA script

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #118025
    damien
    Participant
      • Topics: 15
      • Replies: 62
      • Total: 77

      Hi,
      I am working on my Ensoniq DP4 panel, I already finished the GUI and I am working on the code.
      I face an issue with a set of “radio” buttons triggering a LUA sript.

      I have exactly 4 buttons in this radio group (set to 1 for all the buttons)
      SELECT
      EDIT
      CONFIG
      SYSTEM

      The concept is to change the tab of a common uiTabs when pressing one of the 4 buttons above.
      Since it’s in a radio group if one button is pressed (value set to 1) the other buttons have their value reset automatically to 0.

      The buttons are changing their value correctly if one or another is pressed on. (my image sprites go accordingly).

      If those buttons are not set in a radio group, the LUA script works and display the tab accordingly, but the value of the other buttons must be reset, hence the radio feature.

      In radio mode, my script is making irrelevant results and I can’t figure what’s wrong:

      
      ModeTabsSelect = function()
      
      	gViButComSelect	= panel:getModulatorByName("ViButComSelect")
      	gViButComEdit	= panel:getModulatorByName("ViButComEdit")
      	gViButComConfig	= panel:getModulatorByName("ViButComConfig")
      	gViButComSystem	= panel:getModulatorByName("ViButComSystem")
      
      	ViButSelectVal	= gViButComSelect:getModulatorValue()  -- 0 or 1
      	ViButEditVal	= gViButComEdit:getModulatorValue()  -- 0 or 1
      	ViButConfigVal 	= gViButComConfig:getModulatorValue() -- 0 or 1
      	ViButSystemVal	= gViButComSystem:getModulatorValue() -- 0 or 1
      
      	if ViButSelectVal == 1 then
      	panel:getComponent("ModeTabs"):setProperty ("uiTabsCurrentTab", 0, false)
      	console("Case A Shows Edit Tab")
      
      	elseif ViButEditVal == 1 then
      	panel:getComponent("ModeTabs"):setProperty ("uiTabsCurrentTab", 0, false)
      	console("Case B Shows Edit Tab as well")
      
      	elseif ViButConfigVal == 1 then
      	panel:getComponent("ModeTabs"):setProperty ("uiTabsCurrentTab", 1, false)
      	console("Case C Shows Config Tab")
      
      	elseif ViButSystemVal == 1 then
      	panel:getComponent("ModeTabs"):setProperty ("uiTabsCurrentTab", 2, false)
      	console("Case D Shows System Tab")
      	end
      end
      

      Maybe I don’t use the radio button grouping function properly or my statements are wrong but the results are null or random (i.e function buttons displays system tab).

      I also want to have a default position if the a ON button is pressed again, it sets the Edit button to On (displaying the Edit tab).

      That would be so nice if someone could help me with that.

      thanks a lot!

      • This topic was modified 3 years, 11 months ago by damien. Reason: typo
      • This topic was modified 3 years, 11 months ago by damien. Reason: typo
      • This topic was modified 3 years, 11 months ago by damien.
      #118031
      damien
      Participant
        • Topics: 15
        • Replies: 62
        • Total: 77

        I succeed in creating 4 different methods for the 4 different buttons with a short function like this :

        ModeTabsSelect = function(mod, value)
        panel:getComponent("ModeTabs"):setProperty ("uiTabsCurrentTab", 0, false)
        end

        And I assigned this method for the Select button.

        Same variation for the other 3 buttons.

        Keeping it simple is always the way to go.

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

          Exactly!

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

            Hi Damien,
            what is the progress for your DP4 editor?

            Finally, I just got a DP4 🙂

            In parallel, I made and released a panel for the Behringer Odyssey. In that one, there is also a multi effect with different types of parameters for each of the 3 parameters by effect.
            I found an easy way to handle all parameters and their different types, limits, min/max…

            #118895
            damien
            Participant
              • Topics: 15
              • Replies: 62
              • Total: 77

              Hi Damien,
              what is the progress for your DP4 editor?

              Hi,
              I will start working back on it this weekend. It took me some time to fix my unit.
              I had to recap all the PSU and change 3 IC regulators. My DP4 fried last month and once everything was replaced I discovered 1 DSP failed, maybe due to static, power surge or maybe heat when I desoldered the regulator next to it.
              I found one ESP on ebay this week it was a pain… those are really hard to find.
              So right now I have a “DP/3” but next week The 4th unit will be back home.

              My next step for the ctrl is the preset management.
              You can be sure I’ll let you know through the steps and I’ll probably need some help from you and dnldoog as previously.

              Congrats for the purchase! This is a very special beast, it’s like the poor man’s eventide H3000 🙂

              Thoses behringer clones are really impressive for the price.
              I’ll probably buy some of their FX unit by Klark Tecknik like the bdd320 dimension D, their 1176 and la2a seem to be really nice like all the new Klark teknik/behringer range.
              Don’t hesitate to ask me if you need some tips with the ensoniq. I know it by heart.
              Take care

            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 70 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