Multi Grp Select by Menu + Prev Next Buttons

MTC84
Member Posts: 71 Member
Hi,
I want to add buttons for Previous and Next to toggle through the preset menu but I'm not sure how to do this exactly.
The basic menu script below works as it should (menu item 1 selects groups 0, 1 + 2) but the buttons are not coded fully yet. I have done this succesfully in another UI using a different method but it was for single group selections rather than mulitple groups (multi mic style).
Can anyone help with coding the Prev + Next buttons please?
Thanks.
on init make_perfview {makes the UI visible outside edit mode} declare const $UI_HEIGHT := 578 set_ui_height_px(578) {PRESET MENU CONTROLS} declare ui_menu $PRESET_MENU move_control_px($PRESET_MENU, 20, 62) set_control_par(get_ui_id($PRESET_MENU), $CONTROL_PAR_WIDTH, 183) add_menu_item ($PRESET_MENU, "NAME_1", 0) add_menu_item ($PRESET_MENU, "NAME_2", 1) add_menu_item ($PRESET_MENU, "NAME_3", 2) {PRESET MENU - PREV + NEXT BUTTONS} declare ui_switch $PRESET_MENU_PREV_BUTTON move_control_px($PRESET_MENU_PREV_BUTTON, 218, 57) set_control_par_str(get_ui_id($PRESET_MENU_PREV_BUTTON), $CONTROL_PAR_PICTURE, "Prev_Button") set_control_par(get_ui_id($PRESET_MENU_PREV_BUTTON), $CONTROL_PAR_HEIGHT, 40) set_control_par(get_ui_id($PRESET_MENU_PREV_BUTTON), $CONTROL_PAR_WIDTH, 40) set_control_par(get_ui_id($PRESET_MENU_PREV_BUTTON), $CONTROL_PAR_TEXTPOS_Y, 1000) make_persistent($PRESET_MENU_PREV_BUTTON) declare ui_switch $PRESET_MENU_NEXT_BUTTON move_control_px($PRESET_MENU_NEXT_BUTTON, 262, 57) set_control_par_str(get_ui_id($PRESET_MENU_NEXT_BUTTON), $CONTROL_PAR_PICTURE, "Next_Button") set_control_par(get_ui_id($PRESET_MENU_NEXT_BUTTON), $CONTROL_PAR_HEIGHT, 40) set_control_par(get_ui_id($PRESET_MENU_NEXT_BUTTON), $CONTROL_PAR_WIDTH, 40) set_control_par(get_ui_id($PRESET_MENU_NEXT_BUTTON), $CONTROL_PAR_TEXTPOS_Y, 1000) make_persistent($PRESET_MENU_NEXT_BUTTON) end on on note select ($PRESET_MENU) case 0 disallow_group ($ALL_GROUPS) allow_group (0) allow_group (1) allow_group (2) case 1 disallow_group ($ALL_GROUPS) allow_group (3) allow_group (4) allow_group (5) case 2 disallow_group ($ALL_GROUPS) allow_group (6) allow_group (7) allow_group (8) end select end on
0
Best Answer
-
I figured it out through some trial and error. The following was the key piece I needed.
on ui_control($PRESET_MENU_PREV_BUTTON) $PRESET_MENU := ($PRESET_MENU + $GROUP_COUNT - 3) mod $GROUP_COUNT $PRESET_MENU_PREV_BUTTON := 0 end on on ui_control($PRESET_MENU_NEXT_BUTTON) $PRESET_MENU := ($PRESET_MENU + $GROUP_COUNT + 3) mod $GROUP_COUNT $PRESET_MENU_NEXT_BUTTON := 0 end on
0
Answers
-
I figured it out through some trial and error. The following was the key piece I needed.
on ui_control($PRESET_MENU_PREV_BUTTON) $PRESET_MENU := ($PRESET_MENU + $GROUP_COUNT - 3) mod $GROUP_COUNT $PRESET_MENU_PREV_BUTTON := 0 end on on ui_control($PRESET_MENU_NEXT_BUTTON) $PRESET_MENU := ($PRESET_MENU + $GROUP_COUNT + 3) mod $GROUP_COUNT $PRESET_MENU_NEXT_BUTTON := 0 end on
0
This discussion has been closed.
Back To Top
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 791 Tech Talks
- 4.1K Native Access
- 16.6K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.8K Kontakt
- 1.6K Reaktor
- 381 Battery 4
- 850 Guitar Rig & FX
- 430 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.4K Traktor
- 7.4K 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