switch~ing voices [was: Re: [PD] nqpoly4 simple instructions?]

Frank Barknecht fbar at footils.org
Mon Dec 11 13:10:46 CET 2006


Hallo,
Frank Barknecht hat gesagt: // Frank Barknecht wrote:

> I don't think switching can be done in a generic way from the outside
> without knowing some details of the abstraction to switch on or off. 
> 
> Take for example midi voice allocation: Basically noteon and noteoff
> are kind of switch on and switch off messages already. However
> generally you have a release envelope fading out the sound over a
> certain time span after the noteoff message arrived. You cannot switch
> off dsp for a voice unless you know its release length, and this
> length might only be known inside the voice abstraction. 

However another thing to consider came to my mind. Switch~ing
abstractions or subpatches on and off has the nasty side effect of
being quantized to one block. Attached example illustrates the
nastiness of this. 

So for tight timing switching on has to be done at least one block *in
advance*. For this a [polywhatever] could be interesting that would
keep a pool of voices switched on all the time. 

Here's an idea for an algorithm to achieve this: [poly] does voice
allocation in a regular fashion using a modulo-counter: Assuming
voices are counted from 0, then first voice 0 is used, after that
voice 1 and so on until voice maxvoices-1, after that it starts at 0
again. Typical modulo. 

Now assuming all voices in [polywhatever] are connected to each other,
a voice that started to play could send along a message like "switch
(myself+1)%maxvoices 1" to switch on the next voice in the circle.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__




More information about the Pd-list mailing list