bpatcher & pattr issues

lchoi's icon

I need to set up a patcher that initializes every time with a pattr object bound to a bpatcher object. It appears that Max does not allow pattr objects to bind with bpatchers if the bpatcher is already linked to its patcher file.

My initial workaround was to save the file without the bpatcher linked so that the pattr object can bind to it as it loads. Then have a loadbang trigger a script to replace the bpatcher’s patcher name (which is null at this point in time) with a real file name.

This works fine but only as a one shot deal. For example, if I save my patch, the linked file name gets saved with the bpatcher. Thus, when reopening the file, the pattr object cannot bind to the bpatcher so I’m back at square one.

Does anyone have any experience with this or any ideas for a solution? I've searched the documentation, the Web and have asked a few fellow Max users and we're pretty stumped. Any help would be greatly appreciated.

Max Patch
Copy patch and select New From Clipboard in Max.

Please save as
MainFile.maxpat

Max Patch
Copy patch and select New From Clipboard in Max.

The bpatcher's patcher file. Please save as
LinkMe.maxpat

gregcoleinfo's icon

I have been frustrated with the same issue. I need to control the presentation_rect of bpatcher objects, but the pattr bindto breaks after the file is saved and loaded. If I find a solution I will post it here

gregcoleinfo's icon

I found a post in the forums that helps. Basically, you have to use a thispatcher object and a message like this "script sendbox ".

See the Gregory Taylor example and others at this discusion link.
https://cycling74.com/forums/simple-assignment-of-values-to-bpatcher-attributes-patching_rect

lchoi's icon

At long last, a solution. Includes documentation with a diagram that better explains the problem. Perhaps someone can suggest a more elegant solution. Please?

2979.ToughNut.zip
zip