Something a little easier and perhaps a bit less hacky IMHO is the web audio MIDI standard.  You can make certain AVRs (the 32u4 in the Arduino Leonardo) look like USB devices, including a USB midi device.  Then just have a web page that uses the new web audio &amp; MIDI APIs to send data directly to the 32u4 as MIDI messages.  No need to convert to audio, etc.