Melody Scripter is a Python application/library which parses tunes written in an easy-to-write textual format, and which can be used to generate Midi files.
The following MP3 is a rendition of the Midi file generated from yankee_doodle.song.
(The audio was rendered using fluidsynth.)
*song: tempo_bpm=200, time_signature=4/4, ticks_per_beat=4 *track.melody: instrument=73, volume=120, octave=5 *track.chord: instrument=40, volume= 50, octave=3 *track.bass: instrument=19, volume=100, octave=2 [C] c c d e | [C] c e [G7] d g, | [C] c c d e | [C] c2 [G7] b | [C] c c d e | [F] f e d c | [G7] b g a b | [C] c2 c1 [] r1 | [F] a. bh a1 g | [F] a b c2 | [C] g. ah g1 f | [C] e2 g2 | [F] a. bh a1 g | [F] a b c a | [G7] g c b d | [C] c2 c1 r1