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 :)
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
foundation77 Member Posts: 2 Newcomer
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.
- 10.8K All Categories
- 22 Welcome
- 451 Hangout
- 59 NI News
- 210 Tech Talks
- 1.1K Native Access
- 5K Komplete
- 625 Komplete General
- 1.1K Komplete Kontrol
- 1.9K Kontakt
- 492 Reaktor
- 160 Battery 4
- 272 Guitar Rig & FX
- 203 Massive X & Synths
- 211 Other Software & Hardware
- 2.3K Maschine
- 14 Sampling Room
- 2.6K Traktor
- 2.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