getting poly~ voices

4lefts's icon

hi,

apologies if this has been answered before - i tried searching, but please direct me to another thread if it has.

my question is this: is there a way for a patcher loaded into [poly~] can find out how many voices are loaded? e.g. to find out the "16" in [poly~ somepatch 16], in the same sort of way it can use [thispoly~] to find out it's own voice number? (the reason for wanting to do this is so that i can set the phases of phasors for windowing relative to the number of voices in the subpatch, i.e. that the phase of each would be "voice number from [thispoly~] * (1/total number of voices)")

hope that makes sense.

thanks

stephen,

Charles Baker's icon

the voice instance number is reported by the thispoly~ object out the left outlet when the object receives a bang...check out the manual page (link @ top right of help patcher) for thispoly~ : the mechanism is well explained,
imho.
g'luck
cfb

4lefts's icon

sorry, i didn't explain properly. i know [thispoly~] can get the voice number for that particular voice, but is there a way get the total number of voices for that poly object, like 16 voices or whatever?

thanks

pid's icon

hi 4lefts.

this isn't possible from thispoly~, although it sure would be useful.

Max Patch
Copy patch and select New From Clipboard in Max.

two things you can do:
1-- from wherever you are feeding your requested voice numbers dynamically directly also feed this number into the patch via 'target 0'.
2-- a nice little hack a few people use is this one: (this time courtesy of a nobuyasu sakonda patch, but you'll see many people use it. in fact there is a version of this in the examples folder somewhere i think):

4lefts's icon

thanks pid - that's a nice idea! good ol' sakonda. where would granulation and stuff be without him?