README
¶
STM playback verification
The Mod Archive's most-downloaded chart did not supply ten STM entries in the inspected pages. On 2026-11-28 we enumerated all 100 STMs in the format- filtered filename index and ranked them by download counts, breaking ties by archive ID. The manifest pins the ten highest-ranked files, including The White Tiger at number one.
The native reference is st2play at commit
4c4614e666416d40da54935b484a8ec2edfa5e60. The headless runner aligns frame
zero with the first note and widens the native unsigned 8-bit mono output
into duplicated stereo signed 16-bit little-endian PCM. Its tick lengths
follow the native integer frame counter, including the delay before a tempo
change takes effect. The same files were captured independently with OpenMPT
0.8.10+r25841.pkg using linear interpolation and 0 mB gain.
Two archive files need an explicit end-of-pass rule. Future Brain uses a 255 order terminator, which the st2play port would otherwise treat as a pattern index. Kingdom Of Knowledge ends with an order pointing at an undeclared pattern immediately before its terminator. The capture adapter converts both positions to the native 99 terminator to avoid reading undeclared pattern data.
clang -O2 -Wall -I"$st2play" \
internal/test/tracker/stm-verification/reference/render-st2play.c \
"$st2play/stmload.c" "$st2play/st2play.c" -o "$scratch/render-st2play"
"$scratch/render-st2play" 48000 600 "$corpus/155865.stm" \
"$scratch/155865-48000.csv" "$scratch/155865-48000.raw"
Driver behavior
| Area | Scream Tracker 2.2 and 2.24 | Scream Tracker 2.3 |
|---|---|---|
| Tempo | 49 Hz base before applying the tempo adjustment. Headers and A commands before file version 2.21 store the two tempo digits in decimal. The first tick of an A row retains the old interval. | 50 Hz base with the same version-dependent encoding and counter reload order. |
| B and C | B stores the next order. C breaks at the end of the current row. A B command on its own waits for the end of the pattern. | Same flow. |
| D, E and F | Regular volume and period slides apply after tick zero. The low volume nibble takes precedence. Zero parameters are used directly. | Same directions, with pitch restoration and modulation reset on the native default branch. |
| G and H | Tone portamento and vibrato use their explicit parameters. | G00 and H00 recall separate parameters. 2.3 vibrato has half the 2.2 depth. |
| I | Tremor alternates its on and off counters starting on tick zero. | Same tremor counter. |
| J | Inactive in 2.2. In 2.24, the low nibble raises the note in the last three ticks, including the original B-note wrap. | Three-stage arpeggio, also with the original B-note wrap. |
| K and O | Inactive. | Combined vibrato and volume slide, or combined tone portamento and volume slide. The driver mutates the row parameter after recalling the pitch effect. |
| L, M and N | Reserved commands leave playback controls unchanged. | Reserved commands are handled by the default pitch restoration. |
| Sample and note state | Raw signed 8-bit sample data, instrument-only swaps, note cuts, one-shot ends and forward loops. 2.24 retains the active instrument tuning for subsequent notes. | Uses its own period table and retained sample tuning. A loop wraps before the wrapped frame is mixed. |
| Mono mix | The four voices use the unsigned 8-bit DAC accumulator. Stereo output repeats the mono waveform. | Same accumulator with the 2.3 sample cursor rules. |
The 2.24 and 2.3 references are st2play commits
f4cb10d
and 5af007e.
They match the later arpeggio and combined commands independently of the
master branch's earlier replay. The on-disk version byte cannot distinguish
the later drivers. The default stm.NewReplay uses the 2.2 profile for the
ranked comparison. stm.NewReplayWithDriver selects the later profiles.
Capture and compare the suite
The generated fixtures cover the order table layouts, decimal and nibble tempo, the B/C interaction, volume and pitch slides, effect parameter reuse, tremor, arpeggio, combined effects, sample swaps and loop playback. The offline Go tests cover format parsing, malformed data, the first tick of a tempo change, stereo duplication of the mono mix and seek reproducibility.
Build the headless runner against all three reference checkouts. Set
st2play, st224 and st23 to their source directories. The independent
OpenMPT runner is shared with the MOD and S3M corpus audits.
for source in "$st2play" "$st224" "$st23"; do
clang -O2 -Wall -I"$source" \
internal/test/tracker/stm-verification/reference/render-st2play.c \
"$source/stmload.c" "$source/st2play.c" -o "$scratch/render-$(basename "$source")"
done
clang -O2 internal/test/tracker/mod-verification/reference/render-openmpt.c \
$(pkg-config --cflags --libs libopenmpt) -o "$scratch/render-openmpt"
python3 internal/test/tracker/stm-verification/reference/generate-fixtures.py "$fixtures"
python3 internal/test/tracker/stm-verification/reference/capture.py \
--corpus "$corpus" --fixtures "$fixtures" --output "$captures" \
--st2play "$scratch/render-st2play" --st224 "$scratch/render-st224" \
--st23 "$scratch/render-st23" --openmpt "$scratch/render-openmpt"
CGO_ENABLED=0 go run ./internal/test/tracker/stm-verification \
-corpus "$corpus" -fixtures "$fixtures" -references "$captures" \
-demo "$scratch/preview"
The audit requires exact native tick positions and PCM through first-pass EOF. The same render must produce identical PCM and traces with read sizes of 113 and 1024 frames. OpenMPT provides an independent duration, row-flow and PCM comparison. See the measured results.
The demo renders a 20-second passage of The White Tiger starting at
26 seconds, plus the 2.24 arpeggio and 2.3 combined-slide fixtures. All
excerpts use 10 ms edge fades. The ranked preview exercises playback and
seeking. The companions make the driver-specific effects audible.
Earlier tracker, FM, PCM and rhythm demos remain available in
internal/test/tracker/ and internal/test/synth/.