Back in January, I found some video kind of like this of the Silbot dancing a Tango and posted a blog about it (from which the video appears to have dropped off.) Ever since then I'd been on the lookout for egg-shaped bodies of a useable size. Easter provided a good cheap source of plastic housings for my own at the Big Lots, and while this isn't what I plan for the ultimate use of the Tribble base and egg body, it has enough of its own personality and programming that it really isn't Tribble anymore, but it isn't the ultimate form it will take yet-so I gave it a name:Mosha.
A cross between "Misha" (the ballet world nickname for Baryshnikov) and Mosher, which if you look at it is kind of the only kind of dancing you can qualify it as doing (i.e., it closes its eyes and reacts to the music regardless of what it bumps into-though somehow in the video it never collides with anything...)
The build is very straightforward and messy-nothing under the hood is even strapped down!
(Sorry for the Potato as they say-I just use the iPad and basement lights for these things.)
Anyway, as you can (maybe) see from the photo, it's an Arduino Uno for a brain on the Tribble Base (3 cr servos and omniwheels) and the only sensor is the Sparkfun Electret Mic Breakout.
The program surprised me-I would have thought I'd get more than unidirectional spin, but essentially that's what happened. I'll forgo posting the entire sketch (.zip attached,) but for learning purposes, here are the two interesting portions.
First, this is the form that the "dance" instructions took:
It's a 3-way switch at random that freezes one wheel and assigns the other two either full left or right spin. Theoretically, that should occasionally have resulted in more forward or occasional clockwise movement, but it didn't. Maybe I overlooked something here or my logic was bad. Whatever. This was an experiment-not a labor of love.
The second is the crudest beat detector you've ever seen:
I based this on the "LightStrip" project by Adam Grieg that Sparkfun lists on the mic board page. It was in straight c so it took just a little adjusting to aruduinish. It doesn't do the best job, but as you can see it will pick up a change in the volume and (within the 250ms delay) react to it. To make it more interesting I guess I could have had it stop if it detected a lull in the music instead of just pirouetting, What it's doing though is keeping a record of the last peak in the detected audio level and comparing it to an averaged level (background noise, non-beat events, etc) with a convergence value (I used 10 and a default peak of 1.3)
Now clearly, at some points it's just hearing noise maxed out (punk rock yo) and reacting at its max frequency, but at other points it does "dance" for me. I was happy enough with the results that I'm gutting it and moving on. Next up: RaspPi brains and a head that is significantly less creepy than the afformentioned Sil-bot.