MOD (file format) explained

MOD
Extension:.mod
Mime:audio/mod, audio/x-mod
Magic:4 bytes "M.K." at offset 0x438
Owner:Karsten "Obi" Obarski
Genre:Video/music
Released:1987
Extended To:XM

MOD is a computer file format used primarily to represent music, and was the first module file format. MOD files use the “.MOD” file extension, except on the Amiga which doesn't rely on filename extensions; instead, it reads a file's header to determine filetype. A MOD file contains a set of instruments in the form of samples, a number of patterns indicating how and when the samples are to be played, and a list of what patterns to play in what order.

History

The first version of the format was created by Karsten Obarski for use in the Ultimate Soundtracker, tracker software released for the Amiga computer in 1987.[1] [2] The format has since been supported by hundreds of playback programs and dozens of other trackers.[3]

The original version of the MOD format featured four channels of simultaneous audio playback, corresponding to the capabilities of the original Amiga chipset, and up to 15 instruments.

Later variations of the format have extended this to up to 32 channels and 31 instruments.

The format was designed to be directly playable on the Amiga without additional processing: for example, samples are stored in 8-bit PCM format ready to be played on the Amiga DACs, and pattern data is not packed. Playback required very little CPU time on an Amiga, and many games used MOD files for their background music.

A common misconception is that the magic number "M.K." in the 0x438 offset of MOD files are the initials of Mahoney and Kaktus, two prominent Amiga demomakers at the time, who played an important part in the popularity of the format. They in fact stand for the initials of Michael Kleps a.k.a. Unknown / DOC, another developer of the format.[4]

After the Amiga's production ceased, the MOD format has had continued popularity in the Demoscene and as background music for independent video games and Chiptunes. It is not uncommon to hear MOD music in keygens either.

Format overview

A pattern is typically represented in a sequencer user interface as a table with one column per channel, thus having four columns – one for each Amiga hardware channel. Each column has 64 rows.

A cell in the table can cause one of several actions to happen on its column's channel when its row's time is reached:

An instrument is a single sample along with an optional indication of which portion of the sample can be repeated to hold a sustained note.

Timing

In the original MOD file the minimum time frame was 0.02 seconds, or a "vertical blanking" (VSync) interval, because the original software used the VSync timing of the monitor running at 50 Hz (for PAL) or 60 Hz (for NTSC) for timing.

The rate at which pattern data is played is defined by a speed setting. Each row in the pattern data lasts one vertical blanking (or 0.02 seconds) times the current speed setting. The speed setting varied from 1 to 255.In later versions of the format, the vertical blanking was replaced with an adjustable time period staying in the range [0.01, 0.078] seconds. The old speed setting command was replaced with a new one that was used to change both the old speed setting and the new adjustable time period. Unfortunately, some of the old functionality was broken, because the new speed setting command had an identical code value to the old command. Values in the range [1, 31] were interpreted as the old speed settings, but other values were regarded as modifications to the adjustable time period. Hence, values in the range [32, 255] used in some old songs broke in new versions of the player.

Further information on the MOD format can be found at the alt.binaries.sounds.mods FAQ.[5]

Other formats that use the MOD extension

MOD is the file extension for several other applications:

See also

External links

Notes and References

  1. Endless loop: A brief history of chiptunes. Driscoll, Kevin . Diaz, Joshua . amp . 10.3983/twc.2009.0096 . Most importantly, Soundtracker provided an environment in which nonprogrammers could access the sophisticated music tools in their home computers without needing to learn a programming language.. 2009. Transformative Works and Cultures . 2 . 2011-02-13. free.
  2. http://www.soundtracker.org/ www.soundtracker.org
  3. Book: Sweet , Michael . Writing Interactive Music for Video Games . Addison-Wesley . 2014 . 978-0-321-96158-7 . 272–273.
  4. Web site: Ultimate Soundtracker module format description . https://web.archive.org/web/20100921225940/http://io.debian.net/~tar/debian/xmp/xmp-2.7.1/docs/formats/Ultimate_Soundtracker-format.txt . 2010-09-21 . 2014-07-02., by Michael Schwendt, 1997; distributed in the source of the xmp module player; published at io.debian.net
  5. Web site: The alt.binaries.sounds.mods FAQ on the MOD format . 2020-04-15.
  6. Web site: Fortran Programs with Modules.