The sounds come last in the file. After the last pattern, the data of each sample follows in the order of the sample headers, sample 1 first, with nothing between them; the lengths are in the sample headers.
Where each sample starts
start of sample data = 600 + patterns × 1024
patterns = 1 + the highest number in all 128 order entries
sample n starts at = start of sample data + 2 × (length of samples 1 to n − 1)
Sample n is 2 × length bytes long, and samples with a length of 0 take no space. A module whose order table names patterns 0 to 2 has its sample data at 600 + 3 × 1,024 = 3,672. A sample’s loop start, in bytes, counts from the start of that sample’s own data.
Encoding
Each byte is one sample point, a signed 8-bit number from −128 to 127, mono. No sample rate is stored: the rate depends on the note being played, as the period says; C-2 plays a sample at about 8,287 bytes a second and C-3 at about 16,574.
+0 00 00 05 12 26 3B 4A 52 51 47 35 1D 02 E8 D0 BD
E8 is −24, BD is −67)Ultimate Soundtracker allowed samples of up to 9,999 bytes; Master Soundtracker 1.0
and D.O.C. Soundtracker 2.0 allowed 32 KB (OpenMPT). Sample names often keep the name of
the Soundtracker sample disk a sound came from, as in st-02:snare14.
Short and long files
The file should end with the last byte of the last sample. A reader should take what is there rather than turn a file down that ends early or carries extra bytes: the explorer reads a sample cut short as far as the file goes and reports how much is missing.