AVR test synth/MIDI beeper code, very minimal but works (if I remember correctly).
This was the first MIDI-cntrolled sound generator I did on a breadboard with an ATmega644 and a MCP4921 DAC (I think). It's very basic but should be able to play polyphonic beeps in response to MIDI commands.
(Code only, no schematics, sorry! If I remember correctly I copied the MIDI in and SPI DAC output circuits from the Shruthi-1 synth schematics. Google it! :) )