Unique Arguments for Poly~ Instances?

Nov 8, 2008 at 5:04am

Unique Arguments for Poly~ Instances?

Is it possible to define a unique argument for poly~ instances? I have one variable that I would like to be unique for each poly~ instance that I would like to specify manually (as such using #0 isn’t what I’m going for).

So for example, if I have 3 poly instances I’d like to define the argument as 5, 7, and 8 for each respective instance. Is this possible?

#40728
Nov 8, 2008 at 5:29am

As far as I know (I could be wrong) you can’t specify arguments for each instance within a [poly~]. It looks like you want the argument to relate to the instance number, so you could use an argument that is the same for all instances and scale it using the [thispoly~] object. In your example, you could set the argument to 4, and then use [thispoly~] to add 4 to the instance number. You will not be able to pass the argument directly as an argument to a second object like you would with #1, but you would have to use the set message.

Let me know if that is not clear, I will post an example tomorrow or something if I have time, or maybe someone else can step in before that.

#144396
Nov 8, 2008 at 10:00am

You could also store the “arguments” in a table, and connect thispoly~ to the table so that the instance number refers to the corresponding index in the table. If you want to pass the arguments on to subpatches within the poly~, you could then use scripting to create the subpatch.

#144397
Nov 8, 2008 at 6:11pm

Yes, it is possible. “receive” without an argument and “forward” are your friends. Set up an inlet in your poly~ abstraction for specifying argument variables, then send a message to poly~ in that inlet:

target 1, 5
target 2, 7
target 3, 8

Then in you poly~ abstraction, have something like:

“sprintf set %i-mydata” >> “r” (your receive will now be “r 5-mydata” for the first, “r 7-mydata” for the second, etc.

do the same for your forwards (replace “set” with “send” above).

Just one option. You could also do something along these lines using the previous suggestion of using the poly~ instance # to look up values in a table or coll to set your unique arguments.

HTH,
David

#144398
Nov 9, 2008 at 12:44am

this works pretty well:

max v2;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 174 353 774 753;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 152 156 32 196617 print;
#P window linecount 0;
#N coll polyargs;
#T flags 1 0;
#T 0 something;
#T 1 somethingelse;
#T 2 anotherthing;
#P newobj 152 137 68 196617 coll polyargs;
#P newex 152 96 48 196617 loadbang;
#P newex 152 116 52 196617 thispoly~;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P connect 2 0 3 0;
#P pop;
#P newobj 223 157 109 196617 p this should be a poly;
#N coll polyargs;
#T flags 1 0;
#T 0 something;
#T 1 somethingelse;
#T 2 anotherthing;
#P newobj 223 136 68 196617 coll polyargs;
#P pop;

On Nov 7, 2008, at 9:04 PM, Clayton Grey wrote:

>
> Is it possible to define a unique argument for poly~ instances? I
> have one variable that I would like to be unique for each poly~
> instance that I would like to specify manually (as such using #0
> isn’t what I’m going for).
>
> So for example, if I have 3 poly instances I’d like to define the
> argument as 5, 7, and 8 for each respective instance. Is this
> possible?

barry threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
Web: http://www.barrythrew.com

#144399

You must be logged in to reply to this topic.