Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RepellantMold/9caa1365d725a055f4dc1c3b7a377f64 to your computer and use it in GitHub Desktop.
Save RepellantMold/9caa1365d725a055f4dc1c3b7a377f64 to your computer and use it in GitHub Desktop.
Extra Scream Tracker 2 documentation.

Scream Tracker 2 instrument library (ILB) file format

The numbered files (STXX.ILB)

Main header

          0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
        ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
0000:   │'I'│'n'│'s'│'t'│'r'│'u'│'m'│'e'│'n'│'t'│' '│'L'│'i'│'b'│'r'│'a'│
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0010:   │'r'│'y'│' '│' '│'!'│'S'│'C'│'R'│'E'│'A'│'M'│'!'│1Ah│C9h│02h│15h│
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0020:   │09h│Ins│ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0030:   │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0040:   │ x │
        ├───┼
  • Ins is the number of instruments available in the file.

Sample header

  • What follows are the sample headers, identical to the one that are in Scream Tracker 2 modules. The only difference are that the PCM pointer is blank.

ST.ILB

Layout

Nearly identical to the numbered files, however instead of sample headers, it's full of strings instead.

          0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
        ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
0000:   │'I'│'n'│'s'│'t'│'r'│'u'│'m'│'e'│'n'│'t'│' '│'L'│'i'│'b'│'r'│'a'│
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0010:   │'r'│'y'│' '│' '│'!'│'S'│'C'│'R'│'E'│'A'│'M'│'!'│1Ah│C9h│02h│15h│
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0020:   │ x │Library names (32 characters, null terminated)             │
        ├───┼───────────────────────────────────────────────────────────┤
0030:   │                                                               │
        ├───────────────────────────────────────────────────────────────┤
0040:   │   │ (repeat for 99 libraries)                                 │
        ├───┼───────────────────────────────────────────────────────────┤
etc.

Scream Tracker 2 Settings (SET) format documentation

Tested on Scream Tracker 2.2, 2.3, and 2.25. (the most common available versions) All done with hex editing.

Terminology

  • Sp2 = Playback rate when using the Scope
  • Spd = Regular playback rate
  • Flp = Floppy disk timer toggle (its interrupt gets masked when disabled)
  • Esn = "Edit sound", lets you hear a note as you place it into a pattern when enabled
  • Dsk = The drive used when you're asked to insert a disk for instruments
  • Out = Output devices
  • Directories = 32 byte string, NULL terminated

Output devices

enum OUTPUT_DEVICES {
  OUTPUT_SOUNDBLASTER = 0,
  OUTPUT_COVOXLPT1 = 1,
  OUTPUT_COVOXLPT2 = 2,
  OUTPUT_PCSPEAKER = 3,
  /* 2.3 only */
  OUTPUT_COVOXSOUNDMASTERII = 4,

  /*
   * values outside will simply freeze
   * when attempting playback and show up as
   * garbage when bringing up the settings
   * menu
   */
};

Any other values will display garbage characters and are invalid.

Output rates

enum OUTPUT_RATE {
  SPEED_5MHZAT = 9,
  SPEED_6MHZAT = 8,
  SPEED_7MHZAT = 7,
  SPEED_8MHZAT = 0,
  SPEED_10MHZAT = 1,
  SPEED_11MHZAT = 6,
  SPEED_12MHZAT = 2,
  SPEED_16MHZAT = 3,
  SPEED_20MHZAT = 4,
  SPEED_25MHZAT = 5,
};

Notes

  • All versions have 8, 10, 12, 16, 20, and 25 Mhz available, versions after 2.2 add 5, 6, 7, and 11 Mhz.

Strangely their classification is also different; 2.2 has 16, 20, and 25 under "386", while later versions all say "AT" speed.

Any other values will display garbage characters and are invalid.

Color settings

  • The bytes specify 2 colors; a highlight color and a normal color
  • The colors corrospond to the 16-color palette of CGA
// Default settings for all versions
unsigned char color_settings[18] = {
  // top menu
  0x17,

  // highlighted selection in the top menu
  0x30,

  // top line (the registered user text is unaffected by this and fixed to 0x4E)
  0x4E,

  // '-', it seems to control the background of the space character on the settings screen
  0x1F,

  // general background
  0x67,

  // status bar text
  0x47,

  // bottom text (sample/pattern/order text)
  0x07,

  // bottom cursor (sample/pattern/order text)
  0x30,

  // bottom screen block
  0x17,

  // info values
  0x03,

  // bottom bar
  0x87,

  // messages
  0x17,

  // help: text
  0x47,

  // help: keyword
  0x4F,

  // help: highlighted text
  0x70,

  // File browser: text
  0x20,

  // File browser: keyword
  0x27,

  // File browser: highlighted text
  0x07,
};

2.2 and older

Layout

          0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
        ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
0000:   │Out│Spd│System directory                                       │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0010:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0020:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0030:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0040:   │       │Instrument directory                                   │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0060:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0070:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0080:   │       │Song directory                                         │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0090:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00A0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00B0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00C0:   │       │ x │Dsk│Sp2│Flp│ x │ x │Color settings                 │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00D0:   │                                       │ x │ x │ x │ x │ x │ x │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00E0:   │ x │ x │ x │ x │ x │ x │ x │ x │
        ├───┼───┼───┼───┼───┼───┼───┼───┤

2.24 and newer

Layout

          0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
        ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
0000:   │'S'│ x │Out│Spd│Sd2│Esn│Dsk│Flp│System directory               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0010:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0020:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0030:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0040:   │                               │Instrument directory           │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0060:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0070:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0080:   │                               │Song directory                 │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0090:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00A0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00B0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00C0:   │                               │Instrument disk 99 directory   │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00D0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00E0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
00F0:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0100:   │                               │ADD directory                  │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0110:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0120:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0130:   │                                                               │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0140:   │                               │ x │Color settings             │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0150:   │                                           │ x │ x │ x │ x │ x │
        ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0160:   │ x │ x │ x │ x │ x │ x │ x │ x │
        ├───┼───┼───┼───┼───┼───┼───┼───┤

2.3

  • Layout is identical to 2.24, but there's a new field with 3 new bytes;
          8   9   A  
        ┌───┬───┬───┐
0160:   │ x │Address│
        ├───┼───┼───┤
  • A word address (little-endian) that would be for your sound card (e.g. 0x220 on a SoundBlaster)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment