Anyway to create an alias that works across patches?

Jul 13, 2009 at 1:37am

Anyway to create an alias that works across patches?

I would like to set up aliases for a couple of parameters across a number of patches.

When a number is changed in one patch, it should change in all the others. The behavior of pvar is ideal except that it is limited to a single patch.

Send and receive has the right scope, but just setting them up to feed each other seems to create a feedback loop, which causes a stack overflow and crashes Max.

Any simple way of doing this? I am thinking perhaps of some way of disabling receiving when an object is being manipulated?

#44718
Jul 13, 2009 at 3:09am

Try using [value]. It’s mentioned in the “see also” section of the [pvar] help file.

lh

#160927
Jul 13, 2009 at 4:35am

So I guess you would use a (value) object, and then have a metro continually banging it to keep all the patches in sync?

Like this (open two copies of the same patcher, turn on the metros, change the numbox).

I tried sticking a change object between the numbox and the value to trigger a “changed” send and receive channel, but it didn’t work – there always seemed to be a value stuck in the pipeline somewhere.

– Pasted Max Patch, click to expand. –
#160928
Jul 13, 2009 at 8:18am

not a metro, no.

if you have a [v foo mymessage] here, and a [v foo] elsewhere,
you only have to bang the one elsewhere whenever you need
the “mymessage” at the elsewhere.

think of it as a shared [i] [f] or messagebox.

well, basicaly it works like [pvar], if you know how [pvar]
works, you should also know how [v] works.

-110

-

#160929
Jul 13, 2009 at 12:47pm

Well, the key is that the aliased message boxes *have* to update simultaneously. The one elsewhere must be seen to change immediately.

The following seems to work. I use a (change) object to detect a changed value, update the (value) then send a message via (send) that causes all the other (value) objects to send out their updated value. The (change) object is necessary to prevent a feedback loop, which crashes Max.

I suppose what would really solve this is an “alias” attribute for objects, that could reference a named object in another patcher…

– Pasted Max Patch, click to expand. –
#160930
Jul 14, 2009 at 7:34pm

You should take a look at the pattr object’s @bindto features. You can use pattrmarker to help communicate across patches, or set the Global Patcher Name in the patcher inspector to achieve the same thing.

Basically, just name one of your pattrs and have all the other aliased pattrs bindto that one. I can post an example later if you can’t figure it out.

#160931

You must be logged in to reply to this topic.