home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / MOD15V12.ZIP / INFOS / MODFILE.TXT < prev   
Text File  |  1996-01-15  |  4KB  |  119 lines

  1. Here is the Amiga (ProTracker) module format document. The first part
  2. I got from a BBS, the second part I got from Mark Cox (author of
  3. ModPlay, etc).
  4.  
  5. *********************************************************************
  6.  
  7.  
  8. Protracker 1.1B Song/Module Format:
  9.  
  10. Offset  Bytes  Description
  11.    0     20    Songname. Remember to put trailing null bytes at the end...
  12.  
  13. Information for sample 1-31:
  14.  
  15. Offset  Bytes  Description
  16.   20     22    Samplename for sample 1. Pad with null bytes.
  17.   42      2    Samplelength for sample 1. Stored as number of words.
  18.            Multiply by two to get real sample length in bytes.
  19.   44      1    Lower four bits are the finetune value, stored as a signed
  20.            four bit number. The upper four bits are not used, and
  21.            should be set to zero.
  22.            Value:  Finetune:
  23.          0        0
  24.          1       +1
  25.          2       +2
  26.          3       +3
  27.          4       +4
  28.          5       +5
  29.          6       +6
  30.          7       +7
  31.          8       -8
  32.          9       -7
  33.          A       -6
  34.          B       -5
  35.          C       -4
  36.          D       -3
  37.          E       -2
  38.          F       -1
  39.  
  40.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  41.   46      2    Repeat point for sample 1. Stored as number of words offset
  42.            from start of sample. Multiply by two to get offset in bytes.
  43.   48      2    Repeat Length for sample 1. Stored as number of words in
  44.            loop. Multiply by two to get replen in bytes.
  45.  
  46. Information for the next 30 samples starts here. It's just like the info for
  47. sample 1.
  48.  
  49. Offset  Bytes  Description
  50.   50     30    Sample 2...
  51.   80     30    Sample 3...
  52.    .
  53.    .
  54.    .
  55.  890     30    Sample 30...
  56.  920     30    Sample 31...
  57.  
  58. Offset  Bytes  Description
  59.  950      1    Songlength. Range is 1-128.
  60.  951      1    Well... this little byte here is set to 127, so that old
  61.            trackers will search through all patterns when loading.
  62.            Noisetracker uses this byte for restart, but we don't.
  63.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  64.            tells the tracker what pattern to play at that position.
  65. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  66.            inserted when they increased the number of samples from
  67.            15 to 31. If it's not there, the module/song uses 15 samples
  68.            or the text has been removed to make the module harder to
  69.            rip. Startrekker puts "FLT4" or "FLT8" there instead.
  70.  
  71. Offset  Bytes  Description
  72. 1084    1024   Data for pattern 00.
  73.    .
  74.    .
  75.    .
  76. xxxx  Number of patterns stored is equal to the highest patternnumber
  77.       in the song position table (at offset 952-1079).
  78.  
  79. Each note is stored as 4 bytes, and all four notes at each position in
  80. the pattern are stored after each other.
  81.  
  82. 00 -  chan1  chan2  chan3  chan4
  83. 01 -  chan1  chan2  chan3  chan4
  84. 02 -  chan1  chan2  chan3  chan4
  85. etc.
  86.  
  87. Info for each note:
  88.  
  89.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  90. /                 /        /                 /      
  91. 0000          0000-00000000  0000          0000-00000000
  92.  
  93. Upper four    12 bits for    Lower four    Effect command.
  94. bits of sam-  note period.   bits of sam-
  95. ple number.                  ple number.
  96.  
  97. Periodtable for Tuning 0, Normal
  98.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  99.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  100.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  101.  
  102. To determine what note to show, scan through the table until you find
  103. the same period as the one stored in byte 1-2. Use the index to look
  104. up in a notenames table.
  105.  
  106. This is the data stored in a normal song. A packed song starts with the
  107. four letters "PACK", but i don't know how the song is packed: You can
  108. get the source code for the cruncher/decruncher from us if you need it,
  109. but I don't understand it; I've just ripped it from another tracker...
  110.  
  111. In a module, all the samples are stored right after the patterndata.
  112. To determine where a sample starts and stops, you use the sampleinfo
  113. structures in the beginning of the file (from offset 20). Take a look
  114. at the mt_init routine in the playroutine, and you'll see just how it
  115. is done.
  116.  
  117. Lars "ZAP" Hamre/Amiga Freelancers
  118.  
  119.