LandSeaAir v2.0
Audio, Implementation, and Code
by Peter "pdx" Drescher
Twittering Machine
http://www.twittering.com
twittering@gmail.com
studio: 425.202.7721

This game is a demonstration of "the secret yanni technique, with key changes".

Usually, mobile game soundtracks consist of a background music loop, and a few sound effects. Sometimes, the music and the effects are produced by different content providers, and there is little, if any, coordination between them. If the sound effects are musical (such as a "ta-da" chord for bonus points), it is not uncommon for the music and the sounds to clash harmonically.

The "secret yanni technique" can be used to avoid this problem, by creating background music in a specific musical mode, then producing sound effects to fit that mode. A simple example would be to compose music in the key of C Major, and then create bonus sounds using notes from a C pentatonic scale (C, D, E, G, A). Because a bonus sound can be played at any time during gameplay, harmonic movement in the music (i.e. key changes) must be limited; otherwise, the bonus sounds will clash.

But what if the game's audio engine kept track of what key was playing, and generated bonus sounds to match? This can be accomplished with FMOD's interactive music system, by using callbacks to determine which music segments are playing, and triggering bonus sounds modified accordingly. The LandSeaAir game demonstrates this approach. 

AIR

This level plays background music in six different keys: C, E, and Ab, Major and minor. The screen displays a bird controlled by accelerometer, which chases bugs and butterflies. When the bird catches a bug, one of ten bonus melodies is played,  transposed to the key currently playing. When the bird catches a butterfly, an appropriately pitched bonus sound is played, and the key will be changed at the subsequent transition segment (blue butterfly = C, green = E, red = Ab). After catching six bugs, the background toggles between daytime (Major scales) and nighttime (minor scales).

LAND

The snake slithers through six terrains, each with its own music loop, which modulates down a whole step ||: Cmin => Bbmin => AbMaj => F#min => Emaqam => Dmin :|| with each transition. The music plays with the theme of "5, +5, 6, +5" (aka the James Bond chords) in six different styles. Rats make consonant interval oboe sounds in each key (except during the maqam, where they squeak only a single note). Frogs play a bassoon motif appropriate for each music loop.

SEA

The music modulates ||: Gmin => Bbmin => C#min => Emin :|| Plankton movement takes a "drunkard's walk" (brownian motion) path. Plankton notes are determined by fractal (pink noise) algorithm.

FMOD

The interactive music system controls key change transitions for all music loops. Music segment callbacks are used to keep track of what key is currently playing. Bonus sounds are generated using Simple events, triggered by gameplay variables, and transposed appropriately for the current key.


The app should run on any unlocked Android device running Gingerbread or higher. Comments, suggestions, and bug reports welcomed at twittering@gmail.com.
 
   - pdx