Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Scream Tracker 3 module (S3M)

From ReverseEngineering.wiki
Format
Magic SCRM at 0x2C
Extensions .s3m
Endianness little
On this wiki Facts · Code · Notes · Topics

Scream Tracker 3 module (.s3m), the PC (DOS) tracker format of Future Crew's ST3: little-endian, a 96-byte header with "SCRM" at offset 0x2C and 0x10 at offset 0x1D, 16-byte-paragraph pointers to instruments and packed patterns, and sample or OPL2 FM instrument records of 80 bytes ("SCRS" / "SCRI" at +0x4C).

Overview

S3M is the module format of Scream Tracker 3 for MS-DOS (Sound Blaster, Gravis Ultrasound) and was used by many DOS games and demos. Unlike Format:ProTracker MOD it supports up to 32 channels, 16-bit samples, and OPL2 FM instruments, and it addresses everything by 16-byte paragraphs.

Layout

See Fact:Scream Tracker 3 module (S3M)/struct/S3M file header for the first 96 bytes. After the header: the order list (ordnum bytes; values 0xFE = marker, 0xFF = end), then insnum 16-bit paragraph pointers to instruments, then patnum 16-bit paragraph pointers to patterns, then, if the default-pan byte is 0xFC, 32 pan bytes. File position = pointer x 16 (libxmp s3m_load.c lines 336-385, 490-495, 672-676).

Identification

"SCRM" at 0x2C and the byte 0x10 at 0x1D (file type: module); libxmp s3m_test checks exactly these two (lines 78-92). The tracker and version word at 0x28 (0x13xx = ST3.xx) tells which program saved it; libxmp spots ModPlug Tracker, PlayerPRO and Velvet Studio by header patterns (lines 395-430).

Patterns

See Fact:Scream Tracker 3 module (S3M)/behavior/Packed pattern rows.

Instruments and samples

See Fact:Scream Tracker 3 module (S3M)/struct/S3M instrument record. Sample data is at the 24-bit paragraph pointer (memseg_hi:memseg) x 16; samples are unsigned when the file format information (header word at 0x2A) is 2 and signed when it is 1 (line 653).

Pitfalls

  • Do not trust the pattern count in the header: libxmp derives it from the highest order value below 0xFE and clamps it to the header value.
  • Unverified: the Adlib instrument types 2-7 map to the OPL2 melodic and drum voices; the constants S3M_INST_AMEL..AHIHAT are defined but only buf[0] >= 2 is tested in the loader.

Code & repositories

libxmp (MIT) src/loaders/s3m_load.c and s3m.h; OpenMPT soundlib/Load_s3m.cpp (Unverified: not read).

  • https://github.com/libxmp/libxmp @ 5d4f6aa2c7dcdf8e9cd8129fe579d45b36a302da · license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
    Extended Module Player library: loaders for MOD, Soundtracker, S3M, XM, IT and dozens of other tracker formats (src/loaders), with tracker detection heuristics.
    Tested on: source read, not run: read only, source files at the pinned commit · checked 2026-10-19; last activity 2026-10-10