Correlation between two CC uiCombo

Home Forums General Using Ctrlr Correlation between two CC uiCombo

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #116292
    arcangeli
    Participant
      • Topics: 9
      • Replies: 21
      • Total: 30

      Hi all,

      I want to make another panel. This time for the Buzzzy! synth from fred’s lab (on kickstarter).
      Just a little thing i do not know how to make.
      The OSC are in two part.
      CC 75 for choosing the engine (Pulse=0, FM=32, Wave=64, Noise=96).
      Each engine has a number of wave on CC 70. 16 differents waves for Pulse and Wave and 8 for FM and Noise.
      On the physical synth, there’s to potentiometers. But on my panel i definitely prefer uiCombo with the name of each engine and wave.
      Actually i’ve made 5 uiCombo. one for the Engine (CC 75) et 4 for each engine type (CC 70).
      Is it possible to display/hide the uiCombo not needed with another uiCombo? If uiCombo Engine is on Pulse, display only uiCombo Pulse wave list. As this for each other.
      I can replace the Engine uiCombo by button (on/off) if it’s more simpler to do.
      Another solution may be to replace the uiCombo for wave as a uiSlider and show the name in a text box for example.
      I do not know what’s possible and how to do that.
      If someone can help me on this.

      #116301
      dnaldoog
      Participant
        • Topics: 4
        • Replies: 480
        • Total: 484
        • ★★

        I read through this a few times. Not 100% sure about what you are doing, but you could use layers to hide one combo and show another (that’s in the same position) depending on what waveform you are using.

        You can also alternatively replace a single combo’s contents with Lua, and even the cc values, but using layers is probably easier. You would set up a function that hides all layers, then shows he one you want. It works very well.

        Let me know if you need more guidance there.

        Regards.

        #116302
        arcangeli
        Participant
          • Topics: 9
          • Replies: 21
          • Total: 30

          I’ve made this script which is called when the “engine uiCombo” modulator value change:
          EDIT: corrected some error in the script.

          --
          -- Called when a modulator value changes
          -- @mod   http://ctrlr.org/api/class_ctrlr_modulator.html
          -- @value    new numeric value of the modulator
          --
          selectWavesForEngines = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
              local engine = panel:getModulatorByName("osc_engine"):getValue()
              local waves_pulse = panel:getModulatorByName("osc_pulse")
              local waves_fm = panel:getModulatorByName("osc_fm")
              local waves_wave = panel:getModulatorByName("osc_wave")
              local waves_noise = panel:getModulatorByName("osc_noise")
              if engine == 0 then
                  waves_pulse:getComponent():setVisible(true)
                  waves_fm:getComponent():setVisible(false)
                  waves_wave:getComponent():setVisible(false)
                  waves_noise:getComponent():setVisible(false)
              elseif engine == 1 then
                  waves_pulse:getComponent():setVisible(false)
                  waves_fm:getComponent():setVisible(true)
                  waves_wave:getComponent():setVisible(false)
                  waves_noise:getComponent():setVisible(false)
              elseif engine == 2 then
                  waves_pulse:getComponent():setVisible(false)
                  waves_fm:getComponent():setVisible(false)
                  waves_wave:getComponent():setVisible(true)
                  waves_noise:getComponent():setVisible(false)
              elseif engine == 3 then
                  waves_pulse:getComponent():setVisible(false)
                  waves_fm:getComponent():setVisible(false)
                  waves_wave:getComponent():setVisible(false)
                  waves_noise:getComponent():setVisible(true)
              end
          end

          But i can not find anything about layers. Just “Component Layer ID”.
          Do i need to make a script that run when the panel load finish with setVisible(false) on waves_fm, waves_wave and waves_noise uiCombo?

          Thanks. Your help is greatly appreciated 🙂

          • This reply was modified 4 years, 5 months ago by arcangeli.
          #116304
          dnaldoog
          Participant
            • Topics: 4
            • Replies: 480
            • Total: 484
            • ★★

            Hi Arcangeli – I think your script must work (??), but it could get complicated if you have to change other elements like buttons and labels and even layout to tie in with each ‘engine’ setting, so I would recommend possibly designing your panel using layers.
            To create a new layer go:

            MENU (Panel -> Layer Editor -> Edit -> Add Layer)

            Please see attached panel 🙂

            
            changeLayer = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
            if value == 0 then
             showLayer("PULSE") 
             elseif value == 1 then
            showLayer("FM")
             elseif value == 2 then
            showLayer("WAVE")
             else 
            showLayer("NOISE")
            end
            end
            
            showLayer=function(LAYER)
            for k in pairs(layers) do
            panel:getCanvas():getLayerByName(k):setVisible(false)
            end -- loop
            panel:getCanvas():getLayerByName(LAYER):setVisible(true)
            end --function
            
            layers={PULSE=true,FM=true,WAVE=true,NOISE=true}
            
            • This reply was modified 4 years, 5 months ago by dnaldoog.
            Attachments:
            You must be logged in to view attached files.
            #116312
            arcangeli
            Participant
              • Topics: 9
              • Replies: 21
              • Total: 30

              Thanks very much. You make my day 🙂
              My Buzzzy! panel is almost finished. I’ll publish it soon.

              Bruno

              #116316
              dnaldoog
              Participant
                • Topics: 4
                • Replies: 480
                • Total: 484
                • ★★

                Great to hear!

                #116339
                arcangeli
                Participant
                  • Topics: 9
                  • Replies: 21
                  • Total: 30

                  My new panel is now finished. Buzzzy!
                  There some minor enhancement i need to do in my lua script but it work very well.
                  Thanks very much dnaldoog 🙂

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