home *** CD-ROM | disk | FTP | other *** search
/ Esprit de Apple Corps / EDAC-1.iso / MOD.Utilities / Info / MODules.txt < prev    next >
Text File  |  1993-03-17  |  5KB  |  115 lines

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