[sdiy] Voice assignment algorithms

Tom Wiltshire tom at electricdruid.net
Thu Mar 25 20:52:06 CET 2010


On 25 Mar 2010, at 19:06, Neil Johnson wrote:

> Tom,
>
>> I've been thinking about voice assignment recently, and doing some  
>> experiments with software.
>
>
> Great write-up!
>
> Quick question: supposing your system supports 8 voices (8-note  
> polyphony), how would you handle the 9th NOTE ON?  And more  
> interestingly, the 9th NOTE OFF message?

Thanks.

It steals the oldest note. Once that decision is taken, dealing with  
the note off is easy.

The voices are put in the 'busy stack' in the order they're used, so  
the first one in is the oldest. I've got a pointer to the first voice  
in the list, so I can easily find it. Once we've stolen a voice, the  
new note/voice is put back on the busy list at the other end.

The selection of free voices works exactly the same way - it takes  
the first (oldest) voice in the list. This deals with the Note-off- 
but-release-still-going problem by giving the voices as long as  
possible before they are used again.

Regards,
Tom



More information about the Synth-diy mailing list