Can I deactivate a activated Button when a other one gets activated?
Options
treynterrio
Member Posts: 64 Member
Hi there, can I deactivate a activated Button when a other one gets activated?
I need to do this with a 5 different Buttons, when for example Button 2 is activated and I activate Button 5 the second one should be deactivated and so on.
Tagged:
0
Comments
-
Change button names and numbers as needed
on init declare $i declare ui_button $button0 declare ui_button $button1 declare ui_button $button2 declare ui_button $button3 declare ui_button $button4 declare %buttonIds[5] := (get_ui_id($button0), get_ui_id($button1), get_ui_id($button2), get_ui_id($button3), get_ui_id($button4)) declare const $buttonIds__SIZE := 5 end on on ui_control($button0) $i := 0 while ($i<num_elements(%buttonIds)) set_control_par(%buttonIds[$i],$CONTROL_PAR_VALUE,0) inc($i) end while $button0 := 1 end on on ui_control($button1) $i := 0 while ($i<num_elements(%buttonIds)) set_control_par(%buttonIds[$i],$CONTROL_PAR_VALUE,0) inc($i) end while $button1 := 1 end on on ui_control($button2) $i := 0 while ($i<num_elements(%buttonIds)) set_control_par(%buttonIds[$i],$CONTROL_PAR_VALUE,0) inc($i) end while $button2 := 1 end on on ui_control($button3) $i := 0 while ($i<num_elements(%buttonIds)) set_control_par(%buttonIds[$i],$CONTROL_PAR_VALUE,0) inc($i) end while $button3 := 1 end on on ui_control($button4) $i := 0 while ($i<num_elements(%buttonIds)) set_control_par(%buttonIds[$i],$CONTROL_PAR_VALUE,0) inc($i) end while $button4 := 1 end on
0 -
THANKS!!! that's exactly what I needed!
But how I can deactivate the buttons now? One of them is now activated the whole time.
0 -
Add an if statement in the callbacks:
on ui_control($button0) if ($button0=1) $i := 0 while ($i<num_elements(%buttonIds)) set_control_par(%buttonIds[$i],$CONTROL_PAR_VALUE,0) inc($i) end while $button0 := 1 end if end on
1
Back To Top
Categories
- All Categories
- 18 Welcome
- 952 Hangout
- 56 NI News
- 471 Tech Talks
- 2.5K Native Access
- 11.1K Komplete
- 1.3K Komplete General
- 3K Komplete Kontrol
- 4K Kontakt
- 846 Reaktor
- 299 Battery 4
- 616 Guitar Rig & FX
- 325 Massive X & Synths
- 768 Other Software & Hardware
- 4.1K Maschine
- 4.8K Traktor
- 4.8K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators