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:
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.tgz — the app, just download and double-click to uncompress.
- RoombaMidi2-source.tgz — full source code, includes the C roombalib API.
- RoombaMidi2-Help.html — help file, also available from within the app.
Roombas Go Caroling
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.43 comments