Activate and deactivate groups / then no more sound

treynterrio
Member Posts: 62 Newcomer
Hi there, I have a question maybe anyone could help me with this.
This is my code on "on note" I allow and disallow the groups to be active and in the on ui_control I mute a group and "active" volume up a group. My problem is when I click the first group and then the second and the third and I want to active the first group again there is no more sound and on the second one is no sound as well even the main group (0) is deactivated does anyone have a idea where the problem is? When I delete the "on note" part it works but then all groups are still active and the CPU goes up very high.
Thanks!
on init declare $i declare ui_button $group1 declare ui_button $group2 declare ui_button $group3 declare ui_button $group4 declare ui_button $group5 declare %buttonIds[5] %buttonIds[0] := get_ui_id($group1) %buttonIds[1] := get_ui_id($group2) %buttonIds[2] := get_ui_id($group3) %buttonIds[3] := get_ui_id($group4) %buttonIds[4] := get_ui_id($group5) end on on note disallow_group($ALL_GROUPS) allow_group(0) allow_group(6) if ($group1 = 1) disallow_group(0) allow_group(1) allow_group(6) end if if ($group2 = 1) disallow_group(1) disallow_group(3) disallow_group(4) disallow_group(5) allow_group(2) allow_group(6) end if if ($group3 = 1) disallow_group(1) disallow_group(2) disallow_group(4) disallow_group(5) allow_group(3) allow_group(6) end if if ($group4 = 1) disallow_group(1) disallow_group(2) disallow_group(3) disallow_group(5) allow_group(4) allow_group(6) end if if ($group5 = 1) disallow_group(1) disallow_group(2) disallow_group(3) disallow_group(4) allow_group(5) allow_group(6) end if end on on ui_control($group1) if ($group1 = 1) $i := 0 while ($i < num_elements(%buttonIds)) set_control_par(%buttonIds[$i], $CONTROL_PAR_VALUE, 0) inc($i) end while $group1 := 1 end if if ($group1_enabled = 0) set_engine_par($ENGINE_PAR_VOLUME, 630000, 1, -1, 0) set_engine_par($ENGINE_PAR_VOLUME, 0, 0, -1, 0) $group1_enabled := 1 disallow_group($ALL_GROUPS) allow_group(0) allow_group(6) else set_engine_par($ENGINE_PAR_VOLUME, 630000, 0, -1, 0) set_engine_par($ENGINE_PAR_VOLUME, 0, 1, -1, 0) $group1_enabled := 0 end if end on on ui_control($group2) ... end on on ui_control($group3) ... end on on ui_control($group4) ... end on on ui_control($group5) ... end on
Tagged:
0
Back To Top
Categories
- All Categories
- 21 Welcome
- 851 Hangout
- 78 NI News
- 411 Tech Talks
- 1.9K Native Access
- 8.6K Komplete
- 1.1K Komplete General
- 2.2K Komplete Kontrol
- 3.1K Kontakt
- 726 Reaktor
- 252 Battery 4
- 493 Guitar Rig & FX
- 287 Massive X & Synths
- 512 Other Software & Hardware
- 3.4K Maschine
- 23 Sampling Room
- 4.2K Traktor
- 3.9K 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