poly~ stealing and clicks

Julien-Robert's icon

I need to steal voices of a poly~ object avoiding clicks when the steal occurs.
How is it possible?

Note that I'm limited to a maximum of voices (4) because of a third party visual software that needs the active voice numbers...

mvf's icon

Use poly~s "note" message together with "steal 1" and "voices 4". (I assume, that you already use it and that you set the voices' busy state with thispoly~: 0=voice free, 1=voice busy).
Everytime a message get's in your poly~ (through "in 1"), you check, if this voice is still busy. Therefore you use a "gate 2 1" after "in 1" - the first voice-message will go to its 1st outlet. Then you use "t l 2" and set the gate with this to "2".
If your voice has time to play up to its end, you set the gate back to 1 (and thispoly~ busy state to 0).
If the 1st voice is still playing, and a second voice message gets in, it will exit the gate over its 2nd outlet. In this case remember the message in a "zl reg" and fade out voice 1 (put a line~ controlling a *~ at the signal end of your voice and send e.g. 0. 10 - what means: fadeout the voice in 10 ms). Use line~'s end bang to bang "zl reg" to start the delayed voice message. There you have to reset the line~ with a "1.".
There is no way to avoid fadeing out the other voice before playing the new one. You can experiment with your fadeout time. 10ms should be quite ok, maybe 5-7 will work better. Timing is of course affected a little bit by this.
This should get you started. Have fun.

Julien-Robert's icon

Yeah thanks!

Roman Thilenius's icon

poly doesnt click, the signal itself is what clicks. if you dont know in advance when the voice stealing will occur, there is no chance getting rid of it. otherwise use envelopes or fades.