theremin-playing robot

Posted: 2/16/2005 7:18:59 PM
ranjit

From: Brooklyn, NY

Joined: 2/16/2005

Hullo, I'm the creator of LEV, the theremin-playing robot that you can see there in the picture-of-the-month. If you wanna know more about the thing, how it works, or why on earth I made such a useless device, then post here!

There's a bit more information about Lev at http://www.moonmilk.com/labs/lev/
Posted: 2/16/2005 10:36:19 PM
ThereMan

From: chicago illinois

Joined: 2/15/2005

this thing looks so awesome...get some sound files of this guy playing...So do you control it with a remote or program its movements or waht?
Posted: 2/17/2005 11:03:12 AM
ranjit

From: Brooklyn, NY

Joined: 2/16/2005

Rasonable suspicion, Guest. The real reason there's no sound clips, though, is because I'm lazy. I'll see if I can get some clips and video up soon. I don't claim it plays the theremin WELL, but it's better than you'd think for such a sloppy piece of junk.

Thereman - it's MIDI controlled. Well, sort of MIDI, anyway.
Posted: 2/18/2005 10:02:19 AM
georut

Joined: 2/14/2005

I hate to be a nit-picker, but I will anyway. Lev seems to be playing a etherwave with no power supply plugged in.
Posted: 2/18/2005 10:16:32 AM
Jason

From: Hillsborough, NC (USA)

Joined: 2/13/2005

I'm sure that was a staged shot for the publicity photo... kinda like all those plasma TV ads that don't show the ugly power, video, and audio cords that would normally clutter up that nice clean wall :)
Posted: 2/20/2005 1:19:58 AM
ranjit

From: Brooklyn, NY

Joined: 2/16/2005

Also, that photo was taken before the robot actually worked. So a power cord would've been superfluous.

More about the innards of the thing: the two batons are moved by servomotors, the kind you find in radio controlled toy airplanes and cars. Both servos are run by a Basic Stamp microcontroller, or maybe a BasicX chip (it's been over a year) which sits in the right hand. (Yes, both hands are Altoids tins.)

The microcontroller, in turn, is receiving commands like move left baton to 77%, move right baton to 10%, via a serial connection. The commands come from a Macintosh running a fairly simple patch (program) written for Opcode's MAX software. The computer's receiving MIDI note-on and note-off commands to tell it what to play. Except it's not quite real MIDI, because...

The keyboard controller is an antique keyboard made to control carillon bells in a clock tower. I wired up another Basic Stamp inside the keyboard to scan the keys and send note-on and note-off commands, only I was too lazy to look up the real MIDI spec, so I made something up. Luckily it wasn't hard to get MAX to understand it, and if I needed to, it would be easy to get MIDI out of the keyboard.

Next time, how the software works.
Posted: 2/20/2005 1:25:00 AM
ranjit

From: Brooklyn, NY

Joined: 2/16/2005

There's a photo of Lev fully set up with the keyboard controller (yes, and all the power cords plugged in) here:

http://www.flickr.com/photos/ranjit/3930423/

This was at the Artbots festival in 2003:
http://artbots.org/2003/
Posted: 2/20/2005 2:35:23 AM
RS Theremin

From: 60 mi. N of San Diego CA

Joined: 2/15/2005

ranjit,

I enjoy your creativity. Lev is interesting and your photography with the slideshow is beautiful. You have wonderful talents as revealed on your very clean website.

Christopher
Posted: 2/20/2005 9:41:19 AM
Jason

From: Hillsborough, NC (USA)

Joined: 2/13/2005

Ranjit, that poster behind Lev is GREAT! Any more of those available?
Posted: 2/23/2005 2:15:31 PM
ranjit

From: Brooklyn, NY

Joined: 2/16/2005

I promised to say a bit more about how the theremin robot's software works.

It's built in Opcode's Max software running on a Mac. I found a freeware plugin for Max called fiddle, which does pitch tracking. I wired up the pitch monitor mod from the Etherwave manual, and sent the pitch monitor output into the Mac through a USB microphone. (The little white iBooks have no built-in microphone! I didn't know that when I bought one. Also, they can't run with the lid closed. Two reasons not to use an iBook for an audio robot's brain.)

So, through the pitch monitor and fiddle, the Max program always knows the theremin's output pitch, and the program controls the positions of the robot's arms, so you have everything you need for a closed feedback loop. Only, I didn't do it that way, because that would have taken more thought. I used an open loop system, where the robot goes through a calibration stage, and then plays freely without monitoring the accuracy of its output. During calibration, Lev moves its pitch arm slowly through its entire range, and memorizes the pitch it gets for each possible position of the arm. I found that the calibration was good for about an hour or until someone bumped into the theremin, which happened a lot with several thousand people trooping through the gallery. After an hour, changes in temperature and humidity were enough to throw the calibration off and I'd do it again.

Once the thing is calibrated, it's ready to take commands from the MIDI input. Each key on the keyboard is mapped to a pitch in the diatonic scale, and then the software hunts for the closest match in the calibration table. Because of the pitch arm's control limitations, the actual pitches played on the theremin were up to about 1% off from their correct values, even under ideal conditions. A semitone is about 6% (google says 1.05946309), so a 1% error was enough to make Lev sound quaint and sloppy, but not enough to sound totally wrong.

On top of the inherent pitch inaccuracies, the little pitch arm would vibrate as it snapped into place, and the entire assembly would gently rock back and forth because it wasn't completely solid. These gave Lev a nice sort of vibrato effect. On the whole, it sounded old-fashioned, like a soprano from the early 20th c. played on a worn out gramophone.


Jason, the poster is a hand-painted circus-style banner, 4 x 5 feet. I suppose it would be possible to make photographic copies...

You must be logged in to post a reply. Please log in or register for a new account.