Forums > MaxMSP

pattrstorage: recalling elements in sub patches more conveniently?

April 24, 2014 | 12:07 am

Pattr System Overlords,

With the pattrstorage / pattr system, is there a way to do the following:

      Have a parent patch "ParentPatch" containing X identical sub patchers of type "SubPatch"
      Each "SubPatch" has a bunch of objects who’s values I want to store and recall together as presets.
      In "ParentPatch" each "SubPatch" wants to have *different* presets (so just saving presets in SubPatch wouldn’t work) so they will be stored and recalled independently.
      Be able to store / recall presets for each SubPatch from ParentPatch without needing to send store / recall messages to each individual element in SubPatch I want to recall.. (Yes, this is fundamentally an "I’m lazy" inquiry.)
      In case its not clear I don’t expect the standalone SubPatch to be maintaining presets itself. It’s not a hard requirement that it couldn’t, but I want to just be writing one pattrstorage file from ParentPatch that contains n presets for X different.

In the past I’ve done this by making a list of the element names I want to refer to within the SubPatch and passing the parent base path (something like ::parent::SubPatch[1]) as an argument to SubPatch so that with a single message from outside the SubPatch iterates through the list of element names and pattrforwards a bunch of "store/recall" messages to the pattrstorage in ParentPatch for its (the SubPatch’s) own elements. This would be tidier if I didn’t have to build the message-constructing system and inform the SubPatch of its path (relative to ParentPatch) as an argument.

I feel like there has to be a better way and that I must be missing something about how the pattr system can work that would make this (I assume) common design problem easier.

Any ideas?

Thanks in advance,
Tyler


April 24, 2014 | 12:25 pm

If I understand this correctly then try:
pattrstorage @greedy 0 at the top level
named autopattr @autoname 0 objects in the top level patch and each subpatch
Use arguments (like autopattr #1_subpatch) so each subpatch has a different name
Name the UI objects you’d like to include in pattr
Then a preset stored in the top-level pattrstorage should control all the subpatches.
Unless I’m not understanding something…

  • This reply was modified 3 months by  John.

April 24, 2014 | 9:12 pm

Hi John, thanks for the reply. Probably my fault. One of the hopeful outcomes from the design was to be able to store and recall different presets for each sub patch (i.e. SubPatch[1] is on preset 5 while SubPatch[2] is on preset 3), and a single preset connect to the top-level pattrstorage won’t allow for that.

(That said, only while revisiting potential preset object solutions I realized that the preset object could refer to a pattrstorage object elsewhere in the hierarchy. This is easy and convenient but since it requires a pattrstorage in each sub patch it still ends up with a situation of writing multiple pattrstorage files.)

If I were writing this as an enhancement request for Max, it would basically be to allow pattrstorage to store/recall presets for all children of a given autopattr node / subpatch with a single message.


Viewing 3 posts - 1 through 3 (of 3 total)