Anyway to create an alias that works across patches?

    Jul 13 2009 | 1:37 am
    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?

    • Jul 13 2009 | 3:09 am
      Try using [value]. It's mentioned in the "see also" section of the [pvar] help file.
    • Jul 13 2009 | 4:35 am
      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.
    • Jul 13 2009 | 8:18 am
      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.
    • Jul 13 2009 | 12:47 pm
      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...
    • Jul 14 2009 | 7:34 pm
      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.