The Music of Defendy Rocket

When making music for an arcade-style game where you expect the average game length to be quite short, a concern is that it will quickly become grating to the player. Defendy Rocket was always intended to be this way, so we looked at how Super Hexagon deals with this issue. Broadly, it advances the music periodically, so that every few games you get moved onto the next section. There seem to be several entry points for each piece of music, and the music loops back around to the start once you hit the end.

What I wanted to do was build a system where the music was assembled from a number of short sections, all of which were interchangeable, so that I could periodically change the starting point, but also put the rest of the music together in a different order every time you played. This was pretty straightforward, so obviously I had to make things more difficult for myself.

The UE4 Blueprint which controls how the music is assembled.

Complexity

I gave half of the sections uptempo drums, at 125bpm, and the other half slower drums, at ostensibly half that tempo. I then decided that if we were moving from a ‘fast’ section to a ‘slow’ section, we should play a bridging section, which is slightly stripped down, before bringing all of the melodic elements back in. Each section has one of these ‘intros’, along with a ‘main’ section. Currently there are 4 fast sections and 5 slow sections, making 18 pieces of music in total, each 15 seconds long.

The game always starts with an intro piece playing; if you die within the first 20 seconds, the same piece will play again, otherwise another intro section is chosen at random. The music player then moves onto the relevant main piece for that intro, after which it will chose another main piece of the same tempo. At this point, it can finally choose to switch tempos; as it is selecting randomly from a pool which includes main sections, however, this isn’t a given. If it does choose a piece of a different tempo, it will play the intro for that piece, move onto the main section, and continue the cycle.

Intensity

At some point it was decided that the waves of rockets that the game throws at you needed to increase in intensity. It made sense to tie this system into the music; as the player progressed further into the game and was presented with more difficulty patterns and rockets, we could stop certain sections from playing and introduce other, more intense-sounding sections, to reward them for surviving for longer. Each section simply has a minimum intensity and a maximum intensity, and these are taken into account when picking the next section at random.

This was initially a problem, as I’d only made 3 fast and 3 slow sections, and locking them out in this way was severely limiting the variety of the music. So, I made another section of each tempo (The fifth slow section was added more recently, after I made the title screen music), and this seemed to solve the issue. The music system now had 4 sections to choose from at the start of the game, and four that were always available at the highest intensities.

Those are the basics of how the system works. I had to do some particularly fiddly things in order to get Unreal to transition from one piece of music to the next without an audible gap, but it’s pretty much working perfectly now.

Making the Music

Considering Defendy Rocket is something of an arcade throwback, and I’d just recently bought Plogue’s Chipsounds, the music was always going to be heavily chiptune-influenced. I decided to use Chipsounds for almost everything (The drums are a collection of C64 drum samples I had lying around). I ended up mixing and matching various sound chips; Chipsounds emulates a number of old computer sound chips, and while it’s possible to make music that strictly conforms to the original chips, I chose not to limit myself in that way. I also stuck effects on basically everything, which is kind of cheating too.

My Ableton Live project. Should have gone with a more pleasing colour scheme.

Daddy or Chips

The main lead synth is the Atari 2600’s TIA chip. This chip produces a number of distinct, and odd sounds, but is limited in the number of distinct pitches it can produce, so I had to use Chipsounds’ Unlimited mode. This sound in particular is an almost-square wave with a slight distortion that gives it a bit of character. I’ve added a bit of pitch wobble and vibrato, and a delay.

The bass synth is the Atari 800’s POKEY, a chip that’s close to my heart, as I used to program sounds in Atari BASIC as a kid. This particular setting has an odd tonal range, so I had to transpose everything down, and a lot of notes don’t actually produce any sound. Thankfully, due to the odd key I wrote the music in, all of the notes I need work. I like the grunginess of this sound, and the random, unpredictable nature of the POKEY. The only processing is an EQ, to make it more bassy.

The arpeggiated pad sound is the Commodore 64’s SID chip. I couldn’t really go without including this somewhere! This sound is just a square wave with an LFO on the pulsewidth, but the arpeggiation, which was a common trick on old sound chips to make a single voice sound like it was playing a chord, was done with a wavetable (a series of commands that changed the sound that the SID was playing while it was playing it). This allowed me to reproduce the chords I wanted, but it also meant that I had to use a different wavetable for each chord. I ended up using 24 different wavetables, which was time-consuming.

The remaining sounds are a slow pad in the right channel that was made with the Commodore VIC-20’s chip with a delay on it, and two bleepy delayed sounds, one made with POKEY and the other with SID. And that’s basically it! Everything else is compression, equalisation and limiters to get the desired sound.

Posted on July 10, 2015 .