1987 · Domark

The Living Daylights: music and sound

This minisite was contributed by unorig. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/the-living-daylights with me to Gold.

Five tunes and 17 sound effects by David Whittaker, played here by the game's own sound code.

01 · Music

Four tunes, and a fifth that never plays

The game plays music at four moments: over the title, at Q branch, when a level is won, and when Bond dies. While a level is being played, the sound chip carries only the effects until the level is won or Bond dies. A fifth tune sits in the table with the others, and nothing in the game starts it.

The player runs the game's own sound code on a copy of the C64's processor in the page, over the game's bytes from the Source tab: $A000 to start a tune, then $A13C once a frame, as the game's raster interrupt calls it.

TuneWhere it playsStarted fromLength

The tunes are a table at $A700, seven bytes each: a speed, then where each of the three voices' order lists begins. An order list names the patterns a voice plays, one after another, and a pattern is a run of bytes, each a note, a note length, an envelope, an arpeggio, or one of 23 commands ($A3C4, $A242). The commands give vibrato, slides up and down, drums made of noise, the four waveforms with ring modulation and sync, sweeps of the pulse width, and transposition. The driver reads new bytes every sixth frame, the tune's speed, and works out each voice's pitch every frame between ($A15B). An arpeggio adds a chord's notes to a voice one frame at a time; the table at $A6CF holds a minor and a major chord among them.

Zzap!64 gave the sound 49 per cent, calling the title music an "unremarkable ditty with no relation to the Bond theme".1

02 · Sound effects

Two voices borrowed from the music

A sound effect takes voices 1 and 3 from the music while it plays, and gives them back when it ends ($A961, $AB66). The helicopter's beat on The Mansion takes voice 2.

Each button runs the game's own $A961 with the effect's number, then $A13C once a frame until the effect has run out.

An effect is 20 bytes in the table at $AA12: how long it lasts, how often its two notes start again, a frequency, envelope, waveform, and pulse width for each of the two voices, how far each frequency sweeps up or down every frame, how many times it repeats, and a flag that adds a random amount to voice 1 at each repeat ($ABA7). The random number comes from a 32-bit shift register stepped every frame ($ACB2).

EffectWhen the game plays it

The helicopter is not an effect from the table. Its beat is a burst of noise at frequency $1200, restarted every sixth frame while it flies and every fourth once it has been shot and falls ($A91E, $A922, $AB7C).