An instrument is an 80-byte header found through the instrument parapointers. Its first byte is the type, and the fields that follow depend on it. Offsets are hexadecimal. Numbers are little-endian.
Instrument types
| Type | Meaning | Signature |
|---|---|---|
| 0 | Empty: a message only, with no sample data | – |
| 1 | Sample | SCRS |
| 2 | AdLib melody | SCRI |
| 3 | AdLib bass drum | SCRI |
| 4 | AdLib snare | SCRI |
| 5 | AdLib tom | SCRI |
| 6 | AdLib cymbal | SCRI |
| 7 | AdLib hi-hat | SCRI |
Scream Tracker reportedly loads files that lack the signature, so a reader should not insist on it.
Sample instrument
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 00 | 1 | u8 | type | 1. |
| 01 | 12 | text | filename | DOS 8.3 file name. |
| 0D | 3 | u24 | MemSeg | Parapointer to the sample data, in a mixed byte order (see below). |
| 10 | 4 | u32 | Length | In bytes. Scream Tracker uses only the low 16 bits and clips files above 64,000 bytes. |
| 14 | 4 | u32 | LoopBegin | Low 16 bits used. |
| 18 | 4 | u32 | LoopEnd | One past the last byte played in the loop. Low 16 bits used. |
| 1C | 1 | u8 | Vol | Default volume, 0 to 64. |
| 1D | 1 | – | reserved | |
| 1E | 1 | u8 | Pack | 0 unpacked, 1 DP30ADPCM. Scream Tracker 3.01 does not use packing, and how DP30ADPCM works is not publicly documented. |
| 1F | 1 | u8 | Flags | |
| 20 | 4 | u32 | C2Spd | Frequency for middle C. Low 16 bits used. |
| 24 | 12 | – | internal | Scream Tracker uses these bytes only in memory, for the Gravis address, Sound Blaster loop flags and last-used position. |
| 30 | 28 | text | sample name | Includes the terminating zero byte. |
| 4C | 4 | ASCII | signature | SCRS. |
MemSeg
Sample data is found with a 24-bit parapointer split across the 3 bytes at
0D: the first is the top byte, and the next two are the middle and low
bytes, little-endian. In other words, the file offset is
((byte 0 × 65536) + (byte 1) + (byte 2 × 256)) × 16.
Sample flags
| Bit | Value | Meaning when set |
|---|---|---|
| 0 | 1 | Loop on. |
| 1 | 2 | Stereo: left data, then right data, each Length bytes. Not supported by Scream Tracker 3.01. |
| 2 | 4 | 16-bit little-endian samples. Not supported by Scream Tracker 3.01. |
The header’s Ffi field says whether samples are signed (1, very old) or unsigned (2).
AdLib instrument
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 00 | 1 | u8 | type | 2 for melody, 3 to 7 for percussion. |
| 01 | 12 | text | filename | DOS 8.3 file name. |
| 0D | 3 | – | reserved | Zero. |
| 10 | 12 | bytes | D00–D0B | The OPL operator parameters. |
| 1C | 1 | u8 | Vol | Default volume. |
| 1D | 3 | – | reserved | TECH.DOC calls byte 1D “Dsk” without describing it. |
| 20 | 4 | u32 | C2Spd | Scales the note frequency sent to the AdLib. Low 16 bits used. |
| 24 | 12 | – | reserved | |
| 30 | 28 | text | sample name | Includes the terminating zero byte. |
| 4C | 4 | ASCII | signature | SCRI. |
OPL parameters (D00 to D0B)
The modulator uses D00, D02, D04, D06, D08 and D0A; the carrier D01, D03, D05, D07 and D09. Bits marked uncertain are given with a question mark in TECH.DOC.
| Byte | Meaning |
|---|---|
| D00, D01 | Frequency multiplier in the low bits, with scale envelope (+16), sustain (+32), pitch vibrato (+64) and volume vibrato (+128). Uncertain in TECH.DOC. |
| D02, D03 | Volume as 63 minus the value, with level scale bits (&1 at +128, &2 at +64). |
| D04, D05 | Attack (+16) and decay. |
| D06, D07 | Sustain as 15 minus the value (+16), and release. |
| D08, D09 | Waveform select. |
| D0A | Modulation feedback (+2) and an additive-synthesis flag, marked uncertain. Modulator only. |
| D0B | Unused. |
Sample data
Sample data is Length bytes at the MemSeg parapointer for 8-bit mono, the only form Scream Tracker itself plays. It is signed or unsigned according to the header’s Ffi field.