Forums > MaxMSP

Poly~ send #0-

December 27, 2012 | 7:59 pm

Hi all,

I’m using a poly~with 12 voices. In order to use the voice number of each instance of the poly~, I connected a s #0-instance box at the output of thispoly~. But, strangely, I don’t get the same index to the different s #0-instance in the same poly… so I can’t send the voice number to use it as an index value. I must specify that I have several subpatches in my poly~, but I don’t understand why it should be a problem… Does anyone have a clue ? I added my patch, it’s a little complicated (I also added some abstractions that are necessary to load the patch). Thanks !!

December 27, 2012 | 8:44 pm

Actually I found an explaination: it seems that when you add an abstraction in a poly~the #0 index is not the same… I’m not sure, but I transfered the contents of the abstractions in local patches and it worked.

December 28, 2012 | 4:05 am

it is not the same because you must consider difference poly voices are "different patches".

go in the help file and open the individual windows of the example poly patcher inside.
what you see there, is how you should think of how poly works internally. :)


December 28, 2012 | 4:08 am

one possible solution would be to use #1 inside, and initialize that with a [poly~ mypatch … args #0]


June 30, 2015 | 1:24 pm

Thank you Roman, that is a perfect solution to my problem!

BUT. It is not working for me. My poly~ object looks like this:

poly~ em.StoragePoly 2 args #0

The #0 is just showing ‘#0" when I reload the patcher. And the internal number for arg #1 is 0. It is not creating a number. Am I doing something wrong?

June 30, 2015 | 2:04 pm

I’m not aware of any other method to address individual poly~ instances but target messages – doesn’t passing args messages address all instances?

June 30, 2015 | 5:23 pm

Well, I do want to address all instances–in my poly object! Not instances in other poly objects elsewhere in my patch.

If I put a #0 INSIDE a poly object, it gets a different value for each instance. But I thought a #0 in the args to the poly object would work, and that’s what the previous poster suggested as well.

June 30, 2015 | 11:17 pm

if your poly is in the top level patch #0 will not work. But you could encapsulate it in an abstraction. #0 inside the abstraction will become a unique number.

July 1, 2015 | 9:40 am

You mean not the abstraction that is being hosted by poly then? The poly object sits inside the abstraction?

The scope of #0 is still confusing to me.

Can you give an example?


Edit: Never mind, I think I understand now.

July 1, 2015 | 11:32 am

Well, it is still not behaving as I’d like. When I put args #0 in the poly object, the #1s then have to be sent through every layer of subpatch in the poly object—#0 in a subpatch inside the poly gets its own number, and #1 just gives 0.

I thought I would create a convenience object to wrap thispoly~ (which sends a 0 on startup, so I need to make it part of my initialization routine to get reliable results) but getting the top level poly object a unique identifier for itself and all its subpatches looks like a huge amount of messy argument passing.

It would be really nice if the thispoly~ object just worked correctly, and didn’t send out an erroneous value. And it would be nice if #0 operated in poly like it does in other types of subpatches. But I think I can figure a way around this. I’ll just wrap thispoly~ in an initialization routine at the receiving end. Actually simpler, although less efficient I think.


Viewing 10 posts - 1 through 10 (of 10 total)

Forums > MaxMSP