Using menu to change key switch sets
I have asked about this before but I am trying something a little different now and am stuck. I have tried to adapt the code from the Kontakt factory library so I can have two different sets of key switches (a 'simple' set and an 'advanced' set). The idea is that there is a menu with a dropdown for each set and when one is selected the other set is deactivated. However, I am struggling to disable the set of key switches that I am not using. Below is the 'on note' section of what I have so far but it isn't quite working. Any ideas? At the moment KS 1-4 work on the 'Simple' dropdown and then don't work on 'Advanced' (how I want it) but KS 5-8 don't work when the 'Advanced' dropdown (not how I want it!).
on note ignore_event($EVENT_ID) play_note(%actual_keyswitches[$active_group],1,0,1000) $played_note_id := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1) if($simple_advanced_menu = 0) {Simple Dropdown} if (search(%actual_keyswitches,$EVENT_NOTE) # -1) ignore_event($EVENT_ID) end if if ($EVENT_NOTE = $key_switch_1 or... $EVENT_NOTE = $key_switch_2 or... $EVENT_NOTE = $key_switch_3 or... $EVENT_NOTE = $key_switch_4) $count := 0 while ($count < 4) set_control_par(%articulation_id[$count],$CONTROL_PAR_VALUE,0) inc($count) end while $count := 0 while ($count < 4) set_control_par(%articulation_id2[$count],$CONTROL_PAR_VALUE,0) inc($count) end while ignore_event($EVENT_ID) if($EVENT_NOTE = $key_switch_1) $button_1 := 1 $active_group := 0 play_note(%actual_keyswitches[0],1,0,1000) end if if($EVENT_NOTE = $key_switch_2) $button_2 := 1 $active_group := 1 play_note(%actual_keyswitches[1],1,0,1000) end if if($EVENT_NOTE = $key_switch_3) $button_3 := 1 $active_group := 2 play_note(%actual_keyswitches[2],1,0,1000) end if if($EVENT_NOTE = $key_switch_4) $button_4 := 1 $active_group := 3 play_note(%actual_keyswitches[3],1,0,1000) end if if($simple_advanced_menu = 1) {Advanced Dropdown} if (search(%actual_keyswitches2,$EVENT_NOTE) # -1) ignore_event($EVENT_ID) end if if ($EVENT_NOTE = $key_switch_5 or... $EVENT_NOTE = $key_switch_6 or... $EVENT_NOTE = $key_switch_7 or... $EVENT_NOTE = $key_switch_8) $count := 0 while ($count < 4) set_control_par(%articulation_id[$count],$CONTROL_PAR_VALUE,0) inc($count) end while $count := 0 while ($count < 4) set_control_par(%articulation_id2[$count],$CONTROL_PAR_VALUE,0) inc($count) end while if($EVENT_NOTE = $key_switch_5) $button_5 := 1 $active_group := 4 play_note(%actual_keyswitches2[0],1,0,1000) end if if($EVENT_NOTE = $key_switch_6) $button_6 := 1 $active_group := 5 play_note(%actual_keyswitches2[1],1,0,1000) end if if($EVENT_NOTE = $key_switch_7) $button_7 := 1 $active_group := 6 play_note(%actual_keyswitches2[2],1,0,1000) end if if($EVENT_NOTE = $key_switch_8) $button_8 := 1 $active_group := 7 play_note(%actual_keyswitches2[3],1,0,1000) end if end if end if end if end if end on
Answers
-
There was no need for a new thread, let's keep it in the original thread please.
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 785 Tech Talks
- 4.1K Native Access
- 16.5K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 379 Battery 4
- 845 Guitar Rig & FX
- 429 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.3K Traktor
- 7.3K 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