Note: This demo is old and outdated. Today, you can use the Web Audio API to do all this.
By Steven Wittens. More info can be found on the blog entry.