I’ve spent the last few days thinking about theremins, the musical instrument that you play without touching. When I went to see a band called Spaceships Are Cool the other day it triggered my mind. One night I suddenly decided it would be possible to make a theremin that worked using only one hand using a different design.
I plan to make one at some point in the future, when I get the parts in one place… For now I decided that I would build my concept in the browser. I started out making it with a bunch of div tags, which was frustrating, and then I realised that I could use the <canvas> tag from HTML5 to do it.
What I ended up with was a very plain page that generates sound (in Firefox 4) with the pitch determined by the cursor position on the X axis, and the volume on the Y axis. The sample time is 50ms, and at the moment there’s a bit of an annoying click. I think I might be able to get rid of that by keeping the audio element playing at 0 volume or something like that, but that’s debugging for another day.
Anyway, if you’re viewing this on my page in Firefox 4 then you should see the finished product underneath. If you’re viewing this in a feed or on Facebook then you’ll want to go here. If you’re not using Firefox 4, or you’re not sure what browser you’re using then this probably won’t work for you and you’re probably very bored of reading this by now.