Skip to content

Trackers and MOD files

In 1985 Commodore’s Amiga arrived with a sound chip called Paula. Paula could play four sounds at once, each an 8-bit sample read straight from memory, each at its own speed and volume, with no help from the computer’s processor. Two years later Karsten Obarski wrote Ultimate Soundtracker, a program for writing music with those four channels, and saved its songs in a file that held the samples and the score together: the module, or MOD.

The idea spread fast. NoiseTracker (1989) and then ProTracker (1990) refined it, and their format became the standard. The Amiga’s demoscene, where groups competed to make the most impressive real-time music and graphics, ran on MODs, and so did a lot of game music. When PCs got sound cards, the format went with them, and grew: Scream Tracker’s S3M, FastTracker 2’s XM and Impulse Tracker’s IT added channels, instruments and effects. Trackers are still made and used today.

A tracker doesn’t look like any other music software. There’s no staff of notes and no piano roll: the music is a table of text, read from the top down, and part of the fun of this page is learning to read it.

This page’s player follows ProTracker’s rules, and was written alongside jssynth, an open-source MOD and S3M player by this site’s author.

It leans on:

A tracker’s music is laid out in patterns: tables of 64 rows, one under another, with a column for each of the four channels. Time runs down the page. The player reads one row at a time, and on each row each channel can start a new note. A channel plays one sound at a time, so a new note on a channel cuts off the one before it.

Each cell has three parts. C-3 05 A04 means: play note C-3, with sample 5, and apply effect A04 (here, fade the volume down). Any part can be empty: --- -- A04 on the next row keeps the same note sounding and carries on fading it, and an empty cell leaves the channel alone.

Channels:

This page’s tune, in four patterns: drums on channel 1, bass on 2, chords on 3 and a tune on 4, about half a minute long, round and round. Play it and watch the pattern scroll past; the highlighted row is the one playing. Under each channel is its sound, as a waveform. Click a channel’s number (or its waveform) to mute it, or solo it to hear it alone. Sample numbers are blue and effects purple; the waveforms are blue for the channels on the left and orange for those on the right (section 6 explains).

Its six samples (a kick, a snare, a hi-hat and one cycle each of three waves) are made on this page, so nothing is downloaded.

Play channel 3 on its own. It sounds like a chord, but a channel can only play one note at a time. Its cells are an effect called arpeggio, which steps the note through the chord fifty times a second, faster than the ear can follow. That warbling chord is the sound of a lot of computer music: with only four channels to spare, it was the cheapest way to get three notes from one.

A MOD file is simple enough to read byte by byte. It starts with a fixed-size header: the song’s title (20 bytes), then 30 bytes for each of 31 samples (its name, length, volume, finetune, and where its loop starts and how long it is), then the order list: the patterns to play, in order, up to 128 of them. Byte 1,080 holds four letters, M.K., which say this is a 31-sample, four-channel file (the initials of NoiseTracker’s authors, Mahoney and Kaktus). Then come the patterns, then the samples themselves, as signed 8-bit numbers, one after another.

The patterns are 1 KB each: 64 rows × 4 channels × 4 bytes a cell. The number of patterns isn’t stored anywhere; a player works it out from the highest pattern number in the order list.

Top: this page’s tune, saved as a MOD: a 1,084-byte header, four 1 KB patterns, and 4,932 bytes of samples. Bottom: one of its patterns; click a cell (or use the arrow keys) to see its four bytes, and what each part means.

The cell’s bits are packed oddly: the sample number is split in two, its top four bits in front of the period and its bottom four after. That’s history. Ultimate Soundtracker had only 15 samples, so a sample number fitted in 4 bits, and the period’s two bytes had 4 bits spare. When NoiseTracker went to 31 samples it needed a fifth bit, and squeezed it into the spare ones. (Ultimate Soundtracker’s 15-sample files have a shorter header and no M.K.; the player in section 7 reads those too.)

Notice what a cell stores for a note: not its name but a number. A-2 is stored as 254. This is a period. Paula has a clock, and for each channel it counts the clock’s ticks, moving on to the sample’s next value every period ticks. So a smaller period plays the sample faster, and higher:

samples a second=Paula’s clockperiod\text{samples a second} = \frac{\text{Paula's clock}}{\text{period}}

On a European (PAL) Amiga the clock runs at 3,546,895 ticks a second. C-2 is period 428, so it plays a sample at 8,287 samples a second; a sample recorded at that rate plays at its own pitch on C-2. The tracker shows note names, but it looks them up in a table of periods, three octaves of them, from 856 (C-1) to 113 (B-3).

ProTracker’s 36 periods. A period has to be a whole number, so each note is rounded to the nearest one (orange): every note is within 5.9 cents of equal temperament. Rounding matters more at the top, because the periods are smaller: one step of the period moves the pitch by 2.0 cents at C-1, but 15.4 cents at B-3 (blue). Hear it plays the tune’s lead sample, one cycle of 32 samples, at the note chosen.

The finetune is set for each sample, from −8 to +7, in eighths of a semitone: ProTracker keeps sixteen versions of its table, one for each. It’s for tuning a sample that wasn’t recorded at quite the right rate.

The clock depends on where the Amiga was sold. American and Japanese (NTSC) machines ran theirs at 3,579,545 ticks a second, so the same MOD plays 15.9 cents sharp on one: try PAL, then NTSC. It’s why later trackers, written for PCs, tuned C-2 to 8,363 samples a second, the NTSC rate.

The player doesn’t run row by row but tick by tick, and a row lasts a whole number of ticks. Two numbers set the timing:

  • The speed is how many ticks a row lasts: six, unless the song says otherwise.
  • The tempo, in BPM, sets how long a tick is: 2.5/BPM2.5 / \text{BPM} seconds. At the usual 125 that’s 20 ms, fifty ticks a second, which is where it started: early trackers ran one tick for each frame of the PAL screen, which refreshes fifty times a second. (On an NTSC Amiga, whose screen refreshes sixty times a second, their songs played a fifth faster.) ProTracker added a timer so the tempo could be anything from 32 to 255.

At speed 6 and 125 BPM a row lasts 120 ms, and four rows (a usual beat) last 480 ms: 125 beats a minute, which is why the setting is called BPM. Change the speed and the rows change length, but the ticks don’t.

Top: four rows, each divided into its ticks. Bottom: the arpeggio from section 1 (037: the note, then 3 and 7 semitones up), which moves on once a tick, whatever the speed. At speed 3 it plays the chord once a row; at speed 6, twice. Play the page’s tune and change the speed and tempo while it runs.

Both are set from the pattern, with the effect Fxx: below 32 (hex 20) it sets the speed, and from 32 up the tempo. Some songs change the speed every row: alternating 5 and 7 gives a shuffle.

The trackers before ProTracker had no tempo to set, so to them every Fxx was a speed, and some songs written with them use F20 or more for a long, slow row. ProTracker reads that as a tempo, which then lasts: the rest of the song crawls. A song like that takes far longer to play through ProTracker’s way than the other, so the player in section 7 times it both ways when it opens a file, and plays it the way that makes sense (you can choose).

Effects are where the tracker’s sound comes from. Each is one hex digit, then a parameter of two more, written xy when it’s two numbers and xx when it’s one. The first tick of a row is special: that’s when notes start, and when one-off effects act; most others then act on each of the row’s other ticks. Some remember their last parameter, so 400 on the next row carries on a vibrato without restating it.

Choose an effect and its parameter, and see what it does to a note over four rows, tick by tick: its pitch (top, in semitones from the note on row 0) and its volume (bottom). Dashed lines are row boundaries; dots mark where the sample starts (or restarts). The four rows are listed below as a tracker would show them. Hear it plays them round and round.

The ones to try:

  • Pitch. 0xy arpeggio. 1xx and 2xx slide the period down or up by xx a tick: as periods are backwards, 1 slides the pitch up. 3xx slides to the cell’s note, at xx a tick, without restarting the sample (portamento). 4xy is vibrato, speed x, depth y. E1x and E2x are fine slides, which move the period once, on the first tick, for tiny changes.
  • Volume. Cxx sets it (0 to 64), Axy slides it up by x or down by y a tick, and 7xy is tremolo.
  • Timing. E9x restarts the note every x ticks (a quick drum roll on a single row), ECx cuts it on tick x, and EDx delays its start to tick x, which pushes a note slightly late, for swing.
  • The song. Bxx jumps to another position in the order list; Dxx ends the pattern early, starting the next one at row xx (written in decimal, oddly: D32 is row 32). E6x repeats rows, and EEx holds a row for longer.
  • The sample. 9xx starts the sample xx × 256 bytes in: one long sample can hold several sounds.

MODs played on an Amiga have a sound of their own, partly crunchy and partly muffled, and it comes from three things about the machine.

No interpolation. Paula holds each sample’s value until the next one: its output is a staircase. The pitch-shifting page shows what that does: the sound’s spectrum comes with copies of itself (images) around every multiple of the rate the sample is played at. Samples were kept at low rates to save memory, so those copies landed where you could hear them. Today’s MOD players usually interpolate, to smooth them away; some purists switch it off.

Filters. The Amiga 500 had a low-pass filter on its output that couldn’t be switched off, which softened the images; a second, steeper one, the LED filter, could be switched on and off by software, with the effect E0x. It got its name because the power light dimmed when it was off. On this page both are simple models, of the Amiga 500’s.

Hard stereo. Paula sent channels 1 and 4 to the left and 2 and 3 to the right, with nothing in between: on headphones, a drum on the left and a bass on the right can sound like two separate songs. Players offer stereo separation, which mixes some of each side into the other.

Top: the spectrum of a note of the tune’s lead sample, played as the options say (orange), and the filters’ responses (dashed). The grey lines mark the sample rate and its multiples, where the copies sit. Played on A-1, with no interpolation and no filter, the first copies are 29 dB below the note; linear interpolation puts them 49 dB below. The Amiga 500’s filter takes 7.1 dB off at 10 kHz, and the LED filter 22.4 dB. Bottom: how much of each channel goes to each side: at 100% separation, it’s all one or the other.

Here’s the player again, with everything: open a MOD of your own (it stays in your browser; nothing is uploaded), download this page’s tune as a MOD to open in any other player or tracker, mute and solo channels, and choose how it should sound. The Mod Archive has many thousands of MODs to try.

Channels:

    Open a .mod file (or drop one on the figure). Four-channel MODs, the 15-sample Soundtracker files, and the multichannel ones from PC trackers (six or eight channels, say) all play; the other formats, such as S3M and XM, don’t. The samples: click one to hear it on C-2. Since a MOD has no other place for text, musicians often used the sample names to write messages, greetings and credits, and they’re shown as they are.

    And here is a tracker to write in. It starts with this page’s tune; change it, or start empty. Your song is kept in this browser, so it’s still here when you come back, but download it to keep it for good, or to open in another tracker.

    With the pattern clicked: Space edit on/off · arrows move (Shift picks out a block) · notes on Z–M and Q–P (sharps on the row above each) · hex digits for samples and effects · Delete clears · Enter plays the pattern from the cursor (Shift+Enter: the song) · Tab next channel · copy, cut, paste and undo with Ctrl (⌘ on a Mac) and C, X, V, Z. Away from the pattern, the computer’s keys play the keyboard above, as on the other pages.

    Click the pattern to use the keys. Press the space bar to start editing (the pattern gets an orange border), and type notes on the computer’s keys: the bottom row of letters, Z to M, is one octave, and Q to P the next, with the sharps on the rows above each, just as ProTracker laid them out. Each note uses the sample chosen, and the cursor moves down by the step. Move right into the sample and effect columns to type hex digits: A, 0, 4 fills in an effect, then moves down. The on-screen keyboard and a MIDI keyboard enter notes too.

    Pattern loops the pattern you’re editing; Song plays the order list (type pattern numbers into it, separated by spaces). You can edit while it plays. Your own sound opens a sound file into the chosen sample: it’s turned into 8 bits at 8,287 samples a second, so it plays at its own pitch on C-2.

    • The Amiga’s Paula played four channels of 8-bit samples, each at its own rate and volume; the tracker was made to write music for them, and the MOD file holds a song’s samples and score together.
    • A song is patterns of 64 rows by 4 channels, played in the order the order list gives. Each cell has a note, a sample and an effect, packed into 4 bytes.
    • Notes are stored as periods: Paula plays a sample at its clock divided by the period. Whole-number periods put every note within 5.9 cents, but the steps are coarse at the top; NTSC machines play 15.9 cents sharp.
    • Time runs in ticks (2.5 ÷ BPM seconds), and a row lasts speed ticks. Notes start on a row’s first tick, and most effects act on the rest.
    • Effects (arpeggio, slides, vibrato, volume slides, retriggers, cuts, delays, jumps) give a tracker its sound and its tricks.
    • The Amiga’s own sound: no interpolation, so images of the sound; a fixed filter and a switchable LED filter; and hard stereo.
    • Amiga Hardware Reference Manual (Commodore-Amiga, Addison-Wesley, 3rd edition 1991): Paula’s audio channels, periods and the filters.
    • pt2-clone, Olav Sørensen’s faithful recreation of ProTracker 2: its source is the reference for exactly how ProTracker plays a MOD.
    • OpenMPT’s wiki, on the MOD format and the differences between its players.
    • The Mod Archive, a collection of modules of every kind, with their licences.
    • jssynth, the MOD and S3M player this page’s was written alongside.