1989 · Domark

Licence To Kill: 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/licence-to-kill with me to Gold.

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

01 · Music

Five tunes, one never played

The game stores five tunes. One plays over the title, one opens three of the levels, one starts when Bond takes to the water-skis, and one plays when the game ends. The fifth is in the table with the others, and nothing in the game ever starts it.

The player runs the game's own music code on a copy of the C64's processor in the page, over the game's bytes from the Source tab: play_tune to start a tune, then sound_frame once a frame, as the game's interrupt calls it. The volume is set to 15 first, as the game does before every tune.

TuneWhere it playsStarted fromLength

The tunes are kept as a table at tunes, seven bytes each: a tempo, then where each of the three voices' tracks begins. A track is a list of patterns, and a pattern is a run of notes and commands, a byte each. A byte from $81 upwards is a command, looked up in the table at pattern_commands: vibrato, a slide, drums, a change of waveform, a sweep of the pulse width, a rest, a transposition, or a jump to another place in the track. Each frame the tempo is added to a counter, and the voices move on to their next step each time the counter overflows, so a tempo of $37 steps a little more than once in five frames.

Only two of the tunes play during a level. Tune 3 plays while levels 1, 4, and 5 open, and it lasts 3.4 seconds, so it has ended by the time the scenery starts to move. Tune 1 is the exception: harpoon_seaplane starts it when the diver's harpoon catches the seaplane's pontoon, and it plays on through the water-ski chase that follows. Zzap!64's ratings for the C64 game called it a "nice intro tune and good spot effects".1

02 · Sound effects

Sound effects: two voices borrowed from the music

A sound effect takes voices 1 and 3 away from the music while it plays, and gives them back when it ends. Voice 2 carries the engine noise of the helicopter, the plane and the truck.

Each button runs the game's own start_effect with the effect's number, then sound_frame once a frame until effect_done hands the voices back.

An effect is 20 bytes in the table at effects: 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's pitch at each repeat. Every sound in the game goes through one routine, $2DE9, which the game calls from 21 places, each naming its effect as a number.

EffectWhen the game plays it