A module holds no timeline and no recorded mix. A player builds the sound as it goes: it steps through the positions of the order table, plays each pattern’s rows one after another, and on every tick updates the four voices. The rules below are ProTracker 2.3D’s, which is what most modules were written for.
Timing
Time is counted in ticks. A row lasts speed ticks, 6 at the start of
every song, and the length of a tick comes from the tempo, 125 at the
start. Both are changed with the Fxx
effect: 1 to 31 sets the speed, 32 to 255 the tempo.
ProTracker counts ticks with the Amiga’s CIA timer, which runs at 709,379 Hz on a PAL Amiga. For a tempo of bpm it sets the timer to 1,773,447 / bpm counts, so
tick = (1,773,447 / bpm) / 709,379 seconds (about 2.5 / bpm)
row = speed × tick
| Tempo | Speed | Tick | Row | Pattern of 64 rows |
|---|---|---|---|---|
| 125 | 6 | 20 ms | 0.12 s | 7.68 s |
| 125 | 3 | 20 ms | 0.06 s | 3.84 s |
| 150 | 6 | 16.7 ms | 0.10 s | 6.4 s |
At the defaults that is 50 ticks a second, the rate of a PAL screen. Players that count ticks on the screen’s vertical blank instead of the CIA timer get 50 ticks a second on a PAL Amiga and 60 on an NTSC one, so they play a module faster on an NTSC machine, and cannot follow a tempo change.
What happens on a tick
- On tick 0 of a row, each channel reads its cell. A sample number loads that sample’s volume, finetune and loop; a note looks up its period and restarts the sample, unless the effect is a tone portamento or a note delay; and the effects that act on tick 0 run.
- The voices that were given a new note start, and their loop is set ready to take over at the end of what they play first.
- On ticks 1 to speed − 1, the effects that act on ticks run: slides, vibrato, arpeggio, retrigger, note cut, note delay.
- After the last tick the next row starts, or the row is held again by a pattern delay (EEx).
Song flow
Positions are played in order, from 0 to song length − 1, each playing the pattern the order table names from its first row. The next position starts at the end of the pattern, or after a row with a pattern break (Dxy, which also chooses the row to start at) or a position jump (Bxx, which chooses the position). A pattern loop (E6x) repeats rows within a pattern.
After the last position ProTracker goes back to position 0 and plays on; NoiseTracker goes back to its restart position. Most players stop at the end of the order list instead, or when a jump would play again what has already been played. F00 stops the song. In the files examined for this site, most play to the end of the order list, several end with a jump back to an earlier position, and a few stop with F00.
The Amiga’s voices
Paula, the Amiga’s sound chip, has four voices, one for each channel of the module. Each voice reads sample bytes from memory by DMA, holding each byte for the number of colour clock cycles the period gives, and has two registers: where to read from and how many words. Starting a voice latches the two registers; while the voice plays, ProTracker writes the loop into them, and the voice loads them again each time it reaches the end of what it latched. That is how the loop rules come about:
- The first pass plays from the start of the sample, for its length, or to the end of the loop when the loop start is not 0.
- Every pass after that plays the loop.
- With a loop length of 1, the “loop” is the sample’s first two bytes, played over and over. They are 0 by convention, so the voice is silent.
A sample number given without a note works through the same registers: the volume changes at once, the new sample’s loop goes into the registers, and it takes over when the sample that is playing reaches its end.
Stereo
Paula sends channels 1 and 4 to the left output and channels 2 and 3 to the right, with no panning in between. Amiga modules are written for that hard separation. Many players on other computers mix part of each side into the other, which is softer on headphones.
The Amiga also filters its output: a fixed low-pass filter on the A500, and a second one that E0x switches, called the LED filter because the power light dims with it.
In the explorer
The explorer’s player follows ProTracker 2.3D’s replay routine step by step, as the
ProTracker 2 clone reproduces it, with its quirks (see
Effects). It models the voices
as Paula’s, holding each sample byte for its period and averaging over each output
sample, and pans the channels hard left and right in the Amiga’s order. It models
E00 and E01 with a two-pole low-pass at about 3.3 kHz, the Amiga’s LED filter, which
starts off, but not the Amiga’s fixed filter or NTSC timing. It plays the song once,
to the end of the order list, a jump back, or F00, at 44.1 kHz, or at a lower rate for
a very long song. E8x is ignored, as it is in ProTracker 2.3D.
Four options above the viewer change how the song is heard; none of them is in the file. Amiga filter: as the module sets it with E00 and E01 (the default), always on, or always off. Stereo separation: 100 % is Paula’s hard left and right (the default), 0 % is mono, and between the two part of each side is mixed into the other. Tempo change: by the module (the default: ProTracker’s CIA timer takes a new tempo one tick late, and so does OpenMPT for these files; PC trackers’ multichannel files take it at once), always one tick late, or at once. Resampling: Paula’s way (each byte held for its period and averaged over the output sample, the default), the nearest byte, or a straight line between neighbouring bytes.
The player was checked against libopenmpt 0.8.9 (openmpt123, Amiga
resampler without its filter, no volume ramping, hard panning), after fitting one
gain to each file and allowing a shift of a few frames. Small built modules, one
effect at a time (arpeggio, the slides, tone portamento, vibrato in its three waves,
volume slides, sample offset, finetune, note cut and delay, fine slides, funk repeat,
glissando, pattern break, speed and tempo changes, the volume commands), agree to 24
to 40 dB signal-to-error; tremolo (17 to 19 dB, 12 dB with the square wave), a
pattern loop (12 dB), retrigger (14 dB) and a sample with no loop (18 dB) agree less,
and why is not known. In 197 real modules (the first 20 seconds of each) the
median is 17 dB as played and 26 dB after both outputs are smoothed over 24 frames,
which takes out the one-frame differences in where each player puts the steps of a
low-rate sample; 25 files reach 25 dB as played and 108 after smoothing. 26 of the
197 files, at 3 dB or less after smoothing, disagree completely from the start, among them 8-channel files that begin with
notes at volume 0 and Soundtracker files; the cause is not known. OpenMPT gives
every tick a whole number of frames, where the explorer carries the fraction, so
songs at other than 125 BPM drift a little against it (the test rounds the ticks).