For a lark, I hacked together a quick web-based piano keyboard using the <Audio> tag. The Audio tag (along with the Video tag) is part of HTML version 5, and it’s pretty cool, since it makes the audio file just another part of the HTML page rather than something that is stuck in a plug-in ghetto. That means that javascript running in the page can interact with the audio file, which is what makes this piano possible to do without Flash.

The audio files are pure sine waves (e.g. the A above middle C is 440 Hz) generated by Audacity and saved in .ogg format (an open-source encoding).

Unfortunately it will only work in a browser that supports HTML 5 the Audio tag, which as of right now is pretty much only (shameless plug) Firefox 3.5.

August 28, 2009: EDITED TO ADD: The web-based piano has been moved to evilbrainjono.net/music, where I am working on integrating it into a full web-based music composition lab.