Any way to change an attribute for all instances of the same object type ?

chapelier fou's icon

Here's my issue :

I've got a fairly big patch containing a lot of live.object instances. Their id are populated on set load and don't need to be saved with the set.

I didn't realize at first, but their "persistent mapping" attribute being ON by default potentially creates undo history entries on set load.

So I'm looking for a way to locate every live.object in the patch and disable their "persistent mapping" attribute.

Any idea ?

EDIT : good old cmd+F at least works for locating + selecting by subpatcher. Not bad, but still curious for other methods.

TFL's icon

Solution 1 (to be added in the root patcher. The 1 argument tells the object to search for the asked object in the same patcher level as well as subpatchers):


Solution 2:

Open your .maxpat in a text/code editor, search for "_persistence" : 1 and replace all finds by "_persistence" : 0

chapelier fou's icon

Wow, thanks for the quick reply !

this [universal] object was totally unknown to me ! That's kind of a super power.

Would you care explaing the "_" before "persistence" ? I wouldn't have found this by myself...

TFL's icon

Sure, "Use Persistent Mapping" is a hidden attribute, just like the Parameter mode related attributes (Long name, short name, range, initial value, etc.). They are hidden to prevent us from changing them programmatically as it would lead to unexpected results in a M4L device. This a debatable choice made by C74 and/or Ableton I guess to limit problems to their users and not make them have to deal with that.

But sometimes we still want to be able to address these attributes programmatically, like in a non-M4L patch, or in your case for editing a bunch of objects at the same time but not during runtime.

So in order to get the actual attributes name ("Use Persistent Mapping" being the attributes label), one of the remaining options is to select the attribute in the inspector, hit CMD+C or CTRL+C, create a comment or message object and paste in it. You will get a JSON string with the actual attribute name somewhere. This is also how you can "guess" that, for example, the "Range/Enum" attributes name is actually _parameter_range .

chapelier fou's icon

That's really helpful, thanks for the knowledge and help !