Sound parameters (setup/soundparam.dat)
Per-sound flags and 3-D parameters, one 6-byte record per sound id. Layout from the shared notes (“Character table”, “Sources”), checked on our file (the four tables fill the 18,804 bytes exactly) and against the PC loader 0x140241d40, which requires the magic and version below and at least 120 / 350 / 1960 records in tables 1 / 2 / 3.
| off | type | field |
|---|---|---|
| 0x00 | char[4] | magic, a space then SND |
| 0x04 | u32 | version 2 |
| 0x08 | u32[4] | record counts of the four tables: 650, 120, 400, 1960 |
| 0x18 | 6 B × sum | the tables, back to back |
Record (6 B): u8 flags, u8 near distance, u8 far distance (both in tens of units), u8 curve (0 linear, 1 and up logarithmic), u16 spread in percent. Table 3 holds one constant record 1960 times.
Groups (PC loader). The loader builds a list of {pointer, first id, last id} groups that the sound code indexes by a sound’s bank group and its id in that group:
- group 0: table 0, ids 0..649;
- groups 1–9: table 1 cut into eight runs of 10 records and a last run of 40 (ids 80..119);
- groups 10–14: table 2 cut into runs of 70 (five runs: 350 of its 400 records);
- groups 15–42: table 3 cut into 28 runs of 70;
- a last group: 10 records of table 0 starting at record 621.
What the PC port reads. (Corrected by the ambient run, 11-14: this paragraph used to say that no PC code reads the distances, the curve or the spread. The 3-D send routine 0x140241440 reads all of them; see “Stage soundscape, 3-D sends and the listener”.)
- flags bits 0–1: the cue’s volume class 0..3 (a per-class volume multiplies the play volume; same section);
- flags bit 3 (0x08): the held (looping) cue flag; the stage sound emitter copies it into its mode (0x140221459, “Stage sounds”);
- flags bit 4 (0x10): positional. The per-tick pass over the play requests (0x140240210) calls the 3-D update 0x140240c10 for such a request and the plain volume update 0x1402413a0 for the others;
- near, far, curve, spread: the distance falloff and the speaker spread of a positional request (0x140241440).
One more positional piece: the 3-D update computes a pitch from the change of the emitter’s distance to two stored listener points, 4096 × (1 + 30 × Δd / 3400), capped at twice the pitch (0x140240e20; a Doppler shift by the look of it, not followed further).
Rebuild (ambient build
11-14): pdsound.py writes the
groups above as param_groups
(records as stored: [flags, near, far, curve,
spread]) and each bank’s
param_group (common 0, a stage bank
its area); PdSound.param(bank, cue)
reads them. Our file: 540 of the 650 common
records have flag 0x10; the stage groups’ filled
records are all class 2.