Forums > MaxMSP

How to know which voice poly~ is triggering?

November 1, 2008 | 1:50 pm

Is there a way to report which voice has just been triggered (not been freed) in a poly~ patch?

I can’t such a command in the help file for poly~.


November 1, 2008 | 3:56 pm

Quote: oivindi wrote on Sat, 01 November 2008 07:50
—————————————————-
> Is there a way to report which voice has just been triggered (not been freed) in a poly~ patch?
>
> I can’t such a command in the help file for poly~.
—————————————————-

The help files are never the final source for information.
The ref page is the place you should be mentioning. That
said, there’s not really a way to do it that I can think
of.

Oh, wait! – adding a #0 in a message box would list each
instantiation with a unique number, but associating that
number with a specific target would mean….

You could do this:

1. add a #0 in a message box to your subpatch and
some outlet logic to send that number.

2. on opening your poly~ patch, send a message "open 0"
to the poly~ object, and make sure that the message
box containing the #0 is attached to the same bit
of the subpatch that sends the "mute 0, 1" nessage
to the thispoly~ object.

3. the resulting output would give you the "base"
number for the #0 value and you could number instantiations
from there with a couple of objects.

This presumes that the attachment of the unique
integer is NOT done when some message is sent to
any given instantiation of the poly~ subpatch,
and that seems to be the case.

Try that.


November 1, 2008 | 5:08 pm

Easy.

In your poly~ patch, trigger a bang off of the input to the patch. Send this bang to a thispoly~ object. The thispoly~ object will output its instance number. From there, you can send that instance number to a send object. Put the corresponding receive object in the main patch, and you will get the most current instance number out of it each time something is triggered. If you don’t need the instance number every time, then you can send the output of the thispoly~ object to a value object, which will store the most recent value. Then in your main patch, when you need to know the most recently triggered instance, just query another value object (with the same name) and it’ll tell you.

Make sense?


November 1, 2008 | 7:10 pm

Nice solution. I guess you can tell who’s
actually needed to do this at some point
prior to reading Oivind’s posting. :-)


November 1, 2008 | 9:01 pm

Thanks for the suggestion, guys!

Btw, one more thing: Is there a way to assign a (midi)note trigger to a particular voice, so that every time the note is triggered it triggers, say, voice #1 or #10?

I tried using "target" right before the note message is sent to poly, but that isn’t working (though I might be doing it wrong).


November 1, 2008 | 9:06 pm

The target message is exactly what you want to use. Can you post that portion of the patch so we can see what you’re doing?

If you want the 10th voice to receive the next message, then just send a message of "target 10" and then send your messages through.


November 1, 2008 | 9:09 pm

By the way, if you’re using the "note" or "midinote" messages to send notes into the poly~ patch, then that (by definition) is going to cause your "target" messages to be ignored. The whole point of using note and midinote is to let the poly~ object decide which voice to target based on which ones are busy. If you want to choose which voices to target yourself, then just send the target message, and send the note information through an inlet without any note or midinote message before it.


November 2, 2008 | 2:27 am

Scott schrieb:
> In your poly~ patch, trigger a bang off of the input to the patch.
> Send this bang to a thispoly~ object. The thispoly~ object will
> output its instance number. From there, you can send that instance
> number to a send object.

you can also send it simply to an outlet of poly~, I often create
messages prepended with additional information including voice number to
either be sent to an outlet or be printed for debugging purposes…

And there is also the busymap message to poly~ which can be useful to
ask poly~ about busy states…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


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