Web music API

Just some random ideas for now, but there’s interesting stuff happening now with Flash 10… it has a Sound API that basically allows you to make synthesisers and effects processors in Actionscript.

The project that seems to have the big jump on this is Hobnox AudioTool. Really impressive!

It’s kind of all-encompassing though. I’ve been thinking about something much simpler. For example, say you could play a MIDI file with Flash? (actually, you can…) but how about if you could play it using Flash Sound API ‘instruments’ rather than whatever sounds are in your soundcard?

In fact there are people already working on various Flash synthesisers (and probably sample-based instruments), but it’d be nice if it could all fit together in an open-standards kind of way. It’d be nice if you could have an invisible Flash ‘instrument’ on a web page and feed it ‘music’ to play. Via Javascript. Flash is all very well, and likely essential for doing the sound-playing stuff, but really we want to do this from simple web page scripts.

At the moment I’m not sure exactly what the requirements of an instrument would be. But it’d be something like: a .swf file in standardised form, that maybe contains a single object that implements an ‘Instrument’ actionscript interface. It’d have a method for accepting music data to play and some way of advertising which playback features it supported (eg polyphony, velocity, after-touch etc).

Ideally the same instrument could be incorporated into another swf app, or just placed into a webpage and controleld from Javascript. A swf app might be able to send individual note events to the instrument but I doubt that would work from Javascript, you’d need to be able to send it a whole sequence to play.

MIDI is an obvious standard to use, but the files are a binary format which isn’t much fun.

I’ve been thinking about maybe a JSON-style version of MIDI. Something more or less human-readable and fairly simple to begin.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s