using function in poly~

Jay's icon

Greetings,

I'm having trouble getting a function object which is inside of poly~ to cooperate with the 'next' message. I'm sending messages from my "control" function object which include 'setdomain,' 'sustain,' 'dump,' and 'clear' messages with no problem. However, when I have sustain on, whatever I play sustains as expected, but when I send 'next,' old notes (which have already finished) are brought back and sustained. Is it possible to use the 'next' messages for individual voices within poly~? I can't quite figure out if this makes sense considering the way poly~ operates. Please help!

Thanks,
Jay

Adam Murray's icon

It sounds like you need to use poly~'s "midinote" message. This will ensure that note ons and note offs for a given MIDI pitch will go to the same poly~ target.

Don't send the "next" message to the poly~ from the outside. Instead you should be watching for note offs (velocity=0) inside the poly~ and send a "next" message to your function from inside when you see a note off.

Jay's icon

Thanks. I figured something out right after posting this, pretty similar to what you suggested. Set up two function objects, one for note on and the other for note off. This way the release is triggered by sel 0 inside of poly~, similar to how you suggest.

Jay's icon

After trying this out, I think your way is better for my patch. Thanks, Adam.