Hacking Roomba

RoombaMidi2: A better OS X MIDI interface for Roombas

roombamidi2_icon.jpg

Make your Roomba a musical instrument!

RoombaMidi2 is a small Mac OS X program that makes your Roomba appear as a MIDI interface to MIDI sequencer programs like Ableton Live, Apple Logic, and so on. RoombaMidi2 is an update of the original Java-based RoombaMidi.

The CoreMIDI-to-Java APIs provided by Apple look to be getting deprecated (as are all Apple-specific Java APIs). To get around any problems, the updated RoombaMidi2 is written in Objective-C for the GUI and C for the “roombalib” Roomba control API.

The result is functionally identical to the original version and looks like:

RoombaMidi2

MIDI Implementation

You can have up to 16 different Roombas, one per MIDI channel. The virtual MIDI interface appears as “RoombaMidi2 In” on your sequencer program. Within a channel, different notes do different things:

  • note numbers 32-127 (G0 and up):
    • notenum is note, played thru beeper
    • velocity is duration in number of 1/32s of a second (e.g. 32==1second)
  • note number 24 (C0):
    • main vacuum, on = non-zero velocity, off = zero velocity (note off)
  • note number 25 (C#0):
    • blink LEDs, velocity is color of Power LED
  • note number 28 and 29 (E0 & F0):
    • spin left or right, velocity is speed of spin, note off is stop
  • note number 27 and 30 (Eb0 & F#0):
    • move forward or backward, velocity is speed, note off is stop

A typical use looks something like:


roombamidi2-inuse-500.jpg

Download RoombaMidi2

Example

Roombas Go Caroling

(revver link)


Caveats

The “tipsiness” evident in the Roombas’ performance above is caused by the fact that the Roomba protocol doesn’t really support real-time musical note playing. Normally you define little 16-note songs and play them back, so to play a single note you have to fake it by defining a one-note song and then playing it back. The other timing problem is Bluetooth serial doesn’t make any guarantees on delivery time so it varies by several milliseconds. To get tighter timing, use a serial tether, try making slower songs, or break up your songs into 16-note pieces and send the pieces instead.

2 Comments so far

  1. Ben April 2nd, 2009 12:14 pm

    Cool I’m the first! One question, how come you removed some of the features?

  2. Zack April 28th, 2009 7:44 am

    use a tol called mightymidi

Leave a reply