

Dynamically generating MIDI in JavaScript - sergimansilla
http://www.sergimansilla.com/blog/dinamically-generating-midi-in-javascript/

======
leviathant
Of course the HTML5 audio tag doesn't support MIDI. MIDI is (basically) a
command set for interacting with tone generators, and beyond that, has nothing
to do with making sound. Think of it more like an electronic equivalent to
sheet music.

Nonetheless, implementing MIDI through javascript would be kind of cool. I'm
about 90% done an HTML5 emulation of a Boss DR-110 (warts and all), and while
the timing of the audio playback ain't great, I'd be curious to see if better
results could be achieved by sending the sequencer data out as MIDI instead.

Considering how picky folks get about latency in audio software though,
generating MIDI with Javascript seems more useful as a learning tool than an
actual music production tool.

~~~
sergimansilla
I agree, latency is way too important in that scenario. I made that as an
experiment, I never thought of it as a professional tool.

I am curious about your Boss DR-110 emulation in HTML5, are you going to
publish it somewhere?

~~~
leviathant
I'll definitely be posting it freely online when I'm done. At this point I'm
pretty much down to the 'polish' stage. I'll probably post a link here, along
with some observations I made while creating this.

After I publish it, I'm going to work on better knobs (they're a little clunky
now) and the ability to store your patterns. As it stands now, if you leave
the page and come back, it's like you're running off a 9v with no batteries.
I'll either store the array in a cookie or make it something you can
download/upload.

------
mudx
An option for browsers that don't support Quicktime is a Java to Javascript
bridge that exposes portions of the MIDI framework (could be used as a
fallback): [http://mudcube7.blogspot.com/2010/08/dynamic-midi-
generation...](http://mudcube7.blogspot.com/2010/08/dynamic-midi-generation-
in-browser.html)

------
skybrian
I wrote something vaguely similar, but it relies on App Engine:

<http://midiserver.appspot.com/> <https://github.com/skybrian/Midi-Server>

Agreed that this stuff is way too nonportable.

------
athom
I've been wanting something to translate old Commodore 128 PLAY strings to
MIDI. This might just be the ticket. Thank you, Sergi! I'll try and let you
know how this works out!

~~~
sergimansilla
That sounds like fun, can't wait to hear about it! Keep an eye on updates to
the library, and if you run into bugs (you will) don't hesitate to nag me, or
even solve them :)

