Saving/Loading button combinations with other buttons and a menu
Hey all,
I am working on a script that allows the user to save a preset to a specific button. So far I have 4 buttons which should be selected in any combination then by pressing the dropdown menu you can save or load. This all works fine but now I want to implement the 'Save to P1' and 'Save to P2' idea. By selecting either of these with the current button combination I want to be able to save the combination to the button so that when it is pressed it will load the combination. Further to this the idea, I want the user to be able to save their own combinations to the preset buttons meaning that you should be able to overide the previous selected preset. Below is what I have so far, any suggestions or ideas would be gratefully recieved:
{Load/Save Test} on init message("") set_script_title("Save/Load Test") {------------------------------------------Save/Load----------------------------------} declare $count declare %combination_buttons[4] declare $sync_id {---Save combinations of these buttons---} declare ui_switch $button1 declare ui_switch $button2 declare ui_switch $button3 declare ui_switch $button4 make_persistent($button1) make_persistent($button2) make_persistent($button3) make_persistent($button4) {---Preset Buttons---} declare ui_switch $preset1 declare ui_switch $preset2 make_persistent($preset1) make_persistent($preset2) move_control_px($preset1,66,25) move_control_px($preset2,158,25) {---Dropdown menu to give options: Save, Load, Save to P1, Save to P2---} declare ui_menu $load_save_menu make_persistent($load_save_menu) add_menu_item($load_save_menu,"Save",0) add_menu_item($load_save_menu,"Load",1) add_menu_item($load_save_menu,"Save to P1",2) add_menu_item($load_save_menu,"Save to P2",3) move_control_px($load_save_menu,500,2) end on on async_complete if ($NI_ASYNC_ID = $sync_id) $sync_id := -1 end if end on on ui_control ($load_save_menu) select ($load_save_menu) case 0 save_array (%combination_buttons,0) case 1 $sync_id := load_array (%combination_buttons,0) while ($sync_id # -1) wait (1) end while $button1 := %combination_buttons[0] $button2 := %combination_buttons[1] $button3 := %combination_buttons[2] $button4 := %combination_buttons[3] end select end on on ui_control($button1) %combination_buttons[0] := $button1 end on on ui_control($button2) %combination_buttons[1] := $button2 end on on ui_control($button3) %combination_buttons[2] := $button3 end on on ui_control($button4) %combination_buttons[3] := $button4 end on
Best Answer
-
That... is pretty complicated to do. To get an idea on how you'd go about it, you should check out how saving and loading mixer presets in Studio Drummer works.
1
Answers
-
You would need an array that holds your P1 and P2 presets too, persistent of course. Then store the state of buttons to that array in order to be able to retrieve it.
0 -
I am a little confused on where to start with this! As the .NKA files are stored in the data folder how do I 'hold' the P1 and P2 presets?
0 -
Well first, are P1 and P2 supposed to be stored in the NKA as well, or are they separate presets that you load INTO from the saved NKA?
Because the way you worder it in the code to me it seemed like "Save to P1/P2" options were meant to store the current state of buttons to an array, rather than load data INTO those presets from NKAs...
0 -
So the main idea is to link P1 and P2 (I actually want 24 total) to key switches meaning that you can change to different button combinations (to give different sounds) in the middle of a MIDI mock up. In itself that isn't too difficult but in addition to this I want the user to be able to create their own button combinations and have the option of using them live and cycling through them with key switches. I have now changed my idea slightly in that basically I want P1 and P2 to be menus that when you click on them they will show the saved presets you have made (.NKA files). When selected the .NKA file is 'saved' to P1 or P2 and then you can cycle between your own presets in the midi mock-up. Hope that makes sense!
0 -
That... is pretty complicated to do. To get an idea on how you'd go about it, you should check out how saving and loading mixer presets in Studio Drummer works.
1
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 61 NI News
- 772 Tech Talks
- 4K Native Access
- 16.4K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 376 Battery 4
- 835 Guitar Rig & FX
- 425 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.7K Maschine
- 7.2K Traktor
- 7.2K 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