Just a little homage to the Theremin, the classic instrument invented by Léon Theremin back in 1920-ish.

It works by using the mouse as an 'X-Y controller', that is--volume is controlled by the vertical position of the mouse, and the pitch (i.e. the notes you hear) is controlled by the horizontal position of the mouse. These values are used for generating a simple sine wave, and all this is connected to your speakers via a JavaScriptAudioNode.

Flattr this

If your browser doesn't support the Web Audio API, here's a little video I captured of me clumsily attempting to play some classical music: