Forums > MaxMSP

help! – multiple identical bpatchers, not saving different state in parent patch

October 25, 2010 | 7:50 pm

Hi,

I am having some trouble doing what must be a common operation. I have a re-usable control that I am using multiple times in a parent patch, by including multiple bpatchers that point at the control’s saved patch. I’d like it if the current settings of each of the controls could be saved and recalled with the parent patch. Instead, when I load the parent patch, each of the bpatchers using the control, are reset to the values stored in the control’s patch — in other words, they all get set to the same original (template) values, instead of the values that were on the control instances the last time the parent patch was saved.

I feel like I have tried just about everything to make this happen, and must be missing something fundamental.

Could anyone describe or send a basic example of the right way to do this?

I am using Max 5.14 on MacOs 10.6.4.

YOU WILL ROCK MY WORLD if you can help this newby (me) get this working!!!

Thank you!!

Dave


October 25, 2010 | 9:09 pm

one question: how do you store your recent setting for objects in the main patcher?

what works for objects should work for subpatchers and bpatchers, too.

-110


October 25, 2010 | 9:28 pm

You need to look into pattr attributes and pattrstorage. Typically this is done by putting an autopattr object in your subpatch and then placing a pattrstorage object in the parent patch.


October 25, 2010 | 10:03 pm

bpatchers will always revert back to the original, template settings. When you load the main patch it loads the bpatcher instances from the master bpatcher file, so there’s no way it can remember what you changed last time. If you put a preset into the master bpatcher, you can store some presets, but each bpatcher will still have the same default settings (and stored presets). However, you could have a write/read command for your preset, then if you save them as separate preset files, you can load them into each instance. So each bpatcher would have its own unique bank of presets. But just saving presets while the main patch is running won’t change the presets in the bpatcher master.

For the most options you’ll want pattrstorage @greedy 1, and an autopattr in the bpatcher master file. Then you can store different slots for each and they’ll be reloaded when you re-open the main file.


October 25, 2010 | 10:32 pm

Thanks everyone… I’ve tried to do everything each of you said, and I still can’t get it to work. I’ve attached a simple test case.

In particular, what I want is to be able to open the parent_patch, change the two values, click the save button in the patch (if I must), then save the parent patch from Max menu ‘File->Save.’ Then, when I reopen the parent_patch, I’d like the last values that I saved to appear, rather than the initial values from the test_control.

Can anyone spot what I’m doing wrong?


October 25, 2010 | 10:58 pm

You’re trying to load preset one before the settings file is done reading. Here’s your top level patch with a possible solution.

– Pasted Max Patch, click to expand. –

October 26, 2010 | 4:58 am

THANK YOU EVERYONE!!! Chris, that was the lurking error! Everyone else, thanks for getting me to where I needed to get!

YOU ALL ROCK!

st


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