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:

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”.)

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.