The MTM File Format


Original Documentation

The MTM format is generated by the Multi Track Module tracker by the demo group
Renaissance. The tracker features up to 32 channel digital music. Instead of
saving whole patterns, the tracker only saves the different tracks and the data
which tracks should be played together at which time, thus saving some pattern
space.

OFFSET              Count TYPE   Description
0000h                   3 char   ID='MTM'
0003h                   1 byte   Version data
								   upper nibble is major version number
								   lower nibble is minor version number
0004h                  20 char   ASCIIZ song name
0018h                   1 word   Number of saved tracks.
								 ="NOT"
001Ah                   1 byte   Highest pattern number saved
								 ="NOP"
001Bh                   1 byte   Last order number to play(=Songlength-1)
001Ch                   1 word   Length of extra comment field in bytes
								 ="XSZ"
001Eh                   1 byte   Number of samples
								 ="NOS"
001Fh                   1 byte   Attribute byte (currently defined as 0)
0020h                   1 byte   Beats per track
0021h                   1 byte   Number of tracks
0022h                  32 byte   Pan positions of the voices
								 (0=left, 15=right??)
0042h               "NOS" rec    Instrument data
					   22 char   Sample name
						1 dword  Sample length in bytes
						1 dword  Start of sample loop in bytes
						1 dword  End of sample loop in bytes
						1 byte   Fine tune value for sample
						1 byte   Default volume for sample
						1 byte   Attribute byte, bit mapped
								   0 0=8 bit sample,1=16 bit sample
								 1-7 undefined (set to zero)
0042h+                128 byte   Pattern order data
 "NOS"*37
01C2h+
 "NOS"*37           "NOT" rec    Track data
								 Each track is saved independently and has
								 the size of exactly 192 bytes. Each track
								 is arranged as 64 3-byte notes with the
								 following format :
					 64*3 byte            BYTE 0   BYTE 1   BYTE 2
										 ppppppii iiiieeee aaaaaaaa
								 p = pitch value (0=no pitch stated)
								 i = instrument number (0=no instrument number)
								 e = effect number
								 a = effect argument
								 The effects are the standard Protracker
								 effects.
01C2h+       ("NOP"+1)*32 word   Track sequencing data
 "NOS"*37+                       This is the list of which track is used
 "NOT"*192                       as which voice in each pattern. One track
								 can be part of many patterns, the drums
								 for example.
								 Track 0 is never saved but is always
								 considered as an empty track. That means
								 that counting really starts at one.
								 The data is organized in sets of 32 voices.
								 The first word contains the information which
								 track is used in pattern 0, voice 0. The next
								 word is for pattern 0, voice 1, etc., this
								 is repeated for each pattern, 32 words for each
								 saved pattern.
01C2h+              "XSZ" char   Extra comment field. This contains some
 "NOS"*37+                       message or something.
 "NOT"*192+
 ("NOP"+1)*32*2
01C2h+                  ? byte   Raw sample data(unsigned).
 "NOS"*37+
 "NOT"*192+
 ("NOP"+1)*32*2+
 "XSZ"
EXTENSION:MTM
SEE ALSO:MOD
OCCURENCES:PC
PROGRAMS:MMEDIT,DMP
VALIDATION:

This information is from Corion.net and is used with permission.

More Resources