Skip to main content
Back
Cover image for the How Video Game Music Works: Loops, Layers and Adaptive Scores blog article

How Video Game Music Works: Loops, Layers and Adaptive Scores

A film composer usually gets a finished scene that runs, say, two minutes and ten seconds, and writes music to fit it. For the gameplay itself, a game composer rarely gets that number. One player crosses the first area in twenty seconds; another spends twenty minutes exploring every corner. The music has to keep going for both of them, and it has to change when the player does something the composer cannot predict. That single difference explains almost everything about how game music is built: it loops, it is made in layers, and the best scores adapt. This guide covers the history and the craft, then has you build a looping cue in three layers.

Why game music is not film music

Game composers solve two problems a film scorer rarely meets: an unknown length and a player in control. The usual answer to the first is the loop. Wikipedia's survey of the field calls looping "the most common form of game music," and lists pieces "designed to repeat indefinitely, rather than having an arranged ending or fading out" among the features of early game music.

The answer to the second problem is music that reacts. Adaptive music is music that changes in response to events in the game: its volume, arrangement or tempo can shift when the player enters a fight, finds a secret or runs out of time. You can hear the seed of the idea in Taito's Space Invaders (1978). As the Library of Congress notes, many game historians cite it as the first game with a continuous background soundtrack: four descending bass notes, repeating, getting faster as the aliens descend. Some argue those notes are really sound effects rather than music, but the effect on the player is the same: tension rises with the tempo.

Two lanes. Film: a scene bar of fixed length with a dark cue bar of the same length underneath, two coral hit markers and the note "ends with the scene." Game: a player bar labeled "explores for 20 seconds or 20 minutes," three dark blocks labeled loop, 8 bars, a faded partial block with a coral line labeled "enemy appears" near its end, and a coral block labeled "battle music" that starts at the next bar line

A film cue is written to a length the composer knows and lines up with "hits," moments in the picture the music must catch. A game cue repeats until the player does something, then changes at a musical boundary.

Namco's Rally-X (1980) is credited with the first continuous melodic background music, a tune that repeats throughout play, and Konami's Frogger (1981) switched between pieces in response to what the player did. Those are the two building blocks of everything below: a loop that can run forever, and a way to move between loops.

The chip era: five channels, one sound each

When the Famicom arrived in Japan in 1983 (released in the US as the Nintendo Entertainment System in 1985), its music came from a sound generator built into the console's processor chip. It had five channels: two pulse-wave channels, one triangle-wave channel, one noise channel and one channel that plays short recorded samples (DPCM). Each channel plays one sound at a time.

Five rows on light cards: Pulse 1 and Pulse 2 with square wave icons, labeled square-type wave with four width settings, usually the tune, and harmony, a second line or a fast arpeggio; Triangle with a stepped triangle icon, no volume control, usually the bass; Noise with a jagged icon, drums and sound effects; a dashed coral line, then DPCM on a cream card with a decaying wave icon, plays short recorded samples, drum hits or short sound clips, most games left it out

The NES sound budget. The pulse channels offer four pulse widths (12.5, 25, 50 and 75 percent); the triangle has no volume control of its own; the sample channel cost cartridge memory, so most games did without it.

Each channel had its own sound. NESdev's technical reference describes variable-width pulse waves, a stepped (quantized) triangle wave with no volume control, and a pseudo-random noise generator. According to Wikipedia's article on the console's Ricoh 2A03 chip, most of the NES library used only the other four channels, because samples took too much memory; later games such as Super Mario Bros. 3 used the sample channel for simple drum sounds. You can think of the four as a small rock band: triangle as bass, the two pulses as two guitars, noise as drums.

Two limits shaped the music. First, only three pitched notes could sound at once. Second, home consoles often shared their music channels with sound effects, so a laser blast or a jump could cut into the music on that channel.

A four-staff score in C major, two bars, chords C and Am. Pulse 1: a tune in eighths and quarters, C5 E5 G5 E5 D5 C5, then A4 C5 E5 C5 B4 A4. Pulse 2: sixteenth-note broken chords E G C G and E A C A. Triangle in bass clef: eighth notes bouncing C3 C4, then A2 A3. Noise on a one-line staff: eighth notes, x noteheads except round heads on beats 2 and 4

An original two-bar cue in the NES style, one staff per channel. The fifth channel, for samples, is left out, as it was in most NES music. Every staff is a single line of notes: the three-note harmony in Pulse 2 is played one note at a time.

The way around the three-note limit was the fast arpeggio. Chiptune writers break a chord into its notes and cycle through them quickly in one channel, so a single voice suggests the whole chord. Try it at a keyboard: hold C, E and G together, then play them one after another as fast, even sixteenths. The Arpeggiator Patterns handout shows the same idea as a modern synth feature. The pulse wave's buzzy color comes from its harmonics, and the width changes the recipe (75 percent is the 25 percent wave upside down, so those two sound the same). At the 50 percent width the pulse is a square wave: the Synth Waveforms and Their Harmonics sheet gives that recipe (odd harmonics only, each at 1/n strength). Synthesizer Basics explains oscillators and filters if you want to build these sounds yourself.

Two one-bar examples side by side. Left: a C major chord C4 E4 G4 as one whole note, labeled three channels at once. Right: sixteenth notes C4 E4 G4 E4 repeated four times, labeled one channel, broken up

The same C major chord, once as three notes that need three channels, once as a broken chord that one channel can play.

The budget grew quickly after the NES. The Sega Genesis had six FM-synthesis channels plus four simpler ones, and the Super Famicom (1990; the Super NES in the US a year later) played eight channels of recorded samples. CD-based games could then play finished recordings, which brought a new seam problem: when the laser reached the end of a looping track, it had to jump back to the start, leaving an audible gap. Developers moved toward streaming compressed audio instead. The hardware changed; the two jobs, looping and reacting, stayed the same.

Themes that survive a thousand repeats

If a loop is going to play for twenty minutes, its melody has to be worth hearing again and again. Koji Kondo, hired by Nintendo in 1984 as its first composer who specialized in music, wrote the score for Super Mario Bros. (1985). Its melodies were written so that short segments could repeat endlessly without boring the player. Writers on the score sum up his two aims as "to convey an unambiguous sonic image of the game world" and "to enhance the emotional and physical experience of the gamer." As development went on, he felt his music did not fit the pace of the game, so he raised the tempos.

In 2023 the overworld theme, officially the "Ground Theme," became the first video-game recording added to the Library of Congress's National Recording Registry. The Library's essay notes that Kondo worked with essentially four channels (two pulse, triangle and noise), passed the melody between the three pitched channels, and used the noise channel for driving rhythm. It also points out that the underground levels get their own darker, more sinister theme to match their look. Kondo has stressed giving each place a distinct musical character, so that players know almost immediately where they are.

You don't need a famous tune to learn the lesson. A melody that survives repetition is usually built from a short motif that returns in new places, so the ear recognizes something without hearing an exact copy every bar. The Motif and sequence handout shows the moves: repeat the motif, shift it higher or lower (a sequence), or disguise it. Here is the theme of the loop you will build later.

Two four-bar lines in A minor with chord symbols Am F C G and Am F Dm E. Italic labels above the bars: motif, a 3rd lower, answer; motif, a 3rd lower, a 4th higher, lead back

Bar 1 is the motif: two eighths, a quarter and a half note, rising A–B–C–E. Bar 2 keeps the rhythm and shape a 3rd lower, adjusted to the scale. Bar 7 is an exact copy of bar 1 a perfect 4th higher (D–E–F–A). Bars 5 and 6 repeat bars 1 and 2.

A loop also needs something steady underneath. A pattern that repeats while the music changes above it is an ostinato, and the Ostinato handout calls it "a stubborn little loop — one pattern, repeated under everything."

Writing a seamless loop

The last bar must connect to the first. A strong cadence can make a repeat feel like a restart; unresolved harmony can give it forward motion. Compare these two endings for our cue.

Two two-staff excerpts, melody above bass, each showing bar 7 (Dm), bar 8 and bar 1 again. Version 1, a closed phrase: in bar 8 the melody plays E5 and B4 over E2, then a half-note A4 over A2 under the symbol Am, and bar 1 starts on A minor again. Version 2, a lead-back: bar 8 stays on E major with the melody G sharp 5, E5, B4, G sharp 4, moving up to A4 at bar 1 while the bass steps from B2 to A2

Version 1 resolves to A minor inside bar 8, then repeats that harmony at bar 1. Version 2 keeps E major through bar 8: G♯ rises a half step to A while the bass steps down from B to A.

For this cue, try four ways to keep the repeat moving:

  • Try ending on V: E major in A minor, with G♯ as its leading tone. The Chords & Progressions in A Minor sheet explains this "raised note."
  • Let the last melody note step into the first one.
  • Keep the rhythm going through the join: a drum fill in bar 8 says "here we go again" rather than "the end."
  • Keep a steady tempo and avoid a fade; compare shorter and longer final notes.

Adaptive scores: three techniques

Many games do more than play one loop forever. Adaptive music systems change the score while it plays, and three techniques are the place to start.

Horizontal re-sequencing swaps one piece of music for another. The music is cut into segments, and the game moves between them as things happen: a crossfade, a switch when the current phrase ends, or a short bridge written to join the two pieces. Composer Winifred Phillips describes segments that carry markers at convenient points for a switch: on every beat, at the start of each bar, or at points the composer chooses. Audio middleware (the sound software that developers plug into a game engine) such as FMOD Studio builds this in: loop regions, transition markers that jump the playhead elsewhere, and quantization that holds a change until the next beat or bar.

Vertical layering keeps one piece running and changes what is audible. The composer writes several layers that play in perfect sync, and the game fades them in and out. Phillips stresses that this differs from mixing stems (grouped tracks of a finished mix, such as all the drums): the layers are composed to play in several combinations, not only all together. Horizontal changes suit big events such as a new area, a battle starting or a menu opening; vertical changes suit gradual ones, like danger rising during a fight.

Two panels. Horizontal: three dark Explore blocks, a narrow gray Bridge block and four coral Battle blocks, with a coral line labeled battle starts near the end of the third Explore block and the note the switch waits for the phrase to end. Vertical: three lanes on the same timeline: Layer 1 Theme plus Bass always on, Layer 2 Pulse fading in at enemy near, Layer 3 Drums fading in at fight and out after fight won; a coral star labeled stinger above the lanes

Horizontal re-sequencing changes which piece plays; vertical layering changes how much of one piece you hear. The star is a stinger, which can happen in either system.

Stingers are short phrases played over the music that is already running. Audiokinetic's tutorial for Wwise, another middleware program, describes them as "brief musical phrases that are superimposed and mixed over the currently playing music," triggered at key points in the action.

Two one-bar stingers in treble clef. Found it: sixteenth notes G4 C5 E5 G5 rising to a dotted-half C6. Danger: eighth notes E5, D sharp 5, D5, C sharp 5, then a half-note C5

Two original stingers. "Found it" climbs a C major arpeggio to a held high C; "Danger" slides down four half steps. Quantized to the next beat, either lands in time over the loop, but check the harmony too: the G natural of "Found it" clashes with the G♯ of bar 8.

LucasArts created and patented the iMUSE system in the early 1990s to keep music in step with game events; Monkey Island 2: LeChuck's Revenge (1991) was the first game to use it. Some games go further and generate music live: Spore used an embedded version of the Pure Data music software to respond to the game.

Three columns. Horizontal re-sequencing: use it for big changes such as a new area, a battle starting, a menu opening; how: crossfade, switch when a phrase ends, or play a short bridge. Vertical layering: use it for rising and falling intensity; how: fade layers of one piece in and out. Stinger: use it for one moment such as an item found, a secret, a warning; how: play a short cue over the music that is already running

Which tool for which moment. A single level can use all three.

Build one: an 8-bar loop in three layers

The loop is in A minor, 4/4, at 120 beats per minute, so its eight bars last 16 seconds. The chords are Am, F, C, G, Am, F, Dm, E: two bars of question, two of answer, a repeat, a climb in bar 7 and the lead-back in bar 8.

  • Layer 1, explore (always on): the theme above, plus a bass that plays each chord's root and 5th in half notes.
  • Layer 2, tension: a "Pulse" track of eighth-note broken chords, low–middle–high–middle, twice per bar. Over Am that is C4–E4–A4–E4.
  • Layer 3, combat: kick on beat 1, beat 3 and the "and" of 3; snare on 2 and 4; a snare fill on beats 3 and 4 of bar 8.
Five staves for bars 1 and 2, labeled Theme, Bass, Pulse, Kick and Snare, chords Am and F. Theme: A4 B4 eighths, C5 quarter, E5 half, then F4 G4 A4 C5 in the same rhythm. Bass: half notes A2 E3, F2 C3. Pulse: eighths C4 E4 A4 E4 twice, then C4 F4 A4 F4 twice. Kick: beat 1, then eighths on beat 3 and its and. Snare: beats 2 and 4

Bars 1–2 of all five tracks. The full eight-bar theme is in the theme figure under "Themes that survive a thousand repeats."

In bars 3–4 the theme plays its answer (see the theme figure), the bass plays C3–G3, then G2–D3, and the Pulse plays C4–E4–G4–E4 twice in bar 3 and B3–D4–G4–D4 twice in bar 4.

Five staves for bars 3 and 4, labeled Theme, Bass, Pulse, Kick and Snare, chords C and G. Theme: E5 quarter, C5 D5 eighths, E5 quarter, G4 quarter, then D5 quarter, B4 quarter, G4 half. Bass: half notes C3 G3, G2 D3. Pulse: eighths C4 E4 G4 E4 twice, then B3 D4 G4 D4 twice. Kick and Snare: the same groove as bars 1 and 2

Bars 3–4 of all five tracks: the answer over C and G.

The drums keep the same groove, and bars 5–6 repeat bars 1–2 exactly. Bars 7 and 8 are where the loop climbs and then turns back toward bar 1.

Five staves for bars 7 and 8, chords Dm and E. Theme: D5 E5 eighths, F5 quarter, A5 half, then quarters G sharp 5, E5, B4, G sharp 4. Bass: D3 A3, then E2 B2. Pulse: D4 F4 A4 F4 twice, then B3 E4 G sharp 4 E4 twice. Kick: the groove in bar 7, a single hit on beat 1 of bar 8. Snare: beats 2 and 4 in bar 7; in bar 8 beat 2, then eight sixteenths

Bars 7–8: the motif climbs a 4th, then every pitched track lands on E major for the seam, and the snare fill carries the drums back to bar 1.

To sketch it in a DAW (digital audio workstation, the recording program on your computer or tablet):

  1. Set the tempo to 120 BPM and a loop region of exactly bars 1–8.
  2. Make five MIDI tracks: Theme, Bass, Pulse, Kick and Snare. MIDI Explained covers how notes become numbers; the MIDI Notes, Octaves and Frequency handout uses middle C = C4 = MIDI 60, so A4 is 69.
  3. Enter the notes from the figures. On a General MIDI drum kit (channel 10), note 36 is a bass drum and 38 an acoustic snare. The Drum Patterns: Sixteen Steps, Four Beats handout teaches the 16-step grid you will be clicking into.
  4. Group the tracks into the three layers and test every combination the game might use: Layer 1 alone, 1 + 2, 1 + 3 and all three. Each combination must sound finished on its own.
  5. Let the loop run ten times and listen only to the join between bar 8 and bar 1.
  6. Bounce (export) each layer to its own audio file, exactly eight bars long, so a game engine can stack them in sync.
A DAW-style track view across bars 1 to 8 under a cyan bar reading loop on, bars 1 to 8, 16 seconds at 120 BPM. Five lanes of small note blocks drawn from the loop: Theme and Bass in Layer 1 (MIDI notes 65 to 81 and 40 to 57), Pulse in Layer 2 (59 to 69), Kick and Snare in Layer 3 (MIDI notes 36 and 38 on channel 10)

The whole loop as MIDI clips. Every clip is exactly eight bars, which is what lets the layers line up in any combination.

Then make it adapt. Write a "battle" version that keeps the chords but plays the bass in driving eighth notes instead of half notes, and a one-bar bridge between the two. Add a one-bar stinger in A minor, then play it over every bar of the loop and fix it, or hold it back, in the bars where it clashes. Music Theory for Producers shows how to grow basslines and arpeggios from one chord loop, and Electronic Dance Music Explained shows the same add-and-remove thinking in build-ups and drops. The Arrange a Dance Track in Eight-Bar Blocks exercise has you plan when layers enter, leave or change, and the Texture handout names what changes when they do. New to all of this? How to Start Producing Music at Home covers the gear and the first steps.

What to listen for

Listen with this article's questions in mind: where does the loop join, which layers come and go, and what happens when you stop moving?

  • Space Invaders (1978): four bass notes that speed up as the aliens descend.
  • Dig Dug (1982): the music stops when the player stops moving.
  • Super Mario Bros. (1985), music by Koji Kondo: the overworld and underground themes, and how each loop joins.
  • The Legend of Zelda (1986), music by Koji Kondo: the contrast between the overworld theme and the dungeon music.
  • Monkey Island 2: LeChuck's Revenge (1991): the first iMUSE game; listen for how the music changes as you enter and leave buildings.
  • Streets of Rage 2 (1992), music by Yuzo Koshiro (with three tracks by Motohiro Kawashima): dance-music styles played on the Sega Genesis's FM sound chip.
  • Dead Space 2: its background music appears to be built from four layers tied to levels of fear.
  • Winifred Phillips's music for Spyder and Sackboy: A Big Adventure: horizontal segments and vertical layers, which she explains in the two articles listed under Sources.

Free worksheets for this lesson

Your next step

Write the loop, then compare two endings: A minor in bar 8, then E major. Listen for which version carries you into bar 1. If you want feedback on your melodies, voicings or a first cue, a Tissimo teacher can work through your sketch in a live lesson; you can book a lesson when you are ready.

Sources

Read this article online: https://tissimo.co/articles/how-video-game-music-works-loops-layers-and-adaptive-scores

Was this useful?
Dislike buttonLike button
Thank you for your feedback imageThanks for your feedback

Comments