12 September 2026
Converting Scream Tracker 3 S3M Modules to WAV: Architecture and Synthesis
In 1994, Finnish demoscene powerhouse Future Crew released Second Reality—widely hailed as the most influential PC demoscene production of all time. Fueling its unforgettable soundtrack by composers Jussi-Pekka Ilmari ("Purple Motion") and Peter Hajba ("Skaven") was Scream Tracker 3 and its signature music format: .s3m.
While Commodore Amiga tracker modules (.mod) were tied to the Paula sound chip's 4-channel hardware architecture and rigid PAL clock frequencies, Scream Tracker 3 broke free from Amiga limitations. Designed natively for MS-DOS PCs equipped with Sound Blaster, Gravis UltraSound, or AdLib OPL FM synth cards, the S3M format introduced support for up to 32 digital channels, 16-color panning matrices, arbitrary sample playback rates, and sophisticated volume slides.
This forensic guide analyzes the internal byte structure of Scream Tracker 3 files, walks through pattern packing mechanics and 16-byte paragraph pointers, and explains how convrtr's S3M to WAV engine synthesizes chiptune tracker files into pristine 16-bit PCM audio directly in your browser.
The SCRM File Header Specification
Every valid .s3m file starts with a 96-byte primary header:
| Offset (Bytes) | Field Name | Data Type | Forensic Description |
| :--- | :--- | :--- | :--- |
| 0x00 - 0x1B | Song Title | 28 ASCII chars | Song name, null-padded |
| 0x1C | DOS EOF | 1 byte | Always 0x1A (Stops MS-DOS TYPE command from spilling binary) |
| 0x1D | File Type | 1 byte | Tracker file type (0x10 = S3M song) |
| 0x1E - 0x1F | Reserved | 2 bytes | Padding |
| 0x20 - 0x21 | Order Count | 16-bit uint (LE) | Number of pattern order positions |
| 0x22 - 0x23 | Instrument Count | 16-bit uint (LE) | Number of sample/instrument parapointers |
| 0x24 - 0x25 | Pattern Count | 16-bit uint (LE) | Total unique 64-row pattern chunks |
| 0x26 - 0x27 | Flags | 16-bit bitfield | Bit 0: 0 = Standard, Bit 4: Fast volume slides |
| 0x28 - 0x29 | Tracker Version | 16-bit uint (LE) | Created tracker version (0x1320 = ST 3.20) |
| 0x2A - 0x2B | Sample Format | 16-bit uint (LE) | 1 = Signed samples, 2 = Unsigned samples |
| 0x2C - 0x2F | Magic Marker | 4 ASCII chars | Constant "SCRM" (0x53 0x43 0x52 0x4D) |
| 0x30 | Global Volume | 1 byte | Master volume (0 to 64) |
| 0x31 | Initial Speed | 1 byte | Default tempo ticks per row (typically 6) |
| 0x32 | Initial BPM | 1 byte | Default beats per minute (typically 125) |
| 0x33 | Master Volume | 1 byte | Master amplification and stereo flag |
| 0x34 | Ultraclick Removal | 1 byte | Number of channels to reserve for GUS click reduction |
| 0x35 | Default Pan Flag | 1 byte | 252 (0xFC) if custom panning table is appended |
| 0x40 - 0x5F | Channel Map | 32 bytes | Configuration for channels 0 to 31 (0xFF = disabled) |
The Parapointer Addressing Mechanism
To optimize file parsing on real-mode x86 processors with 64KB memory segments, Scream Tracker 3 uses parapointers (paragraph pointers) to reference internal data structures.
A parapointer is a 16-bit little-endian integer pointing to a 16-byte aligned memory boundary. To derive the exact absolute byte offset in the file:
absoluteByteOffset = parapointer * 16 (or parapointer << 4)
The header contains three consecutive parapointer arrays:
- Order List: A sequence of bytes designating which pattern index to play next. Order value
255(0xFF) marks the end of the song, while254(0xFE) represents an empty skip marker. - Instrument Parapointers: An array of
uint16values pointing to each instrument header. - Pattern Parapointers: An array of
uint16values pointing to each compressed pattern block.
Instrument Headers and C4SPD Frequency
Each instrument block begins with a 78-byte sample descriptor:
Type:1for sample instrument,2for AdLib FM instrument.Length: 32-bit sample length in bytes.Loop StartandLoop End: Loop boundary points for sustained notes.Volume: Default instrument playback volume (0 to 64).Flags: Bit 0 indicates active loop; Bit 4 indicates 16-bit sample data; Bit 5 indicates stereo sample data.- C4SPD (Middle C Frequency): A 32-bit integer indicating the sample playback rate in Hertz when playing note C-4. While Amiga Paula chips used fixed hardware periods, S3M instruments declare dynamic playback rates (such as
8363 Hz,11025 Hz, or22050 Hz), allowing samples to be pitched precisely across any hardware platform. - Data Parapointer: A 24-bit high-offset parapointer (
(highByte << 16) | lowWord) multiplied by 16 to locate the raw PCM sample bytes.
Channel Compression and Pattern Unpacking
S3M patterns contain 64 musical rows. To avoid wasting bytes on empty tracks, rows are compressed using channel-mask packing:
Each row consists of zero or more channel tokens, terminated by a null byte (0x00):
- Read the first byte
b:- If
b == 0x00: The current row is complete. Increment the row counter and continue to row 64.
- If
- Extract the channel index:
channel = b & 0x1F(Channels 0 to 31).
- Inspect the bit flags on
b:- Bit 5 (
0x20): Note and instrument data present. Read 2 bytes:- Byte 1:
Note(0x00to0xDFrepresents octaves 0-9;0xFE= Key Off,0xFF= Empty). - Byte 2:
Instrument(1-based instrument index).
- Byte 1:
- Bit 6 (
0x40): Volume byte present. Read 1 byte (0to64). - Bit 7 (
0x80): Effect command present. Read 2 bytes:- Byte 1:
Commandletter (e.g.,A= Set Speed,B= Order Jump,C= Pattern Break,D= Volume Slide,J= Arpeggio). - Byte 2:
Infoparameter byte.
- Byte 1:
- Bit 5 (
Synthesizing S3M to 16-Bit Linear PCM
Synthesizing an S3M module into standard audio requires a multi-voice digital mixer running at a fixed output sample rate (e.g., 44,100 Hz):
- Clock Calculation:
tickDurationInSeconds = 2.5 / BPMsamplesPerTick = outputSampleRate * tickDurationInSeconds- Each row lasts for
Speedticks (default 6).
- Pitch Calculation:
- For a given note and C4SPD frequency:
frequency = C4SPD * (2 ** ((note - 48) / 12)) - The sample step increment per output frame is:
step = frequency / outputSampleRate
- For a given note and C4SPD frequency:
- Stereo Mixing and Interpolation:
- Voices accumulate interpolated sample samples based on channel panning (0 = hard left, 7 = center, 15 = hard right).
- Accumulated floats are clamped and converted to signed 16-bit little-endian words, packaged into a canonical RIFF WAV container.
Pure Client-Side Privacy
Chiptune modules from demoparties, retro games, and personal mod collections can be played and rendered instantly without installing legacy MS-DOS emulators or third-party desktop utilities. Because convrtr runs the entire S3M synthesis engine directly in JavaScript within your browser tab, conversions happen locally at lightning speed with absolute privacy.
Related reading
Converting FastTracker II XM Chiptune Modules to WAV: Architecture and Synthesis
Explore the forensic format of Triton FastTracker II Extended Modules (.xm). Understand 32-channel pattern matrices, linear pitch tables, delta sample compression, and client-side WAV rendering.
Converting Impulse Tracker IT Modules to WAV: Architecture and Synthesis
Explore Jeffrey Lim's Impulse Tracker (.it) format. Learn about 64-channel matrix structures, C5Speed frequency tables, sample compression, and client-side WAV rendering.
Converting PolyTracker (PTM) to WAV: 32-Channel DOS Game Chiptune Synthesis
Explore Carlos Hasan's PolyTracker PTMF architecture. Learn how 32-channel panning tables, 16-bit PCM samples, ping-pong loops, and tracker synthesis render into CD-quality WAV in browser memory.
Converting Farandole Composer (.far) to WAV: 16-Channel DOS Tracker Synthesis
Dive into Daniel Potter's 1994 Farandole Composer module format. Discover how 16-channel pattern cells, 8-bit PCM samples, custom panning tables, and real-time chiptune synthesis render into pristine 16-bit WAV audio.
Converting Composer 669 (.669) to WAV: 8-Channel DOS Tracker Synthesis
Explore Tomasz Pytel's 1992 Composer 669 tracker format. Learn how 8-channel pattern matrices, 108-byte song messages, 8-bit unsigned PCM waveforms, and software mixing synthesize into clean 16-bit stereo WAV.
Converting AMF Tracker Modules to WAV: Advanced Module Format Audio Synthesis
Dive into Otto Chrons' Advanced Module Format (AMF) and ASYLUM tracker architecture. Learn how 16-channel DOS module tracking and 8-bit PCM software mixing render into studio-quality WAV audio.
Converting DSM Tracker Modules to WAV: RIFF DSMF Multi-Channel Audio Synthesis
Explore DSIK's Dynamic Studio Module (DSM) tracker architecture. Learn how RIFF container chunks, 16-channel pattern matrices, and 8-bit PCM samples synthesize into 16-bit stereo WAV.
Converting Reality Adlib Tracker (RAD) to WAV: 9-Channel OPL2 FM Synthesis
Explore the internal architecture of Reality Adlib Tracker (.rad) files. Learn how Yamaha YM3812 2-operator FM synth parameters synthesize into 16-bit stereo WAV in your browser.
Converting Oktalyzer (OKT) Modules to WAV: Amiga 8-Channel Chiptune Synthesis
Explore Armin Sander's legendary Amiga Oktalyzer (.okt) tracker format. Learn how 8-channel software mixing on the 4-channel Paula sound chip is rendered into studio WAV audio.
Converting MultiTracker (MTM) Modules to WAV: 32-Channel Track Matrix Synthesis
Discover Daniel Gold's Renaissance MultiTracker (.mtm) format. Learn how 32-channel track matrix sequencing, volume panning, and 8-bit PCM samples synthesize to 16-bit WAV.
Converting id Software IMF Audio to WAV: Yamaha OPL2 FM Synthesis in the Browser
Dive into id Software's IMF music format from Wolfenstein 3D and Commander Keen. Learn how Yamaha YM3812 FM register bytes synthesize into 16-bit stereo WAV audio.
Converting HMI DOS Game Audio to WAV: Emulating 1990s PC Soundtracks
Explore Human Machine Interfaces (HMI) MIDI audio from Descent, Warcraft II, and Mortal Kombat. Learn how multi-track game sequences synthesize into 16-bit stereo WAV.
Converting AdLib ROL Music to WAV: Emulating 1980s PC FM Synthesis
Discover AdLib Visual Composer (.rol) music from the pioneer era of PC audio. Learn how Yamaha YM3812 (OPL2) FM synthesis converts to 16-bit stereo WAV.
Converting Miles Sound System XMI to WAV: 1990s PC Game Soundtracks
Discover Miles Sound System Extended MIDI (.xmi) audio from Wing Commander, Ultima, and Theme Park. Learn how IFF XMID sequences convert to 16-bit stereo WAV.