[PD] best way for saving a patch state ?

Roman Haefeli reduzierer at yahoo.de
Tue Sep 20 03:30:24 CEST 2005

hi tebjan

i'm not sure if there is an easy solution. it also depends on what you'd like to do/have. if you only want to store one state, you could use a small hack with set-messages: when changing values, you [set $s( a message-box to the new value. when you save the patch all values are saved in the message-boxes. when loading the patch you trigger all those messagebox with a loadbang to set all guis to the state before. but this is a lot of work and a little bit messy, since you need for each gui, that you want to save the state, at least three additional objects ( [set $1(,[  (, [loadbang]). this method does not allow to save different states of the same patch and you cannot do it with abstraction (-> biiig patches...)

another method would be, to write a state-abstraction, so that each gui gets connected bidirectional to one of them. then you need something like a chief abstraction - only one per patch. if you want to save a state, the chief abstraction tells all state-abstraction in the patch to send their values. the chief-abstraction receives all this data and writes it into a textfile with an unique name. to recall a saved preset, the chief abstraction reads the textfile and sends the data to all state abstractions, while they set the guis to the old state. this means that every state abstraction needs a unique ID (name or number). this might sound like lot of work, but like this you can save as many preset as you want to. (and you can reuse the state- and the chief-abstraction in each patch).

i use the second method in netpd. i think, the method frank barknecht is using with memento is quite similar (i'm not quite sure). the latter is quite well documented. so have a look:


On Tue, 20 Sep 2005 01:22:01 +0200
Tebjan Halm <tebjan at gmx.de> wrote:

> hi,
> i am sure this i a FAQ. can someone give me a short hint whats the 
> easiest way to store one or more patch states ?
> some years ago i was an excessive pd user, but i can't remember all the 
> tricks.
> thanks for help ...
> tebjan


Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

More information about the Pd-list mailing list