Scream Tracker 3.20 File Formats And Mixing Info (TECH.DOC)

author Sami Tammilehto (Future Crew)
date 1994
article TECH.DOC from the Scream Tracker 3.20/3.21 distribution
created 2026-08-30 · updated 2026-08-30

"The OFFICIAL information on s3m format and much more" — the S3M header, the instrument/sample header, the AdLib instrument layout, the packed pattern format, the STIMPORT and SIMPLEX exchange formats, the note-frequency formula and how ST3 mixes. Summarised at the semantic level; the byte tables stay in raw/.

Key claims#

  • Header: 28-character song name, type 16, order/instrument/pattern counts, flags, "created with" version (0x1300 ST 3.00 — "volumeslides on EVERY frame", 0x1320 ST 3.20), signed/unsigned sample flag, SCRM; global volume, initial speed (A), initial tempo (T), master volume (stereo bit), ultra-click channels, default-pan marker (252); 32 channel settings (0–7 left, 8–15 right, 16–31 AdLib: 9 melody + 5 drums; +128 disabled); orders (255 = end --, 254 = skip ++); parapointers (offset ÷ 16) to instruments and patterns; per-channel default pan. Flags: 0-volume optimisation (looping notes silent for more than two rows are switched off), Amiga limits ("sliding up stops at B#5"), ST 3.00 volume slides (also on the first frame; default for 0x1300 files).
  • Global volume divides note volumes (volume 48 at global 32 plays as 24); master volume only affects the Sound Blaster's sample multiplication (too high clips the 8-bit output; ×11/8 in stereo).
  • Instrument header (also the .s3i sample file): type 1 sample / 2 AdLib melody / 3+ AdLib drum, DOS filename, data pointer, length, loop begin/end (loop end points one byte after the last played), volume 0–64, pack flag (DP30ADPCM, unused), flags (loop, stereo, 16-bit — the last two unsupported by 3.01), C2Spd, name, SCRS/SCRI. Samples are clipped to 64,000 bytes.
  • AdLib instrument: 12 bytes D00–D0B packing the OPL registers — per operator frequency multiplier, envelope scaling, sustain, vibrato/tremolo flags, level (63 − volume) and key-scale level, attack/decay, sustain/release, waveform, plus feedback and additive/FM mode; types amel, abd, asnare, atom, acym, ahihat; C2Spd scales the note frequency sent to the chip.
  • Patterns: unpacked 32 channels × 64 rows × 5 bytes (note hi = octave, lo = note; 255 empty, 254 key-off "used with adlib, with samples stops smp"); packed as what bytes: 0 = end of row, low 5 bits channel, +32 note & instrument follow, +64 volume, +128 command & info.
  • C2SPD and pitch: "Finetuning (C2SPD) is actually the frequency in herz for the note C4. Why is it C2SPD? Well, originally in ST2 the middle note was C2 and the name stuck." Period table C…B = 1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 907, middle octave 4; st3period = 8363 × 16 × (period >> octave) ÷ C2SPD; amigaperiod = st3period ÷ 4; Hz = 14317056 ÷ st3period. "ST3 uses period values that are 4 times larger than the amiga to allow for extra fine slides."
  • Mixing: a volume table volume × (sample − 128) ÷ 64, a post-processing clip table shaped by the master volume, and output = Σ volumetable[volume × globalvolume ÷ 64][sample] — the theory behind the Sound Blaster mixer.

Practical takeaways#

Why S3M pitch commands are in quarter-Amiga-period units, why C4Spd = 8363 is "no finetune", why a global volume of 40h is full and why AdLib and sample instruments share one instrument list.

Notable quotes#

"So actually C2SPD should be called C4SPD..."

Pages touched#

s3m-format · scream-tracker-3 · detune · pitch-slide-and-portamento · opl-fm-instruments · sami-tammilehto

source file wiki/summaries/s-st3-tech-doc.md · graph