6-channel ATMega328 MIDI Synthesizer

A few days ago I held an audio workshop for our FabLab with Arnulf and Stephan. During the preparation I learned about numerically controlled oscillators and implemented a simple one as a demonstration of producing clean sines (after some filtering) with an 8-bit processor. I couldn’t stop myself from expanding it a bit after the workshop. Now it has 6 channels, some basic volume control (and transitions), and supports reading MIDI commands - but for now only TONE ON and TONE OFF. :)

Processing power is sparse, but with the help of some inline assembly for the main interrupt routine the synth usually has some 5-10% of it left for MIDI parsing after it’s finished the interrupt, usually tending towards the higher end of that range.

Code is as always on GitHub. To hear the sound, connect one resistor to each PWM channel and connect the other ends of the resistors to something that lets you play that sound (preferrably with a lowpass filter set to 5-10kHz or so), and send some MIDI commands to the ยตC’s UART.

Here’s a recording of the synth playing Riders On The Storm: