I made a post on Reddit about my Melodique melodic phrase generation tool. Three people told me that they'd like for the tool to have the ability to export MIDI files, as this would allow loading the generated content into music editing software. It turns out there's a file writer W3C API in the works that would make implementing this fairly easy, but unfortunately, no browsers seem to support it at this time, not even dear Chrome.
Implementing basic support for exporting MIDI files took me about 4-5 hours in total. Fortunately, there's great resources out there documenting the format, which, although peculiar, isn't that hard to implement.
Or is it an art?
or spring form the heart?
Just some slick "pattern dude"?
I was interested in something like this because I own several MIDI controllers and thought it would be really fun to have an in-browser soft synth controlled by external MIDI devices.
I did just find this too, which might be helpful in your situation, I will need to do some reading up!