Page 1 of 1

Saving Interface State as a preset

Posted: 25 Mar 2014 16:44
by mssngmrblz
Is it possible to save the current state of a lemur interface/window as a preset? and then switch between several of them?

Patrick

Re: Saving Interface State as a preset

Posted: 26 Mar 2014 01:14
by Softcore
No other way, at the moment, than just saving the template (probably with a different name)

Re: Saving Interface State as a preset

Posted: 26 Mar 2014 15:09
by analog604
Patrick, If you want to switch between control settings within the same template, there are ways, but it takes scripting work.

What I do is create an object with vectors variables used as memories.
myMem
preset1
..to..
preset10 (or whatever)

Then create a set of controls. A button that runs a script that will copy all the slider, button, switch states into each preset vector variables.
something like:
myMem.preset1={myKnob1.x,myKnob2.x,firstof(mySwitch1.x),firstof(mySwitch2.x),slider1.x};
Add a set of preset bank select buttons.
And another to restore the selected preset bank.
(and again to continue the code example)
myKnob1.x=myMem.preset1[0];
myKnob2.x=myMem.preset1[1];
mySwitch1.x[myMem.preset1[2]]=1;//if switch is a radio button it is vectors otherwise mySwitch1.x=myMem.preset1[2];
mySwitch2.x=myMem.preset1[3]
slider1.x=subarray(myMem.preset1,4,sizeof(slider1.x));//be sure to use subarray to copy exactly the size of the slider1.x values

You can have many banks of variables to do lots of presets, but will need to figure out how to use setexpression and getexpression to reference the vector variables indirectly.

Once you have it up and running and saved different states of interface screens to your new memory banks, save the template (on iPad) as a new name as Softcore suggested, and next time that you load it, you will have all the presets available (so long as they are not cleared by an initialization script).

It does take scripting and planning to make work correctly, and for me it is not always easy to get right. I think that the process may actually cause hair loss. :D

There are many examples of templates in the user library that implement presets.
Hope this helps.
Jay