A 48K Spectrum has one bit of sound hardware, bit 4 of port $FE, and Cyberun makes every sound by setting and clearing it with the processor counting in between, OUT ($FE) with $10 and then 0 so that the border stays black. Interrupts are off throughout the game, so nothing plays a sound over time: each effect plays in full, at once, inside the pass that asks for it, and that pass is longer by the sound's length. Two building blocks make every effect: a pulse with separate on and off lengths (beep_pulse) and a square-wave cycle (beep_cycle), driven by a rising sweep (rising_sweep), a falling zap (zap_sweep), a two-note warble (warble) and a scrambled crackle (crackle). The tunes are a byte a note, played by play_note from the semitones of note_table.

Every recording here is the game's own code running in SkoolKit's simulator, each change of the speaker bit logged to the T-state and rendered at 44100 Hz; nothing is synthesised. Each effect was recorded by calling its routine on a machine of its own -- the snapshot run through its start-up to the menu, then the registers and bytes the routine reads set -- and checked wave by wave against what its code makes: the half-wave counts it works out from its inputs, turned into T-states by the instruction timings of its loops. An effect played once a pass is called once for each of the inputs a run of passes gives it, the calls 205,844 T-states (59 ms) apart: the median length of a pass with no sound, measured with the ship still in the sky.

The simulator has no memory contention. The effects' code ($71D3-$731E) lies below $8000, in the RAM the ULA holds up while it draws the screen, so on a real 48K the effects run somewhat slower, and lower, than they are heard here; the tune player and its table lie above $8000 and are not slowed.

Effects

SoundRoutinePlayed by, and whenRecordedLengthPitchListen
Rising whinesound_rising_whinefly_in_step jumps to it as the fly-in of a new life ends and play begins. Heard in the runs below: a game begins; flying with every add-on; a tour near the top of the map; a tour of the caverns (2 calls); out of fuel; the rocket launched (2 calls).called once; 32 waves, every one of them the length sound_rising_whine's code gives it, on half-waves and off31 ms912–1145 Hz
Pick-up chirpsound_pick_upcollect_pickup, when the ship takes an add-on or a rocket part. Not heard in any of the runs below.called once; 16 waves, every one of them the length sound_pick_up's code gives it, on half-waves and off9 ms1610–1934 Hz
Unused cracklesound_unusedNothing: no CALL or JP in the game reaches it. Not heard in any of the runs below.called once; 23 waves, every one of them the length sound_unused's code gives it, on half-waves and off7 msclicks at 518 Hz–23.5 kHz
Debrissound_debrisupdate_debris, for each piece of debris each pass while death_count is below 10: the piece's path step (+$15) halved picks the note. Heard in the runs below: a game begins (21 calls); flying with every add-on (42 calls); the shield running out (28 calls); a tour of the caverns (42 calls), from update_debris by the stack.called sixteen times, a pass apart, with the path step giving notes 0 to 15 in turn (7 and 8 are silent); 56 waves, every one of them the length sound_debris's code gives it, on half-waves and off (2 of the calls silent, as the code has them)885 ms1038–1778 Hz
Special beam fluttersound_flutterupdate_special_beam, each pass while the special beam is out (its record's +$0E not 0). Heard in the runs below: flying with every add-on (66 calls), from update_special_beam by the stack.called eight times, a pass apart, with the pass counter's low bits 0 to 7; 144 waves, every one of them the length sound_flutter's code gives it, on half-waves and off421 ms1761 Hz–21.0 kHz
Falling zapsound_zapThe commonest: contact_damage (damage, and a shielded ship ramming), ship_contact (the shield starting), contact_drain_fuel (the fuel thief), contact_extra_life (an extra life), test_player_shots (a shot hits), update_tough_attacker (the tough attacker destroyed), draw_rocket (the ship docks with the rocket), and planet_secured for each 5000 of the planet bonus. Heard in the runs below: a game begins (5 calls); the shield running out (2 calls); a tour of the caverns (4 calls); out of fuel (3 calls); the last life lost (3 calls); the rocket launched (11 calls), from planet_secured, contact_damage, draw_rocket by the stack.called once; 16 waves, every one of them the length sound_zap's code gives it, on half-waves and off12 ms1093–2003 Hz
Ship coloursound_ship_colourcolour_ship, when the ship's colour changes: white, yellow with the ore tank full, cyan with the shield on. Heard in the runs below: the shield running out (8 calls), from colour_ship by the stack.called once; 10 waves, every one of them the length sound_ship_colour's code gives it, on half-waves and off10 ms951–1007 Hz
Buzzsound_buzzhit_block when the ship hits a wall, and ship_on_slope_response on its first pass on a slope. Heard in the runs below: a tour near the top of the map (8 calls), from ship_on_slope_response by the stack.called once; 15 waves, every one of them the length sound_buzz's code gives it, on half-waves and off16 ms517–3692 Hz
Tough attacker's humsound_humupdate_tough_attacker, the update routine of the tough attacker (type $19), every pass. Heard in the runs below: a tour of the caverns (13 calls), from update_tough_attacker by the stack.called eight times, a pass apart, with the pass counter's low bits 0 to 7 and the record's +$16 bit 6 clear: the even passes are silent; 16 waves, every one of them the length sound_hum's code gives it, on half-waves and off (4 of the calls silent, as the code has them); called eight more times with +$16 bit 6 set, it was silent on every pass: that branch is reached only on odd passes, and then waits for a pass whose low two bits are 0, which an odd pass never is, so it can never sound412 ms5952–6530 Hz
Cracklesound_cracklehit_block, when the ship bumps a floor or a ceiling. Heard in the runs below: a game begins (9 calls); the shield running out (5 calls); a tour near the top of the map; out of fuel (5 calls); the last life lost (5 calls), from hit_block by the stack.called once; 28 waves, every one of them the length sound_crackle's code gives it, on half-waves and off14 msclicks at 749–3568 Hz
Ticksound_tickmove_or_explode when an object blows up on the landscape, and probe_shot when a laser shot meets it. Heard in the runs below: the shield running out; a tour near the top of the map (19 calls); a tour of the caverns (7 calls); out of fuel; the last life lost (11 calls), from move_or_explode, probe_shot by the stack.called once; 8 waves, every one of them the length sound_tick's code gives it, on half-waves and off3 msclicks at 518 Hz–23.5 kHz
Deathsound_deathupdate_objects each pass while death_count runs from 10 to $2C: the 35 passes after the ship breaks up. Heard in the runs below: a tour of the caverns (26 calls); out of fuel (26 calls); the last life lost (26 calls), from update_objects by the stack.called 35 times, a pass apart, with death_count from 10 to $2C as the passes of a death give it; 271 waves, every one of them the length sound_death's code gives it, on half-waves and off (9 of the calls silent, as the code has them)2.00 s1038–1778 Hz; clicks at 518 Hz–23.5 kHz
Beamssound_beamsThe end of draw_beams, on a pass when it has drawn a beam: the beam's record (+0, +1, +2) sets the sound. Heard in the runs below: the rocket launched (21 calls), from draw_beams by the stack.called 8 times, a pass apart, with IX at a record whose (+0 XOR +1) AND 15 and +2 AND $1F are those of the first beams heard in the runs below (0 and 13, 0 and 12, 0 and 11, 0 and 10, 0 and 9, 0 and 8, 0 and 7, 0 and 6); 64 waves, every one of them the length sound_beams's code gives it, on half-waves and off414 msclicks at 926–8772 Hz
Shotsound_crackle_bfire when it fires: a laser shot, or with bit 7 of the record's +$16 set (a homing missile) a longer one. Heard in the runs below: a game begins (17 calls); flying with every add-on (8 calls); a tour near the top of the map (23 calls); a tour of the caverns (29 calls), from fire by the stack.called twice, a pass apart: the laser shot (+$16 bit 7 clear), then the missile's (set); 38 waves, every one of them the length sound_crackle_b's code gives it, on half-waves and off69 msclicks at 749–6195 Hz
Launchsound_launchdraw_rocket each pass while the rocket rises, with the pass counter's low two bits in A. Heard in the runs below: the rocket launched (389 calls), from draw_rocket by the stack.called eight times, a pass apart, with A from 0 to 3 twice over; 112 waves, every one of them the length sound_launch's code gives it, on half-waves and off419 msclicks at 518 Hz–23.5 kHz
Firesound_firefire_from, when a ground object or an attacker fires a bullet or throws a pick-up. Heard in the runs below: a tour near the top of the map (2 calls), from fire_from by the stack.called once; 10 waves, every one of them the length sound_fire's code gives it, on half-waves and off4 msclicks at 822–3568 Hz
Collectsound_collectcontact_collect, when an object is collected by touch (contact effect bit 3). Not heard in any of the runs below.called once; 10 waves, every one of them the length sound_collect's code gives it, on half-waves and off2 ms3579–4545 Hz

Tunes

A note is one byte: bits 0-5 its entry in note_table (0 a rest), bits 6-7 its length less one, one to four units. An entry gives the half-period as a DJNZ count B and a pass count C, and the cycles in one unit; play_note multiplies the cycles by the length and toggles the speaker, off then on, for each. Each tune below was recorded by calling its player with DE at the tune and no key down, so that the title tune plays to its end, as it does for a player who waits.

TuneNotesPlayed by, and whenRecordedLengthPitchListen
Titletitle_tunemenu, as the menu is first shown, through play_tune_until_key: any key stops it between two notes.play_tune_until_key called with DE = $70D8 and no key down: 250 notes, entries 25-49, no rests, 18,655 waves, 37,309 edges, every half-wave the length the note table and play_note's loops give it.40.76 s209–824 Hz (G#3–G#5)
Start of a gamestart_tunemenu, as the menu ends with 0 pressed, through play_tune: the game waits for it.play_tune called with DE = $F4E4: 9 notes, entries 37-44, no rests, 948 waves, 1,895 edges, every half-wave the length the note table and play_note's loops give it.1.88 s415–619 Hz (G#4–D#5)
Deathdeath_tuneplay, at the end of the death sequence, before the next life.play_tune called with DE = $F4DD: 6 notes, entries 24-30, no rests, 347 waves, 693 edges, every half-wave the length the note table and play_note's loops give it.1.57 s198–279 Hz (G3–C#4)
Planet securedlevel_tunelevel_done, after the planet-secured screen, before the next planet.play_tune called with DE = $F56A: 21 notes, entries 25-46, no rests, 3,789 waves, 7,577 edges, every half-wave the length the note table and play_note's loops give it.7.56 s209–696 Hz (G#3–F5)
Game overgame_over_tunegame_over, under PLAYER n GAME OVER.play_tune called with DE = $F580: 16 notes, entries 30-46, no rests, 1,250 waves, 2,499 edges, every half-wave the length the note table and play_note's loops give it.2.52 s279–696 Hz (C#4–F5)

How the recorded pitches compare with the table. Every note the five tunes play was measured from its recording, as the mean of its whole waves, and every one is the pitch the note table gives it through play_note's loops -- a half period of 13B + 3339C - 3333 T-states, plus 39 for the off half and 62 for the on -- to within 0.000 Hz, the rounding of the mean; the half-waves themselves match to the T-state (the Recorded column above). The table runs from 52.6 Hz (entry 1) to 1524 Hz (entry 60). Set against an equal-tempered scale with A4 at 440 Hz it is nearest with entry 1 as G#1 and entry 60 as G6, its notes lying within 53 cents of that scale, and the notes the tunes play within 15 (the table below). It is not quite a scale of semitones as played: counted in loops, as 256(C - 1) + B turns of the DJNZ, its entries step by a semitone to within 7 cents (the rounding of B), but each half-wave also spends a fixed hundred-odd T-states outside its loops, which is a larger share of a short period than a long one, so the high notes come out flatter than the low: from the semitone series that fits the played pitches best, entry 1 lies +37 cents and entry 60 -34 (the table looks to have been worked out as loop counts -- an inference from these numbers). Entry 18 repeats the B and C of the entry before, so note 18 sounds as note 17 (only its cycle count differs) and the step from 17 to 19 is two semitones; no tune plays it.

EntryBCCycles a unitTable's pitchRecordedNearest noteCentsA unitPlayed in
24163331197.66 Hz197.66 HzG3+150.157 sDeath
25125333209.34 Hz209.34 HzG#3+140.158 sTitle, Death, Planet secured
2689335221.76 Hz221.76 HzA3+140.158 sTitle
2756337234.51 Hz234.51 HzA#3+110.158 sTitle, Death
2824339248.35 Hz248.35 HzB3+100.157 sDeath
29250241263.34 Hz263.34 HzC4+110.156 sTitle
30221244279.17 Hz279.17 HzC#4+120.158 sTitle, Death, Game over
32169249312.92 Hz312.92 HzD#4+100.157 sTitle
34123255350.39 Hz350.39 HzF4+60.157 sTitle, Game over
35102258370.64 Hz370.64 HzF#4+30.156 sTitle
3681262393.39 Hz393.39 HzG4+60.158 sPlanet secured
3763265415.23 Hz415.23 HzG#4-00.157 sTitle, Start of a game, Planet secured
3845269439.64 Hz439.64 HzA4-10.157 sTitle
3928273465.49 Hz465.49 HzA#4-30.157 sTitle, Start of a game, Game over
41253182523.09 Hz523.09 HzC5-10.157 sTitle, Start of a game, Planet secured, Game over
42239187553.18 Hz553.18 HzC#5-40.157 sTitle, Start of a game, Planet secured, Game over
44213198619.36 Hz619.36 HzD#5-80.158 sTitle, Start of a game, Planet secured, Game over
461891110696.24 Hz696.24 HzF5-60.158 sTitle, Planet secured, Game over
471791117734.21 Hz734.21 HzF#5-140.159 sTitle
491591131824.11 Hz824.11 HzG#5-140.159 sTitle

In the game

The game itself, played in the simulator the way the build's sessions play it, recorded from the moment named. Each run's edges were split into the calls that made them, by the return addresses on the stack at each OUT, and every call was matched against the models of every effect, over all the inputs it could have, and against the tunes' recordings above: the column says what each run holds.

RunWhat happensWhat it holdsLengthListen
A game beginsFrom the menu: 0 pressed, the start tune, the new life's fly-in and its whine, then the build's keyboard round of flying (thrust, steering both ways, firing), with the damage and the fuel undone between its steps.the start of a game tune, rising whine, crackle x9, shot x17, falling zap x5, debris x21. 3,300 edges, every one of them in a call that matched.14.90 s
Flying with every add-onAll nine add-ons fitted at a new life, then the special beam (the number row, the ship still), thrust and steering, with the damage and the fuel undone between the steps.rising whine, special beam flutter x66, shot x8, debris x42. 2,999 edges, every one of them in a call that matched.15.00 s
The shield running outA second into a game, the hit-immunity timer (shield_timer) set to $28 -- the last stretch of the shield a pick-up gives, which starts it at $FF -- and the ship left alone until it reaches 0: cyan, then flashing, then white.ship colour x8, falling zap x2, crackle x5, debris x28, tick. 744 edges, every one of them in a call that matched.4.65 s
A tour near the top of the mapA new life put at map row 3 by the game's own restart, then the build's tour: east, climbing and dropping, firing, three times over, with the damage and the fuel undone between the steps.rising whine, shot x23, tick x19, buzz x8, crackle, fire x2. 1,393 edges, every one of them in a call that matched.12.00 s
A tour of the cavernsThe same at map row 16, four times over; a crash inside a step can still kill, and does.rising whine x2, shot x29, tick x7, falling zap x4, debris x42, death x26, the death tune, tough attacker's hum x13. 2,911 edges, every one of them in a call that matched.16.00 s
Out of fuelThe tank emptied in flight: the grace passes, the ship breaking up, the death sequence, the death tune, and the next life's fly-in.crackle x5, falling zap x3, death x26, tick, the death tune, rising whine. 1,690 edges, every one of them in a call that matched.10.95 s
The last life lostThe last life's tank emptied: the death, then the game-over tune, until the menu (where ENTER, held, cuts the title tune short at once).crackle x5, falling zap x3, death x26, tick x11, the death tune, the game over tune. 4,287 edges, every one of them in a call that matched.15.96 s
The rocket launchedA new life put inside the finished rocket by the game's own restart (all eight parts built): the fly-in, the docking, the launch, the planet-secured screen with its bonus count, the planet tune, and the next planet's first pass.rising whine x2, falling zap x11, launch x389, beams x21, the planet secured tune. 19,319 edges, every one of them in a call that matched.40.62 s