A common problem with music in games (and especially in smaller browser games) is that it tends to get repetitive very fast. You can’t afford to have staggering amounts of tracks and ambience because that would make the file size too large for fast streaming or download.
So what is there to do? One idea David Orr and I had was to write a system that could handle smaller bits of music. Rather than have one 2MB track, we could have 6-7 300kB tracks that the game could arrange into a song procedurally. This means we can have a much larger variety of music for the same size. So we started to casually work on that system a year ago. I named it “Canary” because I like to name things after animals. Here is the technical description of the system from David:
“Canary” is a system Krin and I developed where the music is randomized in multiple layers, allowing for seamless, dynamic music that is constantly developing as the player progresses through the game. The System intelligently selects from a huge selection of audio “chunks” using a complex music theory and analysis system we created. Some of the features include:
Modulation — The system can change key, adding depth and variety to the music.
Musical Structure — “Canary” is able to move elegantly from quiet, atmospheric music to epic, driving music.
Fades — The system can control dynmics of the music, and fade in and out naturally to follow the gameplay.
Ensemble Diversity — “Canary” is capable of recognizing the different sections of the musical ensemble, and decides when instruments will be playing based on the musical structure.
You can sample a bit of it here: Canary Music Demo
Current the system selects from a pool of 72 different tracks. Each track is categorised as either melody, harmony, bass or percussion – and it can combine and mix these 4 ‘layers.’ The result is that we are able to turn these limited tracks into hours of flowing, unique music. But we also learnt that too much music causes a lot of ‘musical fatigue’ to the player, so we’ve also put in ample amounts of ambience to pace the songs.
We’re going to be using this system to run all of the music and ambience in Sinjid – but will probably continue to develop it further. Include things like parallel tracks (like when you go underwater in Mario 3D Land) and entry / exit stingers so that we can end boss fights with a dramatic cadence. There is a lot more potential to be unlocked :)