Portsmf is "Port Standard MIDI File", a cross-platform, C++ library for reading and writing Standard MIDI Files.