The counterpoint in the music generated by Upbeat Bird was the most difficult (and most fun) part of designing the game. Initially, I programmed the bass line and bird to be completely independent and randomized. The bass selected random notes from the 8 available (one complete octave of a major scale). The bird played a random note selected from a corresponding pentatonic scale. The result was acceptable, but I really wanted more out of the game. I also wanted the make sure that the music in the game was good. After all, it is a game designed to make the user better at music.
Getting Spontaneous Good Counterpoint
Getting a logical bass line was the easy part. I simply gave the program a few options to choose from depending on which note was being played. The result was good counterpoint in the single bass line. The hard part was getting the bird to choose a logical note based upon what the bass line was going to do. This required a bit of time travel. Good counterpoint requires knowing what the bass line has done and is going to do. Long story short, I had to completely reprogram when and how the bass line was generated.
The general rules are fairly simple (it was the details that got complicated). If the bass is about to go up, the bird will play a lower note. If the bass is about to go down, the bird will play a higher note. If the bird can’t go higher, it leaps down. If the bird can’t go lower, it will leap up. This follows the most general rules of good counterpoint. The bird also uses the three pentatonic scales that go along with the key being used. The scale being used changes depending on the bass. This further enhances the lines the bird makes.
Try Tapping Like a Madman!
If you’re ever bored with general game-play, try just tapping your iPhone like crazy! It sounds pretty sweet. Beautiful counterpoint. Something for this composer/amateur programmer to be proud of!