home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / mtm101b.zip / FORMAT.DOC < prev    next >
Text File  |  1993-11-13  |  4KB  |  90 lines

  1. The following is a summary of the MultiTracker Module (MTM) fromat.  It is
  2. intended for programmers who wish to support the format in any manner.  Note
  3. that all effects are defined as the current Protracker effects standard. A
  4. short summary of this standard is provided in the documentation file for the
  5. Multitracker Module Editor.
  6.  
  7. ────────┬──────┬───────────────────────────────────────────────────────────────
  8. Position│Length│Description
  9. ────────┼──────┼───────────────────────────────────────────────────────────────
  10. 0       │3     │"MTM" file marker
  11. 3       │BYTE  │version number - upper nybble is major version #, lower is
  12.     │      │                 minor version number
  13. 4       │20    │ASCIIZ songname
  14. 24      │WORD  │number of tracks saved
  15. 26      │BYTE  │last pattern number saved
  16. 27      │BYTE  │last order number to play (songlength-1)
  17. 28      │WORD  │length of extra comment field
  18. 30      │BYTE  │number of samples saved (NOS)
  19. 31      │BYTE  │attribute byte (currently defined as 0)
  20. 32      │BYTE  │beats per track
  21. 33      │BYTE  │number of tracks to be played back
  22. 34      │32    │voice pan positions
  23. ────────┼──────┼───────────────────────────────────────────────────────────────
  24. 66      │NOS*37│Instrument data:
  25. ────────┼──────┼───────────────────────────────────────────────────────────────
  26.     │22    │sample name
  27.     │DWORD │sample length in bytes
  28.     │DWORD │offset of beginning of sample loop in bytes
  29.     │DWORD │offset of end of sample loop in bytes
  30.     │BYTE  │finetune value
  31.     │BYTE  │standard volume of sample
  32.     │BYTE  │attribute byte: bit meaning
  33.     │      │                0   0=8 bit sample 1=16 bit sample
  34.     │      │                1-7 undefined (set to zero)
  35. ────────┼──────┼───────────────────────────────────────────────────────────────
  36. 66+     │128   │Pattern order data
  37. (NOS*37)│      │
  38. ────────┼──────┼───────────────────────────────────────────────────────────────
  39. 194+    │trks* │Track data:
  40. (NOS*37)│192   │Each track is saved independently and takes exactly 192 bytes.
  41.     │      │The tracks are arranged as 64 consecutive 3-byte notes.  These
  42.     │      │notes have the following format:
  43.     │      │
  44.     │      │
  45.     │      │  BYTE 0   BYTE 1   BYTE 2
  46.     │      │ ppppppii iiiieeee aaaaaaaa
  47.     │      │
  48.     │      │ p = pitch value (0=no pitch stated)
  49.     │      │ i = instrument number (0=no instrument number)
  50.     │      │ e = effect number
  51.     │      │ a = effect argument
  52.     │      │
  53. ────────┼──────┼───────────────────────────────────────────────────────────────
  54. 194+    │      │Track sequencing data
  55. NOS*37+ │      └──────────────────────────┐
  56. trks*192│(last pattern saved + 1)*32 WORDS│
  57. ────────┼──────┬──────────────────────────┘
  58.     │      │The track sequencing data is really just a listing of which
  59.     │      │track is used as which voice in each saved pattern.  This is
  60.     │      │necessary since one track may be a part of many different
  61.     │      │patterns. (not orders)  Doing this saves much of the memory
  62.     │      │wasted in a normal MOD by repetition of certain tracks over
  63.     │      │and over again throughout the file.
  64.     │      │
  65.     │      │Note that track zero is never saved, but always considered as
  66.     │      │an empty track.  Therefore, track numbering for the saved
  67.     │      │tracks really starts at one.
  68.     │      │
  69.     │      │The data is organized in sets of 32 voices.  First comes a
  70.     │      │WORD representing which track is in pattern 0, voice 0.  The
  71.     │      │next WORD is pattern 0, voice 1, etc.  This is repeated for
  72.     │      │each pattern saved, giving a total track sequencing size of
  73.     │      │32 WORDS per pattern saved.
  74.     │      │
  75.     │      │If your code uses MOD-style memory organization, you can still
  76.     │      │play MTM's.  You merely jump to the track sequencing data, and
  77.     │      │then load each pattern separately by jumping back and forth
  78.     │      │between the track sequences and the actual track data.
  79. ────────┼──────┼───────────────────────────────────────────────────────────────
  80. 194+    │Header│Extra comment field
  81. NOS*37+ │says. │(Length specified in the header)
  82. trks*192└──────┴────────────────────┐
  83. +(last pattern saved + 1)*32*2      │
  84. ────────┬──────┬────────────────────┴──────────────────────────────────────────
  85. 194+    │sample│Raw sample data
  86. NOS*37+ │length│(unsigned)
  87. trks*192└──────┴────────────────────┐
  88. +(last pattern saved + 1)*32*2+     │
  89. length of extra comment field       │
  90. ────────────────────────────────────┘