Pattr binding between sister subpatchers in M4L

Chris Vik's icon

I'd like to (bindto) a [pattr] object that exists in a sibling patch. That is, I have two bpatchers/subpatchers in a M4L device, with an object in each that I'd like to connect via the pattr system.

Here's an example of how this looks side-by-side. The obvious difference is that when binding to a pattr object inside a different bpatcher, they would need to be able to reference to that other bpatcher somehow.

I'm used to using [pattrmarker] in Max - but isn't possible in most cases in M4L due to the shared namespace among M4L devices. Since I'd like to have multiple instances of the device, giving it a [pattrmarker] won't fit the bill.

Any ideas?

Chris Vik's icon

I ended up getting a response from Ronen from the M4L user group on Facebook:

As I see it, regardless of which pattr binding method you use, you'll always run into this problem of shared namespace. The way I used to avoid this is by setting the names to be some variation of the device id, or device parent. This way the names are unique. I use it for [table]s, [buffer~]s,[coll]s and [send]-[receive] pairs.

Here's what I ended up with for the marker script for those that are interested.

When applying the "bindto" message to a pattr object in the sister subpatcher, I can reference by using the message:

(bindto ::device::::)

Where is the device ID number, is the script name of the subpatcher, and is the script name of the object I'm mapping to.

My code currently only generates the ID on a [live.thispatcher] bang when the device is created - I haven't tried this out when the device is moved around the Live set. It should be simple to amend this to update when moved.