« about tonality | Main | Comments/Critiques/Rants about My String Quartet #5 »
July 02, 2009
Annotate music for your listeners using audio tag and JavaScript
I don't usually post here because I'm not a composer or a musician, just a (relatively uneducated) listener. However I'll beg your indulgence today, as I thought at least some of you may be interested in this topic and I do know something about it (I work for Mozilla).As you may know, many modern browsers, including the latest versions of Firefox (3.5) and Safari (3.1 and later), support new HTML5 <audio> and <video> tags that allow easy embedding of audio or video content in a web page without the need to use Flash or other plug-ins. What you may not know is that you can use JavaScript in combination with other web technologies (CSS, XML, etc.) to build additional functionality around the playing of audio or video content.
As part of a "Firefox 3.5 for web developers" series of blog posts we've just published a post on exploring music with the audio tag highlighting a demo produced by Samuel Goldszmidt of IRCAM that shows how you can add text descriptions for the benefit of someone listening to a piece of music (in this case an extract from Florence Baschet's StreicherKreis).
In the demo the JavaScript code is tracking the current time within the piece to show an indicator of which segment is being played; by mousing over the segment the listener can get a text description, and by clicking on the segment have the segment be replayed from the beginning. Not anything you couldn't also do in Flash, but the point is that you don't need Flash, just JavaScript.
In this case the music is in Ogg Vorbis format (not MP3) because that's what Firefox supports natively; we're trying to encourage adoption of open audio and video formats on the web. You can play the demo in Safari as well (I tried Safari 4.0 on OS X), if you install the XiphQT component allowing playing of Ogg Vorbis in QuickTime-based applications.
If you look at the actual source for the demo page you'll see that at the moment doing this sort of thing is not for the faint of heart, as it definitely requires some JavaScript knowledge. I hope that as more people make use of the and tags developers will create toolkits and JavaScript libraries that will make it much easier for relative web novices to post their own music with text annotations and additional material to supplement the listening experience.
Originally from Discussion Forum - NetNewMusic, ReBlogged by newmusicrebloggers on Jul 2, 2009 at 12:20 PM