
122 Chapter 7 • Playing Sounds and Music
Creating a soundtrack for your robot is a typical example of where multi-
tasking proves to be really helpful.You will typically enclose your song in a sepa-
rate task, starting and stopping it from the main task, as required by the situation.
Converting MIDI files
By using constants, your program becomes more clear, but you don’t save any
time in coding your melody.You still have to write the notes one by one.The
good news is that some tools can do some or all the work for you.The Bricx
Command Center, for instance, lets you click notes on a virtual piano keyboard
on the PC screen, generating the corresponding ...