dry bones

Let’s make a bad instrument.  Let’s make a theremin that is harder to play.  And let’s do it with lousy synthesis that distorts all the time.

What you get out of the above goals is actually something sort of neat.  It’s called DRY BONES, and I made it at a Monthly Music Hackathon in July.  An amazingly lofi video follows:

First, what is going on here?  Well, a Leap Motion is doing its finger-tracking thing, which has improved by leaps and bounds since I first got mine in 2012.  That data is going to, of all things, a local webpage, where the Web Audio API is playing sine waves.

You get one sine wave per finger, and the leftmost finger is always mapped to the same pitch.  The distance between one’s thumb and pinkie finger is considered to be two octaves.  Any fingers that show up to the right of that finger are mapped to the appropriate pitch – lower fingers play louder.

So that’s simple enough – and you can play crazy little microtonal harmonies really easily, which was what I had in mind.  What I did not have in mind was the beating and the distortion.

It turns out that the Leap is now good enough track fingers close enough to get the sinewaves to beat against one another.  And, Web Audio distorts so easily that what you get is basically a drone / LFO machine.

The magic here is hard to see, but it comes from the fact that, when you get your fingers into one of these rad-sounding gestures, each motion changes the volume of the component sinewave, which changes the timbre of the distortion in odd but neat-sounding ways.

The magic, of course, is also that of building a thing that you thought would do X, only to find out that it also does Y, and maybe Y is better…but this is why we go to Hack Days.

The code, for what it is worth, is on GitHub.  You’ll need a Leap, as well, of course.