Home › Forums › General › Using Ctrlr › Correlation between two CC uiCombo
- This topic has 6 replies, 2 voices, and was last updated 4 years, 6 months ago by arcangeli.
-
AuthorPosts
-
October 6, 2019 at 10:29 am #116292
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.October 7, 2019 at 12:50 pm #116301I 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.
October 7, 2019 at 5:01 pm #116302I’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, 6 months ago by arcangeli.
October 8, 2019 at 1:07 am #116304Hi 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, 6 months ago by dnaldoog.
Attachments:
You must be logged in to view attached files.October 8, 2019 at 8:09 am #116312Thanks very much. You make my day 🙂
My Buzzzy! panel is almost finished. I’ll publish it soon.Bruno
October 8, 2019 at 2:02 pm #116316Great to hear!
October 10, 2019 at 11:49 am #116339 -
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.