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

  1. --------M-MOD---------------------------
  2.  
  3. Protracker 1.1B Song/Module Format:
  4.  
  5. Offset  Bytes  Description
  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.   20     22    Samplename for sample 1. Pad with null bytes.
  12.   42      2    Samplelength for sample 1. Stored as number of words.
  13.                Multiply by two to get real sample length in bytes.
  14.   44      1    Lower four bits are the finetune value, stored as a signed
  15.                four bit number. The upper four bits are not used, and
  16.                should be set to zero.
  17.             Value:  Finetune:
  18.              0        0
  19.              1       +1
  20.              2       +2
  21.              3       +3
  22.              4       +4
  23.              5       +5
  24.              6       +6
  25.              7       +7
  26.              8       -8
  27.              9       -7
  28.              A       -6
  29.              B       -5
  30.              C       -4
  31.              D       -3
  32.              E       -2
  33.              F       -1
  34.  
  35.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  36.   46      2    Repeat point for sample 1. Stored as number of words offset
  37.              from start of sample. Multiply by two to get offset in bytes.
  38.   48      2    Repeat Length for sample 1. Stored as number of words in
  39.              loop. Multiply by two to get replen in bytes.
  40.  
  41. Information for the next 30 samples starts here. It's just like the info
  42. for sample 1.
  43.  
  44. Offset  Bytes  Description
  45.   50     30    Sample 2...
  46.   80     30    Sample 3...
  47.    .
  48.    .
  49.    .
  50.  890     30    Sample 30...
  51.  920     30    Sample 31...
  52.  
  53. Offset  Bytes  Description
  54.  950      1    Songlength. Range is 1-128.
  55.  951      1    Well... this little byte here is set to 127, so that old
  56.              trackers will search through all patterns when loading.
  57.              Noisetracker uses this byte for restart, but we don't.
  58.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  59.              tells the tracker what pattern to play at that position.
  60. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  61.              inserted when they increased the number of samples from
  62.              15 to 31. If it's not there, the module/song uses 15 samples
  63.              or the text has been removed to make the module harder to
  64.              rip. Startrekker puts "FLT4" or "FLT8" there instead.
  65.  
  66. Offset  Bytes  Description
  67. 1084    1024   Data for pattern 00.
  68.    .
  69.    .
  70.    .
  71. xxxx  Number of patterns stored is equal to the highest patternnumber
  72.       in the song position table (at offset 952-1079).
  73.  
  74. Each note is stored as 4 bytes, and all four notes at each position in
  75. the pattern are stored after each other.
  76.  
  77. 00 -  chan1  chan2  chan3  chan4
  78. 01 -  chan1  chan2  chan3  chan4
  79. 02 -  chan1  chan2  chan3  chan4
  80. etc.
  81.  
  82. Info for each note:
  83.  
  84.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  85. /                 /        /                 /
  86. 0000          0000-00000000  0000          0000-00000000
  87.  
  88. Upper four    12 bits for    Lower four    Effect command.
  89. bits of sam-  note period.   bits of sam-
  90. ple number.                  ple number.
  91.  
  92. Periodtable for Tuning 0, Normal
  93.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  94.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  95.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  96.  
  97. To  determine  what note to show, scan  through the table until you find
  98. the  same period as the one stored in byte 1-2. Use the index to look up
  99. in a notenames table.
  100.  
  101. This  is the data stored in a normal song. A packed song starts with the
  102. four  letters  "PACK", but i don't know  how the song is packed: You can
  103. get  the source code for the cruncher/decruncher from us if you need it,
  104. but I don't understand it; I've just ripped it from another tracker...
  105.  
  106. In  a module, all the samples are stored right after the patterndata. To
  107. determine  where  a  sample  starts and  stops,  you  use the sampleinfo
  108. structures in the beginning of the file (from offset 20). Take a look at
  109. the  mt_init  routine in the playroutine, and  you'll see just how it is
  110. done.
  111.  
  112. Lars "ZAP" Hamre/Amiga Freelancers
  113.  
  114. --------------------------
  115.  
  116. Found that document...
  117.  
  118. Mark J Cox ------------------------------------------- m.j.h.cox@bradford.ac.uk
  119. University of Bradford ---------------------------- bc732@cleveland.freenet.edu
  120. Mark
  121.  
  122.            EFFECT COMMANDS
  123.            ---------------
  124.  Effect commands on protracker should
  125.  be compatible with all other trackers.
  126.  0 - None/Arpeggio     8 - * NOT USED *
  127.  1 - Portamento Up     9 - SampleOffset
  128.  2 - Portamento Down   A - VolumeSlide
  129.  3 - TonePortamento    B - PositionJump
  130.  4 - Vibrato           C - Set Volume
  131.  5 - ToneP + VolSlide  D - PatternBreak
  132.  6 - Vibra + VolSlide  E - Misc. Cmds
  133.  7 - Tremolo           F - Set Speed
  134.  
  135.  
  136.             E - COMMANDS
  137.             ------------
  138.  The E command has been altered to
  139.  contain more commands than one.
  140.  E0- Filter On/Off     E8- * NOT USED *
  141.  E1- Fineslide Up      E9- Retrig Note
  142.  E2- Fineslide Down    EA- FineVol Up
  143.  E3- Glissando Control EB- FineVol Down
  144.  E4- Vibrato Control   EC- NoteCut
  145.  E5- Set Finetune      ED- NoteDelay
  146.  E6- Patternloop       EE- PatternDelay
  147.  E7- Tremolo Control   EF- Invert Loop
  148.  
  149.  
  150.   Cmd 0. Arpeggio [Range:$0-$F/$0-$F]
  151.   -----------------------------------
  152.  Usage: $0 + 1st halfnote add
  153.          + 2nd halfnote add
  154.  Arpeggio is used to simulate chords.
  155.  This is done by rapidly changing the
  156.  pitch between 3(or 2) different notes.
  157.  It sounds very noisy and grainy on
  158.  most samples, but ok on monotone ones.
  159.  Example: C-300047  C-major chord:
  160.         (C+E+G  or C+4+7 halfnotes)
  161.         C-300037  C-minor chord:
  162.         (C+D#+G or C+3+7 halfnotes)
  163.  
  164.  
  165.   Cmd 1. Portamento up [Speed:$00-$FF]
  166.   ------------------------------------
  167.  Usage: $1 + portamento speed
  168.  Portamento up will simply slide the
  169.  sample pitch up. You can NOT slide
  170.  higher than B-3! (Period 113)
  171.  Example: C-300103  1 is the command,
  172.           3 is the portamentospeed.
  173.  NOTE: The portamento will be called as
  174.  many times as the speed of the song.
  175.  This means that you'll sometimes have
  176.  trouble sliding accuratly. If you
  177.  change the speed without changing the
  178.  sliderates, it will sound bad...
  179.  
  180.  
  181.   Cmd 2. Portamento down [Speed:$00-FF]
  182.   -------------------------------------
  183.  Usage: $2 + portamento speed
  184.  Just like command 1, except that this
  185.  one slides the pitch down instead.
  186.  (Adds to the period).
  187.  You can NOT slide lower than C-1!
  188.  (Period 856)
  189.  Example: C-300203  2 is the command,
  190.           3 is the portamentospeed.
  191.  
  192.  
  193.  Cmd 3. Tone-portamento [Speed:$00-$FF]
  194.  --------------------------------------
  195.  Usage: Dest-note + $3 + slidespeed
  196.  This command will automatically slide
  197.  from the old note to the new.
  198.  You don't have to worry about which
  199.  direction to slide, you need only set
  200.  the slide speed. To keep on sliding,
  201.  just select the command $3 + 00.
  202.  Example: A-200000  First play a note.
  203.         C-300305  C-3 is the note to
  204.              slide to, 3 the command,
  205.              and 5 the speed.
  206.  
  207.  
  208.  Cmd 4. Vibrato [Rate:$0-$F,Dpth:$0-$F]
  209.  --------------------------------------
  210.  Usage: $4 + vibratorate + vibratodepth
  211.  Example: C-300481  4 is the command,
  212.        8 is the speed of the vibrato,
  213.    and 1 is the depth of the vibrato.
  214.  To keep on vibrating, just select
  215.  the command $4 + 00. To change the
  216.  vibrato, you can alter the rate,
  217.  depth or both. Use command E4- to
  218.  change the vibrato-waveform.
  219.  
  220.  
  221.  Cmd 5. ToneP + Volsl [Spd:$0-$F/$0-$F]
  222.  --------------------------------------
  223.  Usage: $5 + upspeed + downspeed
  224.  This command will continue the current
  225.  toneportamento and slide the volume
  226.  at the same time. Stolen from NT2.0.
  227.  Example: C-300503  3 is the speed to
  228.             turn the volume down.
  229.         C-300540  4 is the speed to
  230.                    slide it up.
  231.  
  232.  
  233.  Cmd 6. Vibra + Volsl [Spd:$0-$F/$0-$F]
  234.  --------------------------------------
  235.  Usage: $6 + upspeed + downspeed
  236.  This command will continue the current
  237.  vibrato and slide the volume at the
  238.  same time. Stolen from NT2.0.
  239.  Example: C-300605  5 is the speed to
  240.             turn the volume down.
  241.         C-300640  4 is the speed to
  242.                    slide it up.
  243.  
  244.  
  245.  Cmd 7. Tremolo [Rate:$0-$F,Dpth:$0-$F]
  246.  --------------------------------------
  247.  Usage: $7 + tremolorate + tremolodepth
  248.  Tremolo vibrates the volume.
  249.  Example: C-300794  7 is the command,
  250.        9 is the speed of the tremolo,
  251.    and 4 is the depth of the tremolo.
  252.  To keep on tremoling, just select
  253.  the command $7 + 00. To change the
  254.  tremolo, you can alter the rate,
  255.  depth or both. Use command E7- to
  256.  change the tremolo-waveform.
  257.  
  258.  
  259.  Cmd 9. Set SampleOffset [Offs:$00-$FF]
  260.  --------------------------------------
  261.  Usage: $9 + Sampleoffset
  262.  This command will play from a chosen
  263.  position in the sample, and not from
  264.  the beginning. The two numbers equal
  265.  the two first numbers in the length
  266.  of the sample. Handy for speech-
  267.  samples.
  268.  Example: C-300923  Play sample from
  269.                 offset $2300.
  270.  
  271.  
  272.  Cmd A. Volumeslide [Speed:$0-$F/$0-$F]
  273.  --------------------------------------
  274.  Usage: $A + upspeed + downspeed
  275.  Example: C-300A05  5 is the speed to
  276.             turn the volume down.
  277.         C-300A40  4 is the speed to
  278.                    slide it up.
  279.  NOTE: The slide will be called as
  280.  many times as the speed of the song.
  281.  The slower the song, the more the
  282.  volume will be changed on each note.
  283.  
  284.  
  285.    Cmd B. Position-jump [Pos:$00-$7F]
  286.    ----------------------------------
  287.  Usage: $B + position to continue at
  288.  Example: C-300B01  B is the command,
  289.              1 is the position to
  290.              restart the song at.
  291.  This command will also perform a
  292.  pattern-break (see 2 pages below).
  293.  You can use this command instead of
  294.  restart as on noisetracker, but you
  295.  must enter the position in hex!
  296.  
  297.  
  298.    Cmd C. Set volume [Volume:$00-$40]
  299.    ----------------------------------
  300.  Usage: $C + new volume
  301.  Well, this old familiar command will
  302.  set the current volume to your own
  303.  selected. The highest volume is $40.
  304.  All volumes are represented in hex.
  305.  (Programmers do it in hex, you know!)
  306.  Example: C-300C10  C is the command,
  307.        10 is the volume (16 decimal).
  308.  
  309.  
  310.       Cmd D. Pattern-break
  311.       [Pattern-pos:00-63, decimal]
  312.       ----------------------------
  313.  Usage: $D + pattern-position
  314.  This command just jumps to the next
  315.  song-position, and continues play
  316.  from the patternposition you specify.
  317.  Example: C-300D00  Jump to the next
  318.      song-position and continue play
  319.           from patternposition 00.
  320.       Or: C-300D32  Jump to the next
  321.      song-position and continue play
  322.     from patternposition 32 instead.
  323.  
  324.  
  325.     Cmd E0. Set filter [Range:$0-$1]
  326.     --------------------------------
  327.  Usage: $E0 + filter-status
  328.  This command jerks around with the
  329.  sound-filter on some A500 + A2000.
  330.  All other Amiga-users should keep out
  331.  of playing around with it.
  332.  Example: C-300E01  disconnects filter
  333.              (turns power LED off)
  334.         C-300E00  connects filter
  335.               (turns power LED on)
  336.  
  337.  
  338.    Cmd E1. Fineslide up [Range:$0-$F]
  339.    ----------------------------------
  340.  Usage: $E1 + value
  341.  This command works just like the
  342.  normal portamento up, except that
  343.  it only slides up once. It does not
  344.  continue sliding during the length of
  345.  the note.
  346.  Example: C-300E11  Slide up 1 at the
  347.              beginning of the note.
  348.  (Great for creating chorus effects)
  349.  
  350.  
  351.   Cmd E2. Fineslide down [Range:$0-$F]
  352.   ------------------------------------
  353.  Usage: $E2 + value
  354.  This command works just like the
  355.  normal portamento down, except that
  356.  it only slides down once. It does not
  357.  continue sliding during the length of
  358.  the note.
  359.  Example: C-300E26  Slide up 6 at the
  360.              beginning of the note.
  361.  
  362.  
  363.   Cmd E3. Glissando Ctrl [Range:$0-$1]
  364.   ------------------------------------
  365.  Usage: $E3 + Glissando-Status
  366.  Glissando must be used with the tone-
  367.  portamento command. When glissando is
  368.  activated, toneportamento will slide
  369.  a halfnote at a time, instead of a
  370.  straight slide.
  371.  Example: C-300E31  Turn Glissando on.
  372.         C-300E30  Turn Glissando off.
  373.  
  374.  
  375.       Cmd E4. Set vibrato waveform
  376.       [Range:$0-$3]
  377.       ----------------------------
  378.  Usage: $E4 + vibrato-waveform
  379.  Example: C-300E40  Set sine(default)
  380.              E44  Don't retrig WF
  381.         C-300E41  Set Ramp Down
  382.              E45  Don't retrig WF
  383.         C-300E42  Set Squarewave
  384.              E46  Don't retrig WF
  385.         C-300E43  Set Random
  386.              E47  Don't retrig WF
  387.  
  388.  
  389.    Cmd E5. Set finetune [Range:$0-$F]
  390.    ----------------------------------
  391.  Usage: $E5 + finetune-value
  392.  Example: C-300E51  Set finetune to 1.
  393.  Use these tables to figure out the
  394.  finetune-value.
  395.  Finetune: +7 +6 +5 +4 +3 +2 +1  0
  396.     Value:  7  6  5  4  3  2  1  0
  397.  Finetune: -1 -2 -3 -4 -5 -6 -7 -8
  398.     Value:  F  E  D  C  B  A  9  8
  399.  
  400.  
  401.    Cmd E6. PatternLoop [Loops:$0-$F]
  402.    ----------------------------------
  403.  Usage: $E6 + number of loops
  404.  This command will loop a part of a
  405.  pattern.
  406.  Example: C-300E60  Set loopstart.
  407.         C-300E63  Jump to loop 3
  408.          times before playing on.
  409.  
  410.  
  411.       Cmd E7. Set tremolo waveform
  412.       [Range:$0-$3]
  413.       ----------------------------
  414.  Usage: $E7 + tremolo-waveform
  415.  Example: C-300E70  Set sine(default)
  416.              E74  Don't retrig WF
  417.         C-300E71  Set Ramp Down
  418.              E75  Don't retrig WF
  419.         C-300E72  Set Squarewave
  420.              E76  Don't retrig WF
  421.         C-300E73  Set Random
  422.              E77  Don't retrig WF
  423.  
  424.  
  425.     Cmd E9. Retrig note [Value:$0-$F]
  426.     ---------------------------------
  427.  Usage: $E9 + Tick to Retrig note at.
  428.  This command will retrig the same note
  429.  before playing the next. Where to
  430.  retrig depends on the speed of the
  431.  song. If you retrig with 1 in speed 6
  432.  that note will be trigged 6 times in
  433.  one note slot. Retrig on hi-hats!
  434.  Example: C-300F06  Set speed to 6.
  435.         C-300E93  Retrig at tick 3
  436.                 out of 6.
  437.  
  438.  
  439.    Cmd EA. FineVolsl up [Range:$0-$F]
  440.    ----------------------------------
  441.  Usage: $EA + value
  442.  This command works just like the
  443.  normal volumeslide up, except that
  444.  it only slides up once. It does not
  445.  continue sliding during the length of
  446.  the note.
  447.  Example: C-300EA3  Slide volume up 1
  448.       at the beginning of the note.
  449.  
  450.  
  451.   Cmd EB. FineVolsl down [Range:$0-$F]
  452.   ------------------------------------
  453.  Usage: $EB + value
  454.  This command works just like the
  455.  normal volumeslide down, except that
  456.  it only slides down once. It does not
  457.  continue sliding during the length of
  458.  the note.
  459.  Example: C-300EB6  Slide volume down
  460.        6 at the beginning of the note.
  461.  
  462.  
  463.      Cmd EC. Cut note [Value:$0-$F]
  464.      ------------------------------
  465.  Usage: $EC + Tick to Cut note at.
  466.  This command will cut the note
  467.  at the selected tick, creating
  468.  extremely short notes.
  469.  Example: C-300F06  Set speed to 6.
  470.         C-300EC3  Cut at tick 3 out
  471.                 of 6.
  472.  Note that the note is not really cut,
  473.  the volume is just turned down.
  474.  
  475.  
  476.      Cmd ED. NoteDelay [Value:$0-$F]
  477.      -------------------------------
  478.  Usage: $ED + ticks to delay note.
  479.  This command will delay the note
  480.  to the selected tick.
  481.  Example: C-300F06  Set speed to 6.
  482.         C-300ED3  Play note at tick
  483.                 3 out of 6.
  484.  
  485.  
  486.    Cmd EE. PatternDelay [Notes:$0-$F]
  487.    ----------------------------------
  488.  Usage: $EE + notes to delay pattern.
  489.  This command will delay the pattern
  490.  the selected numbers of notes.
  491.  Example: C-300EE8  Delay pattern 8
  492.          notes before playing on.
  493.  All other effects are still active
  494.  when the pattern is being delayed.
  495.  
  496.  
  497.     Cmd EF. Invert Loop [Speed:$0-$F]
  498.     ---------------------------------
  499.  Usage: $EF + Invertspeed
  500.  This command will need a short loop
  501.  ($10,20,40,80 etc. bytes) to work.
  502.  It will invert the loop byte by byte.
  503.  Sounds better than funkrepeat...
  504.  Example: C-300EF8 Set invspeed to 8.
  505.  To turn off the inverting, set
  506.  invspeed to 0, or press ctrl + Z.
  507.  
  508.  
  509.     Cmd F. Set speed [Speed:$00-$FF]
  510.     --------------------------------
  511.  Usage: $F + speed
  512.  This command will set the speed of the
  513.  song.
  514.  
  515.  
  516.  
  517.  
  518.  
  519. ---------------------------end forwarded message----------------------------
  520. --
  521.  --Jeff Hartung--
  522.  Disclaimer: My opinions only, etc., etc., BLAH! BLAH! BLAH!...
  523.  InterNet - hartung@crl.ucsd.edu         BITNET - hartung@ucsd
  524.  UUCP - ucsd!crl.ucsd.edu!hartung
  525.  
  526.  
  527. This is a reposting for an earlier one.
  528.  
  529. Enjoy.....
  530.  
  531. ian
  532.  
  533.