next up previous contents index
Next: Voice tags Up: Automation and voice management Previous: Polyphony   Contents   Index


Voice allocation

It is frequently desirable to automate the selection of voices to associate with individual tasks (such as notes to play). For example, a musician playing at a keyboard can't practically choose which voice should go with each note played. To automate voice selection we need a voice allocation algorithm, to be used as shown in Figure 4.9.

Armed with a suitable voice allocation algorithm, the control source need not concern itself with the detail of which voice is taking care of which task; algorithmic note generators and sequencers frequently rely on this. On the other hand, musical writing for ensembles frequently specifies explicitly which instrument plays which note, so that the notes will connect to each other end-to-end in a desirable way.

Figure 4.9: Polyphonic voice allocation.
\begin{figure}\psfig{file=figs/fig04.09.ps}\end{figure}

One simple voice allocation algorithm works as shown in Figure 4.10. Here we suppose that the voice bank has only two voices, and we try to allocate voices for the tasks $a$, $b$, $c$, and $d$. Things go smoothly until task $d$ comes along, but then we see no free voices (they are taken up by $b$ and $c$). We could now elect either to drop task $d$, or else to steal the voice of either task $b$ or $c$. In practice the best choice is usually to steal one. In this particular example, we chose to steal the voice of the oldest task, $b$.

Figure 4.10: A polyphonic voice allocation algorithm, showing voice stealing.
\begin{figure}\psfig{file=figs/fig04.10.ps}\end{figure}

If we happen to know the length of the tasks $b$ and $c$ at the outset of task $d$, we may be able to make a better choice of which voice to steal. In this example it might have been better to steal from $c$, so that $d$ and $b$ would be playing together at the end and not $d$ alone. In some situations this information will be available when the choice must be made, and in some (live keyboard input, for example) it will not.


next up previous contents index
Next: Voice tags Up: Automation and voice management Previous: Polyphony   Contents   Index
Miller Puckette 2006-09-24