[sdiy] Voice assignment algorithms

Tom Wiltshire tom at electricdruid.net
Thu Mar 25 20:43:14 CET 2010


On 25 Mar 2010, at 19:12, ASSI wrote:

> Hi Tom,
>
> On Thursday 25 March 2010, Tom Wiltshire wrote:
>> The system I've got currently stores two stacks of voices; the free
>> stack and the busy stack.
> [...]
>
> I wouldn't call this a stack, but rather a FIFO or a linked list,
> depending on implementation.

Yes, that's probably a much more accurate name for it. It is a linked  
list.

>   Unless I misunderstood, there will be a
> good deal of pointer chasing to implement a least recently used voice
> allocation strategy.

The list also stores pointers to the first and last voices in the  
list, so finding
the least recently used (oldest) voice is just a question of looking  
at the right pointer.

> This linked list stuff is very flexible in that
> regard, but uses memory and cycles and god help you if you make an
> implementation error on some fringe case...

You're not wrong there! That's why I'm playing with the algorithm on  
my laptop now
  before I go anywhere near a processor.

> Something that is to the best of my
> knowledge sadly neglected in software voice assigners are duophonic
> voice modes, for instance.

And I'm afraid I'm probably going to join the list. If I do  
duophonic, it'll just be the
  two-voice case of the general polyphonic scheme, without any of the  
other
options you could do if you only considered two voices.

I think I agree with both you and Scott that best way is just to  
separate monophonic
and polyphonic assignment algorithms. There's too many differences to  
do them justice
with one piece of code.

Thanks for your thoughts,
Tom




More information about the Synth-diy mailing list