Can you us a note to change a menu item?
First of all thank you so much to anyone who takes their time to help me with this question.
I am super new to scripting just started about 2 weeks ago, and I have menu items that allow different groups just like my key switches do. However I would like to be able to have the menu item change when the key switch is pressed.
Basically when I hit note 0 I want kontakt to select item 1 in my menu. I tried with the select command but that seems to not work or I did it wrong.
This way the user can either use a keyswitch or dropdown menu and still get visual feedback.
Is this possible in Kontakt? This is what I have so far.
on init declare const $keyswitch1 := 0 declare const $keyswitch2 := 1 set_key_color($keyswitch1, $KEY_COLOR_RED) set_key_color($keyswitch2, $KEY_COLOR_RED) declare $current_state declare $count declare ui_menu $menu $menu := 1 $count := 1 while ($count < 14) add_menu_item ($menu, "Ethereal " & $count,$count) inc ($count) end while end on on note disallow_group($ALL_GROUPS) if ($current_state = 0) allow_group(0) end if if($current_state = 1) allow_group(1) end if if ($EVENT_NOTE = $keyswitch1 or $menu = 1) $current_state := 0 select ($menu) case 1 end select end if if ($EVENT_NOTE = $keyswitch2 or $menu = 2) $current_state := 1 select ($menu case 2 end select end if end on
Best Answer
-
This can be much simpler.
on init declare const $NUM_KS := 2 declare const $FIRST_KS := 0 declare $i declare ui_menu $menu while ($i < $NUM_KS) add_menu_item($i, "Ethereal " & $i, $i) inc($i) end while make_persistent($menu) end on on note if (in_range($EVENT_NOTE, $FIRST_KS, $FIRST_KS + $NUM_KS - 1)) $menu := $EVENT_NOTE - $FIRST_KS { this assumes the first menu entry value is always 0! } exit end if disallow_group($ALL_GROUPS) allow_group($menu) end on
0
Answers
-
@EvilDragon Can you help DaDrumBum1 with the scripting? 🙂
0 -
This can be much simpler.
on init declare const $NUM_KS := 2 declare const $FIRST_KS := 0 declare $i declare ui_menu $menu while ($i < $NUM_KS) add_menu_item($i, "Ethereal " & $i, $i) inc($i) end while make_persistent($menu) end on on note if (in_range($EVENT_NOTE, $FIRST_KS, $FIRST_KS + $NUM_KS - 1)) $menu := $EVENT_NOTE - $FIRST_KS { this assumes the first menu entry value is always 0! } exit end if disallow_group($ALL_GROUPS) allow_group($menu) end on
0 -
Thank you so much @EvilDragon!
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 785 Tech Talks
- 4.1K Native Access
- 16.6K 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