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

  1. --------M-MOD-M-----------------------------
  2.  
  3. The  Protracker composer is a composer  for digital music. The MOD files
  4. are  a quasi standard for digital music,  all words are in Motorola byte
  5. order.  The  original MOD format allowed  only 4 digital channels and 15
  6. instruments,  the  specification became enlarged  (maybe  by Mahoney and
  7. Kaktus??)  to  4 channels and 31  instruments.  Check the file at offset
  8. 1080d  for the signatures  'M.K', '4CHN', '6CHN','8CHN','FLT4','FLT8. If
  9. you  find any of them, the module uses 31 instruments. With rising sound
  10. quality  on  the PC and other platforms,  the old MODule format has been
  11. replaced  by  numerous other formats. The  4/15 format has almost become
  12. extinct. Below, only the 4/31 format is descripted.
  13.  
  14. The  digital  sample data is signed  (two's complement) as necessary for
  15. the  Amiga, the sample data immediately  follows the pattern data. Maybe
  16. this is not valid for some 8CHN files; One of the two I have, uses Intel
  17. byte ordering and unsigned samples.
  18.  
  19. OFFSET              Count TYPE   Description
  20. 0000h                  20 char   Song title, padded with spaces
  21. 0014h                  31 rec    Sample description record
  22.                                  For original MOD files, the number of
  23.                                  instruments would be 15.
  24.                        22 char   Sample name, padded with zeroes to
  25.                                  full length.
  26.                         2 word   Sample length / 2. Needs to be multiplied
  27.                                  by 2 to get the actual length. If the sample
  28.                                  length is greater than 8000h, the sample
  29.                                  is bigger than 64k.
  30.                         1 byte   Sample finetune. Only the lower nibble is
  31.                                  valid. Fine tune table :
  32.                                   0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
  33.                                   0 +1 +2 +3 +4 +5 +6 +7 -8 -7 -6 -5 -4 -3 -2 -1
  34.                         1 byte   Sample volume (0-40h)
  35.                         1 word   Sample loop start / 2
  36.                         1 word   Sample loop length / 2
  37.  
  38. 950d                    1 byte   Song length in patterns (0-80h)
  39. 951d                    1 byte   Restart byte for song looping (Noisetracker?)
  40. 952d                  128 byte   Pattern play sequences
  41. 1080d                   4 char   ID='M.K.', ID='4CHN',ID='6CHN',ID='8CHN'
  42.                                  ID='4FLT',ID='8FLT'
  43.                                  If this position contains 'M.K.','8CHN',
  44.                                  '4CHN','6CHN','FLT4' or 'FLT8' the module
  45.                                  has 31 instruments.
  46. 1084d                   ? rec    Patterns
  47.                                  Each pattern has 64 rows.
  48.                                  Depending on the number of channels, each row
  49.                                  has from 4 to 8 notes. The channel count is
  50.                                  determined by the ID. (see table 0005)
  51.                                  The number of patterns is the highest pattern
  52.                                  number stored in the pattern list.
  53.  
  54.                                  Each note has four bytes. Four notes make
  55.                                  up a track in a four channel MOD file. Each
  56.                                  track is saved sequentially :
  57.                                    byte  0-3     4-7    8-11    12-15
  58.                                        Chn #1  Chn #2  Chn #3  Chn #4
  59.                                    byte 16-19   20-23  24-27    28-31
  60.                                        Chn #1  Chn #2  Chn #3  Chn #4
  61.                         1 word   Instrument / period
  62.                                  The instrument number is in bits 12-15, the
  63.                                  12-bit period in bits 0-11.
  64.                         1 byte   Upper nibble : Lower 4 bits of the instrument,
  65.                                  Lower nibble : Special effect command.
  66.                         1 byte   Special effects data
  67. (Table 0005)
  68. Protracker 16 note conversion table / MOD Period table
  69.        +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  70. PT16 : I    1I    2I    3I    4I    5I    6I    7I    8I    9I   10I   11I   12I
  71. MOD  : I 1712I 1616I 1524I 1440I 1356I 1280I 1208I 1140I 1076I 1016I  960I  906I
  72. Note : I  C-0I  C#0I  D-0I  D#0I  E-0I  F-0I  F#0I  G-0I  G#0I  A-0I  A#0I  B-0I
  73.        +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  74.        I   13I   14I   15I   16I   17I   18I   19I   20I   21I   22I   23I   24I
  75.        I  856I  808I  762I  720I  678I  640I  604I  570I  538I  508I  480I  453I
  76.        I  C-1I  C#1I  D-1I  D#1I  E-1I  F-1I  F#1I  G-1I  G#1I  A-1I  A#1I  B-1I
  77.        +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  78.        I   25I   26I   27I   28I   29I   30I   31I   32I   33I   34I   35I   36I
  79.        I  428I  404I  381I  360I  339I  320I  302I  285I  269I  254I  240I  226I
  80.        I  C-2I  C#2I  D-2I  D#2I  E-2I  F-2I  F#2I  G-2I  G#2I  A-2I  A#2I  B-2I
  81.        +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  82.        I   37I   38I   39I   40I   41I   42I   43I   44I   45I   46I   47I   48I
  83.        I  214I  202I  190I  180I  170I  160I  151I  143I  135I  127I  120I  113I
  84.        I  C-3I  C#3I  D-3I  D#3I  E-3I  F-3I  F#3I  G-3I  G#3I  A-3I  A#3I  B-3I
  85.        +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  86.        I   49I   50I   51I   52I   53I   54I   55I   56I   57I   58I   59I   60I
  87.        I  107I  101I   95I   90I   85I   80I   75I   71I   67I   63I   60I   56I
  88.        I  C-4I  C#4I  D-4I  D#4I  E-4I  F-4I  F#4I  G-4I  G#4I  A-4I  A#4I  B-4I
  89.        +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
  90.  
  91. EXTENSION:MOD,module
  92. OCCURENCES:AMIGA,PC
  93. PROGRAMS:DMP,ModEdit
  94. VALIDATION:NONE
  95.  
  96.