home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 September / Chip_2000-09_cd1.bin / sharewar / Slunec / app / 16 / MOD.SWG / 0029_XM.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  6KB  |  121 lines

  1. --------M-XM--------------------------------
  2.  
  3. The  .XM  files (Extended Module) are  multichannel MOD files created by
  4. Triton's  FastTracker  ][. They feature up  to 32 channels and different
  5. effects.  FT  2  is a shareware  program.  After  the initial .XM header
  6. follows the pattern data, after the patterns follow the instruments.
  7.  
  8. OFFSET              Count TYPE   Description
  9. 0000h                  17 char   ID="Extended module: "
  10. 0011h                  20 char   Module name, padded with zeroes
  11. 0025h                   1 char   ID=01Ah
  12. 0026h                  20 char   Tracker name
  13. 003Ah                   1 word   Tracker revision number, hi-byte is major version
  14. 003Ch                   1 dword  Header size
  15. 0040h                   1 word   Song length in patterns
  16. 0042h                   1 word   Restart position
  17. 0044h                   1 word   Number of channels
  18. 0046h                   1 word   Number of patterns (< 256)
  19.                                  ="PAT"
  20. 0048h                   1 word   Number of instruments (<128)
  21. 004Ah                   1 word   Flags :
  22.                                  0 - Linear frequency table / Amiga freq. table
  23. 004Ch                   1 word   Default tempo
  24. 004Eh                   1 word   Default BPM
  25. 0050h                 256 byte   Pattern order table
  26.  
  27. --- Pattern header
  28. The patterns are stored as ordinary MOD patterns, except that each note is
  29. stored as 5 bytes:
  30.  
  31.       ?      1   (byte) Note (0-71, 0 = C-0)
  32.      +1      1   (byte) Instrument (0-128)
  33.      +2      1   (byte) Volume column byte (see below)
  34.      +3      1   (byte) Effect type
  35.      +4      1   (byte) Effect parameter
  36.  
  37. A  simle  packing  scheme is also adopted,  so  that the patterns do not
  38. become  TOO large: Since the MSB in the  note value is never used, it is
  39. used  for  the  compression.If the bit is  set,  then the other bits are
  40. interpreted as follows:
  41.  
  42.       bit 0 set: Note byte ollows
  43.           1 set: Instrument byte follows
  44.           2 set: Volume column byte follows
  45.           3 set: Effect byte follows
  46.           4 set: Effect data byte follows
  47.  
  48. OFFSET              Count TYPE   Description
  49. 0000h                   1 dword  Length of pattern block/header ??
  50. 0004h                   1 byte   Pattern pack type
  51. 0005h                   1 word   Number of rows in pattern (1..256)
  52. 0007h                   1 word   Size of pattern data
  53.                                  ="PSZ"
  54.                     "PSZ" byte   Pattern data
  55.  
  56. --- Instrument header
  57. Each instrument has one or more sample headers following it.
  58. OFFSET              Count TYPE   Description
  59. 0000h                   1 dword  Instrument block/header size
  60. 0004h                  22 char   ASCII Instrument name, 0 padded ?
  61. 001Ah                   1 byte   Instrument type (always 0)
  62. 001Bh                   1 word   Number of samples in instrument
  63. 001Dh                   1 dword  Sample header size
  64. 0021h                  96 byte   Sample numbers for all notes
  65. 0081h                  48 byte   Points of volume envelope
  66. 00C1h                  48 byte   Points of panning envelope
  67. 0101h                   1 byte   Number of volume points
  68. 0102h                   1 byte   Number of panning points
  69. 0103h                   1 byte   Volume sustain point
  70. 0104h                   1 byte   Volume loop start point
  71. 0105h                   1 byte   Volume loop end point
  72. 0106h                   1 byte   Panning sustain point
  73. 0107h                   1 byte   Panning loop start point
  74. 0108h                   1 byte   Panning loop end point
  75. 0109h                   1 byte   Volume type, bitmapped
  76.                                  0 - Volume on
  77.                                  1 - Sustain on
  78.                                  2 - Loop on
  79. 010Ah                   1 byte   Panning type, bitmapped
  80.                                  0 - Panning on
  81.                                  1 - Sustain on
  82.                                  2 - Loop on
  83. 010Bh                   1 byte   Vibrato type
  84. 010Ch                   1 byte   Vibrato sweep
  85. 010Dh                   1 byte   Vibrato depth
  86. 010Eh                   1 byte   Vibrato rate
  87. 010Fh                   1 word   Volume fadeout
  88. 0111h                   1 word   Reserved
  89.  
  90. --- Sample headers
  91. OFFSET              Count TYPE   Description
  92. 0000h                   1 dword  Sample length
  93.                                  ="LEN"
  94. 0004h                   1 dword  Sample loop start
  95. 0008h                   1 dword  Sample loop length
  96. 000Ch                   1 byte   Volume
  97. 000Dh                   1 byte   Finetune for sample (-128..+127)
  98.                                  +-127 is one half tone
  99. 000Eh                   1 byte   Sample type, bitmapped
  100.                                  0,1 : Loop type :
  101.                                         0 - no loop
  102.                                         1 - forward loop
  103.                                         2 - ping-pong loop
  104.                                         3 - reserved
  105.                                    4?: sample is 16-bit
  106. 000Fh                   1 byte   Sample pan
  107. 0010h                   1 byte   Relative note number (signed byte)
  108.                                  (-96..+95), 0 -> C-4 sounds as C-4
  109. 0011h                   1 byte   Reserved
  110. 0012h                  22 char   ASCII name of sample, 0 padded
  111. 0013h               "LEN" byte   Sample data. The sample data is stored
  112.                                  as delta compressed data like the ProTracker.
  113.  
  114. EXTENSION:XM,MOD
  115. OCCURENCES:
  116. PROGRAMS: FAST TRACKER 2.*
  117. REFERENCE:
  118. SEE ALSO:MOD,S3M
  119. VALIDATION:
  120.  
  121.