xoxosvst

dsp blog for xoxos.net

polyphony II

leave a comment »

whew! well, this is embarassing.

i haven’t been afforded much in the way of an environment conducive to concentration lately, having had a relatively hectic and physically demanding week. my polyphony code sat there day after day with me being unable or unwilling to address it.

 

i’ve finally hammered the thing out (i think) and it is really quite simple. only the most elementary sorting is required once one has a scheme to address it.

 

my scheme has some necessities others may not have – it’s a module for synthedit to be used for various applications. it needed to have two operational modes: a conventional “synth” polyphony mode, and a “physical” polyphony mode, where the same voice is used for recurring pitches (in synth polyphony, the same note/pitch can be present on all voices, eg. retriggering a tom with a long release.. you wouldn’t want this behaviour for eg. a piano..)

 

the other suggestion is to use an array for recording which voice was most recently released. if you retrigger one key polyphonically, you want it to “round robin” the voices so that the release is as long as possible. my application, being a component for a modular environment, is limited by only operating on gate on/off events.. it doesn’t receive information on the release stage.

 

so my ‘voice age’ algorithm works like this: ‘age’ is incremented so that the highest coefficient indicates the newest voice – when a noteoff occurs, the highest age value is discerned, this value is incremented by one and applied to the voice being released. because the variable is only used for sorting when a noteon event occurs, it is at this time that i sort the lowest age value and subtract it from all the ages to keep things from overflowing.

 

i had tried two kookier schemes precedent to this involving the position of each voice in the held notes stack. the final solution is a lot neater and the only one that satisfied my desire for orderliness as well as functionality. it is quite dizzying to consider how convoluted the solution was before determining this method! 🙂

Advertisements

Written by xoxosvst

October 9, 2011 at 2:47 am

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: