libtclsmf is a pure tcl library for writing and (in the near future) reading Standard MIDI
Files from within tcl scripts. only the writing part is coded right now (v0.1.x), but the
procedures for reading should be ready in a couple of months.
the library was written for the first stage of the project 'oveja electrica' (see
http://yaco.net/oe), an experimental music composition + artificial intelligence thing.
for installation see doc/INSTALL.
the API is quite thoroughly documented in the source code (libtclsmf/libtclsmf.tcl).
you'll probably need MMA's Standard MIDI File Format Specification. you can buy it at http://www.midi.org/ or search for 'standard midi file specs' in your favorite spiderbot. some examples can be found in doc/examples.