ST3

Introduction

There are not many modules of this format. They are found in a small number of ZX Spectrum programs.

You can find the author's 55-byte string starting with "KSA SOFTWARE COMPILATION OF " inside the player codes of this format. Unlike similar strings in other players, it does not have a fixed " BY " tag.

The ST3 file name extension has become common to denote the format in various music collections.

I do not know the reason why this format is attributed to Sound Tracker 3. I have analyzed Sound Tracker 3 editors from a variety of sources and have not found any that compiles to a format other than the standard one.

The available to me versions of Sound Tracker 3 add a player to the standard STC module with an author's string starting with another identifier: "SOUND TRACKER COMPILATION OF ", in which the " BY " tag is in a fixed place.

In fact, the ST3 format is an alternative way to compile ST1. Also, as with the FLS format, there is a suspicion that there is no standalone editor, but there is a simple recompilation of STC. And therefore, a lossless reverse recompilation process in STC is also possible. So, Ay_Emul allows you to save loaded ST3 from the playlist window as STC, while the author's strings found are not lost and inserted into the body of the module.

Module structure

The structure is similar to STC, the terminology is the same (see the description of STC or ST1). The ellipses in the table below indicate that from this place, similar structures to the one described above follow each other.

The pointers are relative (from the beginning of the module). However, after calling the playback initialization in the native player, the offsets to the body of the ornaments and samples are linked to the module loading address.

OffsetSizeDesignationDescription
+01tempoPlayback speed.
+12posptrPointer to the list of positions.
+32samptrPointer to the list of samples.
+52ornptrPointer to the list of ornaments.
+72patptrPointer to the list of patterns.
Samples (the structure is described at the end).
+9=sam0ptr130sam0Sample 0 body.
+sam1ptr130sam1Sample 1 body.
...
+posptr1lenThe number of positions (there are modules where len is decreased by 1, and the lost position in the worst case refers to a non-existent pattern).
+posptr+12transposition,(pat-1)*6Transposition and pattern number at position 1.
+posptr+32transposition,(pat-1)*6Transposition and pattern number at position 2.
...
+samptr1lenThe number of items in the sample list (the numbering of samples is not from 1 as in ST1, but from zero, pointers can be linked to the module loading address).
+samptr+12sam0ptrPointer to sample 0, usually equal to +9.
+samptr+32sam1ptrPointer to sample 1.
...
Ornaments (each in structure like a regular ornament in STC).
+orn0ptr32orn0Ornament body 0 (should be 32 zeros).
+orn1ptr32orn1Ornament body 1.
...
+ornptr1lenThe number of elements in the list of ornaments (pointers can be linked to the module loading address).
+ornptr+12orn0ptrPointer to the ornament 0.
+ornptr+32orn1ptrPointer to the ornament 1.
...
Next come the bodies of the channel patterns (duplicates are eliminated).
+pat1ptrA?patdataThe usual channel pattern of the STC ended with 255.
+pat1ptrB?patdataThe usual channel pattern of the STC ended with 255.
+pat1ptrC?patdataThe usual channel pattern of the STC ended with 255.
+pat2ptrA?patdataThe usual channel pattern of the STC ended with 255.
+pat2ptrB?patdataThe usual channel pattern of the STC ended with 255.
+pat2ptrC?patdataThe usual channel pattern of the STC ended with 255.
...
?1unknownUnknown byte (in one module 0, in the other 0x76, and in TheLast1.st3 it does not exist at all).
+patptr6pat1ptrA,pat1ptrB,pat1ptrCPattern 1 pointers to the pattern bodies of each of the channels.
+patptr+66pat2ptrA,pat2ptrB,pat2ptrCPattern 2 pointers to the pattern bodies of each of the channels.
...

Features of sample numbering

The samples used are renumbered starting from 0 in order not to store an extra 130 bytes for each unused sample. Accordingly, there are references to the sample 0 in the channel patterns, which confuses some STC decompilers.

However, this is a regular STC pattern and it is enough to simply copy it without changes when converting from ST3 to STC.

And for a properly written decompiler (such as in Vortex Tracker II), samples renumbering does not cause problems, since it is fully compatible with the original STC player.

Sample structure (size 130 bytes = 2+4*32):

OffsetSizeDesignationDescription
+01lpbeginLoop begin (0..31).
+11lpendLoop end (0..31). If lpbegin = lpend = 0 then not looped.
+22tone0Tick 2: tone deviation (-0xFFF..0xFFF).
+41ampmsk0Bits 0..3 – amplitude, bit 4 – tone mask, bit 7 – noise mask.
+51noise0Bits 0..4 – the noise period.
+62tone1Tick 1: tone deviation (-0xFFF..0xFFF).
+81ampmsk1Bits 0..3 – amplitude, bit 4 – tone mask, bit 7 – noise mask.
+91noise1Bits 0..4 – the noise period.
...

Features of the native player

In the ST3 player, unlike the native STC player, unlooped samples on the 33rd tick are muted in a different way, and channels are output in reverse order from C to A (as a result, the priority of setting sample noise changes). Therefore, if you record and compare the PSG of these players on the same modules, you can see the difference on the corresponding ticks.

The author's string inside the module body

There are ST3s with the author's string inside in various music collections. This is a copy of the string from the player body. It is inserted at an offset of +9 (in the place where the sample 0 body is located in the source module).

Modification of the module is carried out in several steps: