Saving Interface State as a preset

Discuss Lemur and share techniques.
Post Reply
mssngmrblz
Newbie
Posts:45
Joined:03 Feb 2013 15:08
Saving Interface State as a preset

Post by mssngmrblz » 25 Mar 2014 16:44

Is it possible to save the current state of a lemur interface/window as a preset? and then switch between several of them?

Patrick

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Saving Interface State as a preset

Post by Softcore » 26 Mar 2014 01:14

No other way, at the moment, than just saving the template (probably with a different name)

analog604
Regular
Posts:262
Joined:29 Dec 2011 15:40
Location:north east, usa

Re: Saving Interface State as a preset

Post by analog604 » 26 Mar 2014 15:09

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
Dashboard gear control templates: User 112 Idx :: LModIt Lite :: SVG image converter for Lemur Canvas

Post Reply