How to properly use #args with poly~
Hi All,
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!
Valentin
Save first patch as "simple-poly-ex". This doesn't explicitly use 'enable' but the principle should (hopefully) be clear...
Example patch using poly~
Thanks!
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.
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.
V
"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.
-110
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...