check out this website...
http://sourceforge.net
...and do a search for midi. one result is The MusicKit w/ this description...
The MusicKit & SndKit is an object-oriented software system for building music, sound, signal processing & MIDI applications. The distribution is a comprehensive package that includes on-line documentation, code examples, utilities, applications & scores
here's the link...
http://sourceforge.net/projects/musickit/
many more projects out there.
--cheers