Essentially, I'm trying to create MIDI from scratch and post them on the Internet. I am open to different languages, but prefer to use Python (one of 2, if that matters) and wondered which library I should use. Thanks in advance!
Looks like this is what you are looking for:
Simple, cross-platform MIDI library for Python
MidiUtil can create MIDI files in python.
Perl has a MIDI :: Simple module. I remember an article about this in the now extinct Perl magazine:
http://www.foo.be/docs/tpj/issues/vol4_1/tpj0401-0018.html