[sdiy] Voice assignment algorithms

cheater cheater cheater00 at gmail.com
Thu Mar 25 23:36:39 CET 2010


On Thu, Mar 25, 2010 at 22:26, Rainer Buchty <rainer at buchty.net> wrote:
> On Thu, 25 Mar 2010, cheater cheater wrote:
>

>
> First of all, it might be highly unwanted that retriggering a key indeed
> reuses that very voice. Bass sounds come to my mind, where you might want to
> have a "this note is played alternatingly on two strings"-like effects. You
> might want to feed back this very property from within the sound (e.g.
> possible with ESQ1/SQ80).

I think you can do that with the general argument I mentioned. It
doesn't have to reuse the same voice. You remove the note from the
circular stack in order to prevent data denormalization; it has
nothing to do with the voice logic. Upon removal of the note from the
circular stack the voice that is playing the note releases, but it
isn't necessary that the same voice is used for the new instance of
this note. You could also use a different voice. This is a pretty cool
trick you mention, btw.

> So "search this note in the occupancy list and retrigger it" might already
> be undesireable.

In which case you can skip this completely with a branch, right? Not
sure. Have you found it wouldn't work? The idea above is only on
paper.

> It was already discussed that "if there's no free voice, just grab the one
> the voice pointer points to" is possibly bad. So you want to have some LRU
> strategy here which grabs the voice which is the farthest in the release
> phase -- assuming that you know that there is something like a master
> envelope, which e.g. is almost non-existant on FM synths without knowing
> what the carriers are. So either you have even more feedback from the sound
> engine or you use a release counter, assuming that premature reassigment
> hits all sounds equally bad.

Yeah, good point, there are quite a few things you can do there. I
didn't think that far in order to just concentrate on the general
layout of the 'poly legato'/'poly note stealing memory'. One strategy
for what you mention is to sort voices by the stage they're in (first
steal notes in release, then in sustain, then in decay, then in
attack) and if two notes are in the same stage use a level meter at
the end of each voice to compare which is quieter - this works well if
you're doing everything digitally in one chip. An alternate option is:
first steal notes in the 1 { release and sustain } 2 { attack and
decay } phase. If two voices are in release or sustain (doesn't matter
which) then compare levels. Similarly attack and decay are also made
equivalent.

> That counter may want to be stretched (sostenuto) or sped up (staccato).
>
> And it needs a legato mode when used with monophonic sounds.

> Sure, you can get away with a most simple voice assigner; but I definitely
> see room for a more sophisticated one -- which then also shouldn't add too
> much delay.

Yeah, this agrees with Paul's point.

>> Voice assignment algorithms are so simple that there's reeeeally no reason
>> to optimize them
>
> They are?

Yeah. Even with the stuff above I would call the algorithms fairly
simple. We're not running a special case of the halting problem here,
after all, and I think anything we could come up with will be at the
slowest O(n). I really can't come up with anything slower that we
could be doing, but I would most welcome it if someone could surprise
me with some cool voice logic that requires big computational power.

Paul,
> I wouldn't expect that there
> are "papers" on the topic. But if you look at each synth design out
> there, each one of them probably has it's own unique story about how
> they did voice assignment.

At the immediate level I agree, I don't think Tom will be doing
something esoteric/cutting edge and just wants a good ol' voice
assignment algorithm. But on another level I don't agree. I think
there's research that can happen even in the simplest forms of
knowledge. Here are some ideas for research off the top of my head:

1. For example, there's the question of what's better: release the
note quickly and start the new note on time, or decay the note a bit
slower preventing a click but slightly messing up the timing - what
can be, statistically, perceived less, and what do psychoaccoustics
have to say about that?  What is the best windowing function to use
when you quickly need to release a voice?

2. With regards to note stealing, it becomes even more interesting
what you can do with arpeggiators. There you can look at a graph voice
re-assignment history, where the n voices are represented by n dots
vertically, and a new column happens on every arpeggiator clock. Then
at some point the cycle will be complete. You can analyze the topology
of this graph and relate it to other graphs created by other
combinations of chord, pattern, voice mode, for example by looking at
the cyclomatic complexity. You can try to relate the structure of the
graph with basic discrete algebra structures such as cyclic or
permutation groups and then compare this with existing research in
algebraic analysis of harmonic structure of musical compositions.
Abstract algebra + topology + music are for me very inspiring!

---

Scott, I'll politely ignore your question, since an answer to it has
nothing to do with any credibility for the statement you mention; lots
of credibility not being necessary in a fairly basic discussion like
this either way.

D.



More information about the Synth-diy mailing list