How to synthesize a chord or multiple notes at the same time.

Status
Not open for further replies.

alialiali

Well-known member
Hi everyone,

I've started to make sound (!), but I am not sure how to make multiple notes at the same time. I see from the examples that they use multiple waveform sources, but I am not sure in advance how many notes will be played. Should I pick an arbitrary number, say 16, and use them as a queue for incoming notes? If so, just give up if a 17th (simultaneous) note appears?

Say if someone plays A2B2C2 on, A3 on, A3 off, B3 on, B3 off, A2B2C2 off, my first 3 in the queue will play the chord, then 4 will play A3, then B3. Does this sound sensible or is there a better way of achieving it?

Thanks very much for any help.
 
There are a couple of approaches.

You're describing a form of polyphonic voice allocation. It's how analog polysynths like Prophets or Junos do it - they only have so many voice circuits, so they figured out how to share them.

If you have DSP resources for n voices, you assign those voices to the notes as they come in. When you've got more notes than available voices, you can chose how to handle the situation. You could ignore them, or steal notes...and depending on how you decide which to steal, it might change the overall effect. You could simply reclaim the oldest, or the lowest or highest. If you can keep track of how loud they are (using more processing resources), you could steal the quietest.

The other option is known as "full polyphony." Each possible note would have it's own waveform source, and you'd simply allow their output to play when a note was turned on. This is more equivalent to an electronic organ, like a Hammond or Farfisa.
 
Thanks very much, that's great. I think the "full polyphony" approach seems much less complex at the cost of resources, so I will try that first and see where I get to. The only edge case is "what happens if a note is already playing" and I think I can ignore that case because it maybe won't matter. Thanks again for your help.
 
Thanks very much, that's great. I think the "full polyphony" approach seems much less complex at the cost of resources, so I will try that first and see where I get to. The only edge case is "what happens if a note is already playing" and I think I can ignore that case because it maybe won't matter. Thanks again for your help.

For anyone reading this, "1 wave per note" + additional mixers, etc. seems just too much memory for a Teensy 3.6, I can get AudioMemory to about 110 before other stuff stops working, and that only covers about the first 100 notes. So I am now implementing the more efficient suggestion above. I'm also waiting for a print of the audio memory board, which I think could solve it too.
 
Just to carry on talking to myself :) ...

This works amazingly well! I have 4 16-voice wave synths with some effects on a Teensy 3.6. Thanks very much!
 
Thanks. Don't worry, having been married for many years, I am entirely comfortable with talking to myself :D
 
Status
Not open for further replies.
Back
Top