make_instr_persistent for function/group select

Assuming I have a callback for switches selecting a sample group.
If I was to switch samples/groups how do I keep this persistent if the script is reset (panic reset)?
Below is a snippet of what I am doing (as an example)
function callback set_control_par(%ID[$original],$CONTROL_PAR_VALUE,0) set_control_par(%ID[$selected],$CONTROL_PAR_VALUE,1) $original := $selected end function on ui_control($switch) $selected:= 0 $group := 0 call callback end on on persistence_changed call callback end on
I'm allowing and disallowing 'on note'
Any pointers appreciated :)
Thank you
Answers
-
I'm assuming you have more than one switch there, that all select from the pool of available sounds. Say 10 switches but only 1 selection out of those 10. In that case I would have a variable that stores which sound is selected (0-9) and make that persistent (not instrument persistent, because this wouldn't be stored in snapshots, which is probably what you don't want). Then your function would run through all 10 switches and only set the one matching the value of that persistent variable to 1, others to 0.
1 -
Your assumption is correct.
I'll try this script in a different slot and report back, should it help anyone else out.
This is a good point re: snapshots.
I don't currently have any intention of using them, but should they be needed later, it's best to cover all bases.
Thanks Mario
- Rich
0
Categories
- All Categories
- 19 Welcome
- 1.6K Hangout
- 65 NI News
- 825 Tech Talks
- 4.2K Native Access
- 17.1K Komplete
- 2.1K Komplete General
- 4.5K Komplete Kontrol
- 5.9K Kontakt
- 1.6K Reaktor
- 390 Battery 4
- 873 Guitar Rig & FX
- 440 Massive X & Synths
- 1.3K Other Software & Hardware
- 6K Maschine
- 7.6K Traktor
- 7.6K 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