Page 1 of 1

snapshot

Posted: 06 Oct 2013 19:10
by markscheel
hello

i m trying to make a snapshot function for my layout of faders and knobs.
i m able to get the values of faders and switches and store them into a global variable.
to restore my faders i iterize through that variable and send the values back to the faders.

now i want to apply this scheme to a multiswitch (radio button style). when i feed the value back into the object the right switch geta illuminated
but the others are still filled with color. i know that i could put a function into the multiswitch to reset the multiswitch. the problem is that the function that
put the values back is not knowing when to invoke the function inside the multiswitch.

maybe someone has some hints or a general suggestion on how to built a snapshot function.


many thanx in advance
cheers

mark

Re: snapshot

Posted: 07 Oct 2013 19:00
by mat
Hey Mark,

on radio switch you normally have to save (and recall) all switchs, like {0,0,1,0}.
Although in radio mode you can manually only have one switch of the switchrow on, a script overrides somehow this radio mode fact and need values of all switches individually! (good question why.... as the switchtype stays radio... maybe same source why physics or release time on pads also can not programmed propper....they need touch)

There is a way of reducing these values to only one again:
For saving use a firstof(Multiswitches.x) to identify the active switch.
For loading try something like that (not tested):
Multiswitches.x= {0,0,0,0} (set all 0)
Multiswitch.x[value_from_firstof]= 1 (set only one switch to 1)
(you can adress individual switches in brackets [])

Hope that helps
mat

Re: snapshot

Posted: 16 Oct 2013 08:58
by markscheel
hi mat


indeed that helped a lot.
tried it this way and it worked out great.

thank you for taking the time to answer.


cheers

mark

Re: snapshot

Posted: 19 Oct 2013 12:56
by mat
hey mark,

nice to hear :)
enjoy Lemur scripting.

this old tutprial from JM might also be interesting:
http://www.jazzmutant.com/workshop_tuto ... id=storing
or the tutorial list at all:
http://www.jazzmutant.com/workshop_tutorialslist.php

g*mat