MidiComp is a program to manipulate SMF (Standard MIDI File) files and
will both read and write SMF files in 0 or format 1 and also read and
write it's own plain text format. This means a SMF file can be turned
into easily parseble text, edited with any text editor or filtered
through any script language, and "recompiled" back into a binary SMF
file. The package can be downloaded from...
http://alsa.opensrc.org/midicomp/
--markc