Storing and reloading "states" of Max/MSP objects (e.g. value of a number box)

sowatt's icon

Is there a way to store the ... let's call it "internal state" of Max/MSP objects (e.g. value of a number box, information which inlet of s switch-object is open, etc.) when a patcher is closed. The only solution I can figure out, is to store these "internal state" informations in a coll-object, before the patcher is closed and then, when the patcher is opened the next time, read them form this coll-object and initiate the objects of the patcher with these informations when the patcher.

Maybe, however, there is a better (more simple) solution.

Thanks!

sowatt

Team TANDOT's icon

I think you want a [preset] object, maybe with a [loadmess 1] to initialise it.

Bernd L's icon
Max Patch
Copy patch and select New From Clipboard in Max.

yes, with pattrstorage. I attached a very simple pattr system, which works for me.

Team TANDOT's icon

I think the [preset] object is exactly what you want. you could [loadmess 1] it to load preset 1, and also have it write to/read from a file.

sowatt's icon

Thanks, bernd! Kind of that was, what I was looking for

Thanks, team dandot! To my shame I couldn't figure out, in a quick way, how the preset object works. I'll come back to that in due time. At the moment, pattrstorage is sufficient for me.

sowatt

sowatt's icon

btw:
@bernd: How can I create such a text representation, as you have attached to your post?

Floating Point's icon

you mean to post a patch to this forum? use the "copy compressed" command in the edit menu, then paste into your post

sowatt's icon

Yes! Thanks!

sowatt's icon

One more question has emerged:

Is is possible to influence the order in which paremeters are recalled by a 'preset'-object ?

(Note: I know it's possible with 'pattrstorage')

Jean-Francois Charles's icon

Short answer: yes.
Longer answer: yes, check [preset]'s Help File, tab "include".
Even longer answer: yes, but once you'll see the interpolation features of [pattrstorage], you won't use [preset] anymore.

Ben Bracken's icon

You can also check out Patcher Snapshots:
https://docs.cycling74.com/max7/vignettes/snapshots

-Ben