Timely topic for me-- I teaching a class at DigiPen on exactly this topic! (the students' final lab project is a working MIDI synthesizer)
There's a very good online introduction to music synthesis and digital audio processing here
http://music.columbia.edu/cmc/musicandcomputers/
Brian Schmidt
Executive Director GameSoundCon
Brian Schmidt Studios