Page 185 - Hacking Roomba
P. 185

166       Part II — Fun Things to Do





                               Listing 8-6 Continued

                                        i += 3;
                                     } else {
                                        i++; // otherwise skip over data we don’t care about
                                     }
                                   } while(true);
                                 }
                                 catch(Exception cae) {
                                   cae.printStackTrace();
                                 }
                               }
                               void doNote(int command, int channel, int notenum, int
                               velocity) {
                                 if( channel > tabbedPane.getTabCount() )
                                   return;
                                 RoombaCommPanel roombapanel =
                                              (RoombaCommPanel)
                               tabbedPane.getComponentAt(channel);
                                 roombapanel.playMidiNote(notenum, velocity);
                               }





                     Summary

                             So Roomba is not a high-quality professional polyphonic synthesizer. But it does make some
                             neat melodic and percussive noises. Having Roomba perform by itself is fun, but imagine get-
                             ting your friends together to form a Roomba quartet.
                             Reusing the large collection of RTTTL ringtones as musical source material or using MIDI
                             are just two methods of inputting musical information into Roomba. There are many others,
                             and you may have a favorite one you’d like to add. Programming your own songs or algorithmic
                             compositions for Roomba to play, whether long or short, can easily be accomplished.
                             Adding MIDI control to Roomba not only enables you to play the robot as a live instrument,
                             but also to move it around. Although it only spins under MIDI control right now, you can
                             make it perform any other movement triggered by MIDI, even complex actions. Using a simple
                             MIDI sequencer, you can create elaborate song and dance routines for one or even several
                             Roomba robotic cleaners.
   180   181   182   183   184   185   186   187   188   189   190