How to properly use #args with poly~
SO confused. I’m just trying to find a simple, complete example of how to pass a message (for instance "enable 1") using poly~ to a particular "voice" of the poly~
I have a main patch, and simply want to send a message to voice 1 or voice 2 of the sub patch. I am able to send an integer value using "in" (using target message to specify which "voice" i’m addressing) , but I don’t get the concept of using "pound-arguments" which seems to be the only way to send a symbol. I’ve tried looking everywhere and it just seems like it should be super simple, but it’s so unclear.
I need to be able to send "enable 1" to only one specific "voice" patcher at a time.
Would love to see a simple simple example of a main patcher, and a simple sub patch which is setup to get a message from the main patcher.
Thanks so much!
Save first patch as "simple-poly-ex". This doesn’t explicitly use ‘enable’ but the principle should (hopefully) be clear…
----------begin_max5_patcher---------- 468.3ocyUEsaBBCE8Y3qnoO6LsEAk819NVLKUnSqCKDZ0oy391GsTbtk5DUz rWZSO2KWN2CmdYquGbR9ZlDBdD7LvyaqummARC3YO6AWPWmjQklzfB164SlC 6UGRwVqLvKEEzj2.XfAwFkmZhUk+C3FrWyEJAcAyD4oRNMqIhX4BtHioLuG7 2f4KUMnjCJhj+goHXTejEtNS0lBVcGA4hJt.fPvXaFETUxLtX5KkrDUcRAHb UA.wD8JFgLai5i.i0OxNee8RuVpNKXRIcJyg.PNSAf3T.vmo.7mcNIZT+vpl MJre.JNNdTOPHtF4Ba+iXN3B.wkjLrSLEcplXcCgg5UxvqxLbD0nhP.rqqHc ibfbHGw6UCGsLd.ttYGo2BLGvC6bGfyVlbyb.wWnAvpFVCP3sPLTy3xh7rMe 5PQBtYyIiO4XR8VKjF6LxAQWk1b7Ik3n+eiJCFD2xQklp.y3he+aUSU03+TT j4KKSZ3f0A.P64RJSp3BphmKNHG8nhCRZFOMkIN7xeJWRmjwLhJx4Wm1RGxv 1vm6FczSLNIcBtezoErQyX7ciM3S8oJ5BoSswlVTrhUJs0zvjp60yyK0Gi5Y NxE0GMUDVxVwaxOzWWsc9ewmVQlI -----------end_max5_patcher-----------
Example patch using poly~
----------begin_max5_patcher---------- 843.3oc4XtzaaCCC.9bxuBAicLMv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1SskHqjceYsZZvjwl1aLS06nSM7.qUd+wpc64w+CfCSrI2 -----------end_max5_patcher-----------
I got it to work using your example. I’m still confused on a few things though.
It seems that if I just change the pack list to be a symbol and then an integer (as opposed to your example with a list containing an integer , then a symbol) it doesn’t go thru. Did I patch something incorrectly? I switch the pack to have "sym 0" as its args, and same on unpack, and the msg doesn’t go thru. The following works, but just switching the order of the pack and unpack arguments, nothing.
----------begin_max5_patcher---------- 694.3ocyWtrbaBCEFdM7TngoKc7fD2r6trrq6xNcxfgSIJEjXPxoNMS5ydgi DwNW.StgyF7HoiO5Web9kD2553sQtCTdjuR9Aww4VWGGrqtNbrsc7pR2kUlp vv7zxhhRvagYHw1J4VcInwAo1dMcouoFLY1iKzdjeZGsNUmcIWTbQCjoMAPS hV5ufDgOY98Ou+uvyw4Vt4pyXd2mllzJPCMW.hzMk3T4uWVbw8ppqu6bc6dr XhqxLYUEzJZa9zvNTodgKIeSnpaENISJzsgn5i4WssU7+h5ftZo+yRH+gYP. MAW2wq69gFuBakL.EBNbZEsf.G57FdZo2GMDBVR9NHxIZIQAksK.HmTKKuoO vRt.xjaEXzr2I7DtN.KQBQ5DhUJgqFfNrYfNsIXCzbj29syAuZa0gliGth6w Sap6CjMlKZAwaSpnXb2T.EgzZ7mX1nERziipShSi0Ujow5p+QNuoXa06oYiw B2WMwnAihH+SnWiZvfNsonmFuaa3DXrRwl8ahGiAz0ygiB9S6b8DDTml8ahO wV68RV7Cddzn1GasAiYbQrQKNnIuPvvdEfoBTpzB3IjQVCBBaFPh8rofPSIC EICKZ.jDcpQBcFQhezTPR3LfjArO786p71vwwtDm02PiQvrZ78SBlCf7BOg1 e1NgtGU9gG+D5jS7AzC4zrGI8E5hYvsYuRS+kiorwbaL5pSmcybgEEuptDNq qwYvtYYOZKhBVa97IVzn9u2.fv7gWx+Qe3HJpt9eH0TxsMY8KAaEMYupxAkl KR0bo3fX51f3fftjmmChCqqy4ptRcbI4+ru9lpbvxkiKnYTOSPNOVzenBZB5 IY1TCMYhusnyibh9TU7zcSiOSxIXJx40V7X1IJst9ZnQYyIJk1cpuR1z0Ldg q4PdSSLidMv0793ib6x1ct+G5WaYt. -----------end_max5_patcher-----------
Actually I’m also confused about this right now… I just sat down to try to help with your issue and I was going to suggest using route, (ie toggle to message [enable $1] outside poly~ and [route enable] inside the poly~ but I can’t for the life of me get it to work that way – it works perfectly *outside* the poly but not inside!!. The thing is, existing patches I have built in the past that use this method inside poly~ still appear to work ok!! I’m temporarily stumped and have exhausted checking for all the obvious traps, but right now I have to (grudgingly) leave it as I have to deal with more pressing issues. I’ll try to follow this up when I get a chance.
Exactly! [enable $1] is what I was trying, and it doesn’t come thru [in 1] . Nothing comes thru. Just seems so weird, but at least I’m not completely losing my mind. It seemed like this was so obvious, but it doesn’t work.
Thanks for checking it out, and I’ll try to make do with what you originally had.
"enable", "set", and some other messages should be generally prefixed with something else,
as they disappear when they go through objects which use this messages themselves.
sending "enable 1" to a [poly~] inlet is like sending "set 1" to [append foo], if you know what i mean.
Blinded by the obvious! Sigh… Thanks Roman. Sending ‘Enable’ is indeed the problem – as a consequence of being a ‘reserved word’. I had previously considered that which is precisely why I *didn’t* use it in the first posted example and still walked right into it later…
Forums > MaxMSP