Skip to main content

PC speaker and Tandy sounds (SND)

File formats · Field reference · Schema

In brief​

The ten .SND files hold the sounds played without an AdLib card: through the PC's built-in speaker (sound driver 2) or through the three-voice sound chip of Tandy computers (sound driver 3). They pair with the .ADL files of the same names: each level names one sound file, INTRO serves the introduction and FINALE1 and FINALE2 the ending, and the game loads the .ADL or the .SND file of that name depending on the sound driver set in EOSPREFS.DAT. The setup program of the release offers the AdLib card, the built-in speaker or no sound; it names the Tandy value in its summary but none of its menus stores it.

A file is a small library of programs, each a melody of short notes: note numbers with durations, a few frequencies given in hertz, a tempo factor and loops. A sound is played by starting a program. There are no instruments, and most programs last less than a second. What the original files hold is described below.

From the file Speaker and Tandy files (SND) to the game. The file holds, in order: Sound-effect table (120 bytes); Program pointers (250 × 2); Unused pointers (250 × 2); Programs (variable). The game: At level load, keep the first 120 bytes; Copy the rest, at most 15,120 bytes, to the buffer. In memory: The sound-effect table and the sound buffer. Used by: Sounds through the PC speaker or the Tandy chip.
The game turns it into the sound-effect table and the sound buffer.

Organization​

PartSizeContents
Sound-effect table120 bytesThe program played for each game sound number, 255 for none.
Program pointers250 × 2Where each program starts, counted from byte 120; 0 when absent.
Unused pointers250 × 2A second table, at the place of the ADL instrument pointers; zero and never read.
ProgramsvariableNotes and commands, each program up to an end byte.

Reading the file​

The game loads the file as it loads an .ADL file: it keeps the first 120 bytes as the sound-effect table and copies the rest, at most 15,120 bytes, into the sound buffer, where it turns both pointer tables into addresses.1 In all ten files the programs start at byte 1,120, follow one another in number order and the last one ends on the last byte of the file.

What it becomes in memory​

The sound-effect table stays in the game, which reads it each time a sound is requested; the programs stay in the sound buffer, with both pointer tables turned into addresses. Playing speaker and Tandy programs follows a program as it plays.1

In the original files​

The size and programs of each of the ten files are listed under sound and music.

The seven level files hold the same 68 programs and differ only by a few entries of their sound-effect tables, among sounds 37 to 49 and 57 to 63. 65 of the 68 programs last less than a second; the longest, program 46, lasts about 4.2 s. Many sound numbers share a program: in every level file, sounds 52 to 55 and 79 all start program 16, a 0.1-second chirp of ten notes falling from about 4,187 Hz to 1,329 Hz and back.

INTRO.SND and FINALE2.SND hold the same eight programs. INTRO.SND maps ten of the introduction's sound numbers to programs 1 to 7; its other entries, among them the sound that starts the music with the AdLib driver, are 0. Every entry of FINALE2.SND is 0, so the end credits are silent with these drivers. FINALE1.SND holds seven programs for the story of the ending.

Example​

The start of FOREST.SND, as an example:

0000 00 01 00 03 03 0d 15 15 42 0f … sounds 0–9 → programs 0, 1, 0, 3, 3, 13, 21, 21, 66, 15
0078 e8 03 eb 03 f4 03 1f 04 … program 0 at 0x3e8 (byte 0x460), program 1 at 0x3eb, …
0460 e2 01 ff program 0: tempo factor 1, end
0463 e2 01 20 00 2c 00 38 00 ff program 1: tempo factor 1, notes 32, 44 and 56, end

Sources​

Locations refer to the game executable reference; the comparative source is listed in the technical references (REF-SCUMM-023). The statements about the original files come from decoding every program of the ten files of the file inventory with the schema.

Footnotes​

  1. Load the sound file, sound data access and the sound data buffer. ↩ ↩2