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?
Try using [value]. It’s mentioned in the "see also" section of the [pvar] help file.
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.
----------begin_max5_patcher---------- 386.3ocyTEsSCBCE8YVx9GZ5y3BsS1.eyuCyho.crZf1EnnSW7e21KqJyM1v 4RzW3ld5kaOmSu8tc7HObhZCuFitC8.xyaqAwCvrHdN.ObIaSZAqFRDqU44E br+t8TM5BtV+5ZdaYvBoFiV31dMSmtRHyerhmpayHJdRfOhD.AZf66W+iroT HMEENOhCUjAGuJ4oaHQ3N41xf1jAz2GOxFMA+AqJI+ESk+rrZ9Ffs3RttRYH aP+BNgIyOshiofhCI1vrvCU7RkTKYkPEw2WIXE3iZFziYFy6yL5V8ZwaP0IF pb4lTSYBu5zW89CwPHQSAGgNyFBCtbG4XsGzdLD502P5oq4YVQCGsTo52qNm AcKXPsuUBiutFD4W1wzxBbgPdvvCPK1M9lsUqZpRcZ201h5nmLdsVHYZgR1M q8SZkHKiC6G3fJEYqUlFucDAsn+KyAyM5+WpYG8M.tM+ugbCgazeJ0HwSmDZ Z+oQvqf4vLi8WQHvHDhYPa3tUGHHKfI7AjLRExL -----------end_max5_patcher-----------
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.
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…
----------begin_max5_patcher---------- 441.3ocyV98aBBCDG+YLw+GZ5yLRaADcus+NVLK7ip1En0.kM2L6+8AGfSmh CUhrmtz6NZ+de33JaGOx.Gn1vyvnGQOiLL1V3w.7U5wnwgANweSXreFjHVxe WE7J1rNlluQC9SQgq7kK4Q6Box0wbs9i07pS.iQyahs1WGtRHW9RJOTWElQ8 rHlHFwtzLwoZgE4mGZgRpk9Iv1geJU3Gu6rj4IBYwoAZjz3UDAoVn2GlrepU JCxkt+lmI9D1bJyh.t+Z7nRagw7lAT1Q.5DPf54B08LB.gIWODnm.Bts.Axc CBZT.RzdGRPAfvlHrPpOeyB0qFMfwlY41mbxoENwtabppU4LeJUCoKfUTOVo wkzu8T1svJ69mU4IA7z1YRMOfdn+.HSAfX6U11z2.gM3MOu4GmyQKTpqcTLc FEXhsK.nY8Kfn23n3JUfiExit6Bpkx.+BaYp7zvlZu95.zdkSDOSKj9ZgRtW RzCSZkHJhKOXdYhHZspnuqVGn4s+tryRyoKRycvjF8+I0r6B0bFDow5hzrGD oQ6hzXWpzXDBbebwX1Ryzpek6fUTFjBcJLBFVcTAU5nv7MPeTTU+ -----------end_max5_patcher-----------
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.
Forums > MaxMSP