mtm-verification

command
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MultiTracker verification

The default MTM replay runs the Renaissance row effects and a 32-voice Gravis UltraSound mix. The OpenMPT timing mode uses a software PCM mix and matches OpenMPT's speed and tempo policy. Both run through the shared Go tracker clock and player. Use the OpenMPT profile for modules with fewer than 64 rows per pattern. Renaissance MultiTracker 1.01b accepted the 64-row control file and rejected the 8- and 32-row layouts tested. OpenMPT uses the row count from the header and reads each track in a fixed 192-byte stride. OpenMPT MTM loader

Input modules

corpus.json pins the ten highest-download MTMs from the 2026-11-28 Mod Archive format-filtered catalog. The overall chart does not contain all ten entries. The snapshot enumerated 415 MTMs, ranked by download count descending and archive ID ascending. Download each source under its archive ID, such as 40680.mtm. The verifier checks the file signature and SHA-256 before rendering.

fixtures.json pins the output of generate-fixtures.py and Digital Harmonics, the example supplied with MultiTracker 1.01b. The generated modules use original PCM and the traditional round Frere Jacques. Extract HARMNICS.MTM from the editor archive as harmonics.mtm beside the generated fixtures.

Fixture Behavior checked
harmonics.mtm The original example exercises 12 channels, initial panning and dense rows with several simultaneous note starts.
timing.mtm F03, F06, F7D and F96. The original editor uses the last channel's Fxx command and retains the first two timer intervals on a speed or tempo change. OpenMPT keeps paired speed and tempo independent on the command row.
clock-sweep.mtm All 255 nonzero Fxx values on rows with alternating octave notes. Compare row progression and the resulting PCM at both rates.
reuse-offset-loops.mtm A single track drives two channels and is reused in another pattern. Sample starts exercise Renaissance's byte offsets and zero-offset 900, OpenMPT's decoded-frame offsets and 900 memory, loop wrap, volume cut and single-tick retrigger.
frere-jacques.mtm Arpeggio, pitch slides, portamento, vibrato, combined pitch and gain commands, tremolo, panning, sample offset, volume slide, pattern break and jump. The accompaniment also exercises E1, E2, E5, E8, E9, EA, EB, EC, ED and EE. The editor includes the command row in the EE delay count.
pan-sweep.mtm All sixteen E8x balance positions on one sustained sample at two volume levels. Check the settled stereo levels and the first-pass row trace.
volume-sweep.mtm All 65 Cxx volume values with a constant source level. Check the settled gain and the initial ramp.
pitch-signed.mtm, pitch-sweep.mtm All 63 encoded notes with every raw finetune from -8 through 15. The reference is the 16-bit value written to GF1 register 1 at note start.
pitch-effects.mtm GF1 frequency writes for arpeggio, vibrato, tone portamento, regular slides at two octaves and fine slides.
low-slide.mtm Long downward slides at two pitches and alternating 20F with 502 before any 3xx sets the portamento speed. The 502 rows use the default increment of 1/256 of a period.
modulation-memory.mtm Vibrato phase across an empty row, a note restart, and a move to tone portamento. Tremolo holds its last volume when the command ends and preserves phase across a retrigger within the effect. A separate track exercises repeated pitch slides.
OpenMPT effect memory regression A 600 row recalls the earlier 480 parameter, and 500 recalls A02. A 1xx row after an arpeggio slides from the last arpeggiated pitch. The stereo PCM checks cover both rates.
porta-target-memory.mtm, porta-command-memory.mtm GF1 frequency, gain and sample starts when 3xx and 5xy reuse a target, change instruments, or run on a channel with no pitch.
finetune-memory.mtm E5x writes the raw unsigned finetune to the sample. Renaissance requires an explicit instrument. OpenMPT requires a note and can use its previously selected sample. Earlier channels use the preceding value and later channels selecting the sample use the new value. Restart restores the sample header.
instrument-memory.mtm In Renaissance, instrument-only changes restart the sample at the current pitch, and EDx updates pitch on the effect tick after the delayed start. In OpenMPT, a sample number alone changes the volume and queues the sample for a later note. EDx starts an explicit note immediately and retriggers on tick x. A 9xx without a note moves the active sample cursor.
sample-polarity.mtm, polarity-16bit.mtm Constant 8- and 16-bit source samples check uploaded GF1 bytes, polarity, the attack ramp and the level before the first effect tick.
adjacent-negative.mtm, adjacent-positive.mtm An identical one-shot followed in GF1 sample RAM by an unused sample of opposite polarity. The next slot changes the one-shot's last interpolated samples.
short-patterns.mtm Two eight-row orders. OpenMPT skips cells encoded after row seven in the fixed 64-cell tracks. Renaissance rejects the layout when loading.
bad-track-reference.mtm, short-sample.mtm The parser rejects a nonexistent track and truncated sample data.
Go parser tests An eight-row header with 64 encoded cells per track, reusable track references, unsigned sample encoding, signed finetune and bounds checks.

The original editor's GUS driver reserves 8xx, E0x, E3x, E4x, E6x, E7x, and EFx. E8x sets panning with a four-bit value. The timing fixture tests simultaneous Fxx commands in both channel orders.

References and renders

The native executable is Renaissance MultiTracker Module Editor 1.01b (MMEDIT.EXE, SHA-256 535590551628e15e2f2ac1bb1f3d36fffc3230d7868e83a3cd63692a2571ac2b) from the original archive. The capture configuration uses DOSBox Staging 0.83.1 (8888e), GUS base 240h, IRQ 7 and DMA 3. The editor activates 32 voices. Disable mixer effects and the GUS analog output filter for comparisons. QEMU runs the editor, but its audio-callback-driven GUS timer produced markedly different timing on the same fixture.

Register traces show what the original editor writes under the emulated timer and IRQ behavior. The direct chip capture measures the resulting digital mix from Staging's GF1 model. Hardware parity requires additional captures from the same editor on a DOS PC with a physical GF1 card, such as a GUS Classic. A stereo line-out capture also includes the card's DAC and analog filter. Keep those measurements separate from the digital mix. The 86Box cross-check uses the same editor and fixtures on a separate emulated DOS PC.

In the editor, GF1 timer 1 advances effects every 20.08 ms. Timer 2 advances rows after 16 interrupts. Its count is ceil(2930 / BPM) in 320 microsecond units. A speed command derives BPM from integer division of 750 by the speed. The GF1 trace showed that the first two timer 2 intervals on a command row retain the previous count. When both timer IRQ flags are pending, the editor services timer 2 and clears both flags. Each source sample is uploaded as the complemented high byte of the decoded signed PCM. GUS offsets count those 8-bit samples. The editor starts each note from zero with a GF1 volume increment of 63 per chip frame up to the eight-bit ramp end register. Section 2.22 describes the hardware ramp. Gravis UltraSound Lowlevel ToolKit 2.22

The GUS driver stores a 32-bit rate. It applies a signed finetune to the semitone table before shifting by octave. The adjacent-note difference is divided by seven for positive values and eight for negative values. The driver divides the shifted rate by 63 when writing GF1 register 1. Slides convert to and from integer periods in units of 1/256, truncating at both steps. E1x and E2x use the full parameter byte as the period delta.

The OpenMPT reference is libopenmpt 0.8.10+r25841.pkg. Use the shared reference renderer with linear interpolation, gain 0 mB, no dither, stereo S16LE and playback stopping at the end of the first pass. Name reference pairs <archive ID>.mtm-<rate>.csv and <archive ID>.mtm-<rate>.raw. For the generated suite, use the fixture's basename in place of the ID. Run at 44.1 and 48 kHz.

The software profile uses the reference's linear stereo split and a mix gain of 3/8. Initial panning comes from the midpoint of the encoded pan step. E8x spans the full range, including hard left and hard right. The software profile uses the FastTracker 2 Amiga period table with one table step per eighth of a semitone. Slides use quarter MOD periods. The period-to-frequency division retains four fractional bits before conversion to the shared synth rate. The playback regression checks PCM before and after regular and fine slides on a negatively finetuned note. Vibrato samples a 64-step sine at the stored phase and applies the signed delta in quarter periods. On the first tick of 4xy or 6xy it uses the current phase. Later ticks advance the phase after sampling it. Test captures cover 4xy, parameter memory, 6xy, a row without vibrato, and a fresh note. OpenMPT MTM loader OpenMPT panning implementation

python3 internal/test/tracker/mtm-verification/reference/generate-fixtures.py "$fixtures"
unzip -p "$mtm_archive" HARMNICS.MTM > "$fixtures/harmonics.mtm"
CGO_ENABLED=0 go run ./internal/test/tracker/mtm-verification \
    -modules "$modules" -fixtures "$fixtures" -openmpt "$openmpt" -demo "$preview"

The Go audit compares exact PCM digests and tick traces at read sizes 113 and 1024. Each pass ends at EOF or the first return to a previously played order and row. The latter lets the audit compare one traversal of a song loop, as in aw_tragc.mtm. The command prints reference duration, row progression and PCM error. The preview command renders FALL1.MTM and the companions at both rates with short edge fades. To play the ranked excerpt without preparing the references, render it directly to a WAV.

CGO_ENABLED=0 go run ./internal/test/tracker/mtm-verification \
    -modules "$modules" -out "$preview/one-must-fall-1.wav"
Demo coverage
Feature Public API Passage and check
Ranked multichannel playback and seeking mtm.Parse, mtm.NewReplay, tracker.NewReplayPlayer, SeekTime, ReadFrames one-must-fall-1 plays a 24-second section starting 16 seconds into the first ranked track. The WAV gate checks stereo signal and clipping. The audit checks the first pass and reference row progression.
Note and effects playback mtm.NewReplay with RenaissanceGUS frere-jacques plays a pitched lead over a looped bass and percussive one-shots. The accompaniment slides, modulates, pans and retriggers, with a pattern break at each phrase. The WAV gate checks the opening three notes. The fixtures above check effect timing, finetune, register values and flow.
Track reuse, sample encodings, offsets and cut mtm.Parse, ReadFrames track-reuse-and-offsets plays the reused track at opposite pans as it switches from an 8-bit tone to a 16-bit bass and cuts. The WAV gate measures the offset tone, checks that both channels play the same samples in the sustained portion, and checks silence after the cut. The full fixture also checks reuse in another pattern.
Paired speed and tempo commands mtm.NewReplay with RenaissanceGUS and OpenMPT Compare renaissance-timing and openmpt-timing. The octave changes land at different times. The WAV gate measures the notes at two points where the profiles disagree. The audit compares both profiles with the pinned references.
Short patterns mtm.Parse, mtm.NewReplay with OpenMPT short-patterns moves up an octave at the second order after eight rows. The WAV gate checks the pitches on both sides of the order boundary.
Earlier synth and tracker features See the module replay checklist and authored demo checklist. Korobeiniki covers FM, pitched and file-backed PCM, 808-style and 909-style one-shots, envelopes, pattern editing and sequencing. The module replay command includes the earlier native-format passages.
Earlier S3M device and STM timing profiles See the S3M demos and STM demos. S3M companions cover AdLib key-on and key-off, portamento and mixed AdLib and PCM retrigger. STM companions cover the 2.24 arpeggio and 2.3 combined slide.

The WAV checks run at read sizes 113 and 1024. The two renders must match byte for byte at each sample rate.

Capture the original editor

Use capture-staging.py with the pinned DOSBox Staging executable, original MMEDIT.EXE, and the 87-byte MMEDIT.CFG from the original setup utility. Select Gravis UltraSound, port 240h, IRQ 7, and leave the module and sample directories blank. The resulting config SHA-256 is c44cd411a668820719f002d8f6ed8ea579fd3f30c6ce97dca2e84407010f928b.

The reference patch adds optional taps before the SDL output and before GF1 resampling. It also logs timer and register writes when requested. Apply the zero-context patch with git apply --unidiff-zero to the DOSBox Staging v0.83.1 source archive (SHA-256 14c3703369e56125a425aea8ebb1a425823df58f9769f3e48b1b8ebbf2c6cf09). The emulator and its patch are separate verification tools under the upstream GPL-2.0-or-later license.

For the Apple Silicon Meson build, create the absent resources/shaders/misc directory in the reference source and place the build directory deep enough that Meson's bundle resources stay under the task directory. The reference build uses the normal CPU core, the SDL dummy backend, and disables the dynamic core. With the instrumented binary, pass --instrumented and use --trace-io for register writes, timer expiries, IRQ status and the first 16 bytes of the sample at voice start. Pass --gf1 for the direct chip stream and a second stream indexed by emulator time. The automation uses the emulator's loopback API to enter playback keys and sample screen positions. Add --trace-position to log MTMPOS observations in staging.log on the emulator's millisecond clock. Use --emulated-rows with align-captures.py --clocked-gf1 to use those observations for row coverage. The display advances to the next position as the current row sounds. Its timestamps are approximate. Use GF1 register timestamps for audio event timing.

Use --clocked-gf1 for PCM comparisons. This capture advances the existing Staging GF1 mixer to the current emulated clock before register writes and at periodic callbacks. It writes chip-exact.wav and the raw chip stream before host queuing. Pass the same flag to align-captures.py to convert that stream to the requested sample rate with FFmpeg and align it. The capture uses the repeated-position stop rule, with limited precision at the endpoint due to screen polling.

Add --fractional-gf1-clock to the clocked capture to use the nominal GF1 clock rate from the Gravis SDK. The editor's 32 active voices yield 44,100 times 14 divided by 32, or 19,293.75 Hz. The convenience WAV uses an integer header rate of 19,294 Hz. The aligner uses the exact rate from the capture log when resampling the raw stream.

For the documented GF1 pitch behavior, add --mask-frequency-bit. Staging defaults to rounding an odd frequency write up. The Gravis SDK specifies bit 0 as unused. This option ignores the bit while retaining the original editor's writes. Gravis UltraSound Lowlevel ToolKit, section 2.6.2.2

Add the optional --per-frame-stop flag to a clocked capture to check voice stops on every GF1 frame. Stock Staging can keep mixing a stopped voice until the end of its current render batch. Keep the two captures separately so this emulator difference is visible. The alternate mode uses the same register and timer behavior as the regular clocked capture.

Add --gf1-pan-law to apply the sixteen GF1-compatible balance offsets before Staging converts the logarithmic volume to PCM. This uses the offsets in table 7-7 and keeps Staging's volume conversion and timing. AMD InterWave Programmer's Guide

For a measured comparison, render Go output with -go-pcm "$go_pcm". Then run align-captures.py on the instrumented capture directories and pass its output as -native. Alignment uses the first sample above -54 dBFS and retains the observed first-pass endpoint. The editor's screen sampler can miss rows under load. Use register timestamps for exact timing claims and treat screen timestamps as approximate. Capture Deep Marble with --follow-wrap to retain the final long pattern delay after the display wraps. Emulator mix and resampling differences can affect PCM even when order flow agrees.

The openmpt_only fixture in the manifest needs OpenMPT captures at both rates. To repeat the Renaissance row-count check, set byte offset 32 of short-patterns.mtm to 32 and 64 in separate copies and load all three in the original editor. The 64-row control leaves every other byte intact.

Documentation

Overview

Command mtm-verification compares the ranked corpus with pinned playback references.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL