Bits to Beats: World Music Drum Machine

Programming Module

Write a program to create a drum machine with the versatility to compose rhythmic beats from difference cultures and musical traditions, given below. The types of beats are represented with letters. The letter X represents a base drum, the letter x represents a snare drum, r represents a musical rest where no instrument is played.

  1. NorteƱo/Polka (Found in Mexican music): XxXxXxXx
  2. Waltz (Also, found in Mexican music): XxxXxx
  3. Salsa (Beat is called Clave): XrrXrrXrrrXrXrrr
  4. Blues: XrXxrX
  5. Hip-hop: XrrXxrrrrXXrxrrr
  6. Gospel: XrxrXXxr
  7. For the last beat, find and add a popular rhythm to your drum machine, not already represented here.

The sound manager class has the following methods to help you with the assignment:

  • playBass() which plays a bass drum sound.
  • playSnare() which plays a snare drum sound.
  • waitQuarter() which adds a wait time of a quarter of a second between the beats.
  • waitHalf() which adds a wait time of half a second between the beats.
  • waitSecond() which adds a wait time of one second between the beats.
  • wait(int milliseconds) which adds a wait time of the specified milliseconds between the beats.