home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / pp3_1.zip / AMM4.DOC < prev    next >
Text File  |  1995-09-07  |  38KB  |  1,159 lines

  1. []------------------------------------------------------------------------[]
  2. | AUDIO MANAGER 4 MODULE FORMAT by TechnoMaestro/RDG                       |
  3. | (c) Copyright Kenneth Foo, 1995. All Rights Reserved.                    |
  4. |--------------------------------------------------------------------------|
  5. | Text contains only suggestions and hints of what might be in the next    |
  6. | Audio Manager format, which, when fully implemented, allow compatibility |
  7. | with almost ANY existing music format, and probably future formats.      |
  8. | Note that this is NOT THE FINAL format!                                  |
  9. []------------------------------------------------------------------------[]
  10.  
  11. Sidenotes:
  12. ■ Uses a newer special delta encoding for even more compressible samples!
  13.   I will release the specs on this later. By the way, anybody has better
  14.   methods of encoding/compressing samples?
  15. ■ Samples can be copied and inverted during run time, for surround effects.
  16.   This enables space-saving methods, and avoids the 16-channel limit most
  17.   players face when enabling surround sound. Info on this will be inside
  18.   the instrument header.
  19. ■ Many more things have been left out, and effect numbering is wrong.
  20.   More news when progress is made.
  21.  
  22. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  23. AMM: AUDIO MANAGER MODULE (AMM)▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  24. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  25. OFFSET  LENGTH  TYPE    STUFF
  26. ──────────────────────────────────────────────────────────────────────────
  27. HEADER (FIXED SIZE)
  28. ──────────────────────────────────────────────────────────────────────────
  29.     4       char    'RIFF'
  30.     4       ulong   Size of chunk (file)
  31.     4       char    'AMM2'
  32.  
  33. ==========================================================================
  34. SONG INFO
  35. ==========================================================================
  36.     4       char    'INFO'
  37.     4       ulong   Size of chunk=68 bytes
  38.             Note! Size can range from 20 to 20+256, where
  39.             the song name can be extended!
  40.  
  41.     2       short   Song info (flags)
  42.             Bit
  43.             0  0=No frequency limit
  44.                1=Octave 1-6 limit. (Protracker MOD limit)
  45.             1  0=Ignore overflow in periods. But catch underflows (S3M)
  46.                1=Catch both overflows and underflows.
  47.             2  0='Amiga' frequency table
  48.                1=Linear frequency Table
  49.             3  1=Format's native tracker bug emulation
  50.             4  0=Mono mode
  51.                1=Stereo mmode
  52.             5  Reserved
  53.             :  Reserved
  54.             15 Reserved
  55.     2       ushort  Master volume (S3M's Global Volume), 0-256.
  56.     2       ushort  Amplification volume (S3M's Global Volume).
  57.             0-65534 Amplification values
  58.                 Final waveform = Amplification x WaveForm / 256
  59.                 Or, for 16-bits, x 256 to amplify...
  60.                 Final waveform = Amplification x WaveForm
  61.             65535   Use dynamic mixing mode (lowest quality)
  62.     1       char    Song source
  63.             0=Unknown
  64.             1=AM Tracker
  65.             2=MOD/NST
  66.             3=S3M
  67.             4=XM
  68.             5=MIDI
  69.             6=MTM
  70.             7=669
  71.             8=PSM
  72.             9=DSM
  73.     1       char    Reserved
  74.     2       short   Song-source-specific flags
  75.             AM:     Does not use this flag
  76.             MOD:
  77.             S3M:    Bit
  78.                 0  1=Emulate early S3M's slightly faster
  79.                      volume slides
  80.             XM:
  81.     2       word    Native tracker version (HI:LO)
  82.     1       char    Startup speed
  83.     1       char    Startup tempo
  84.     40      char    Song name
  85.  
  86. ==========================================================================
  87. SEQUENCE LIST
  88. ==========================================================================
  89.     4       char    'SEQS'
  90.     4       ulong   Size of chunk
  91.  
  92.     2       short   Number of orders
  93.     x       short   Pattern numbers.
  94.             65534   Skip this order
  95.             65535   End of song
  96.  
  97. ==========================================================================
  98. TRACK/CHANNEL SETTINGS
  99. ==========================================================================
  100.     4       char    'TRAK'
  101.     4       ulong   Size of chunk
  102.  
  103.     1       char    Number of tracks
  104.     x       char    Channel pan settings
  105.             0 (Left most)   64 (Middle)     128 (Right)
  106.             255=Disabled track
  107.             254=Surround (not supported yet?)
  108.             Others: Planned for Adlib?
  109.  
  110. ==========================================================================
  111. PATTERNS
  112. ==========================================================================
  113.     4       char    'LIST'
  114.     4       ulong   Size of chunk (used also in memory allocation)
  115.     4       char    'PATS'
  116.     2       ushort  Number of patterns
  117.  
  118.     4       char    'PAT0' or 'PAT1' (subchunk)
  119.     4       ulong   Size of chunk
  120.     2       ushort  Pattern number (65534,65535=Undefined)
  121.     2       ushort  Number of rows
  122.     x       ?       Pattern data...
  123.  
  124.     ... more pattern sub-chunks and data...
  125.  
  126.     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  127.     ▒PATTERN ENCODING FOR PAT0 CHUNKS:
  128.     ▒
  129.     ▒  [Note][NewInst][Volume][EfxNum][EfxData]
  130.     ▒  Length of Efx data is ALWAYS 2 bytes.
  131.     ▒  Music is also limited to only 1 effect.
  132.     ▒  Pretty useless, if you ask me. It's just like MOD/S3M!
  133.     ▒  In fact, I don't even support it.
  134.     ▒
  135.     ▒PATTERN ENCODING FOR PAT1 CHUNKS:
  136.     ▒
  137.     ▒  When loaded into memory, we also create a table for each
  138.     ▒  patterns. These tables contains the offset of the rows in
  139.         ▒  memory. They are linear offset (LOFF). (Run-time generated)
  140.         ▒  SHIT! NEED AN END-OF-ROW MARKER!
  141.     ▒
  142.     ▒  Each row is composed of a collection of channel notes, etc...
  143.     ▒  They are arranged in the following order...
  144.     ▒
  145.     ▒  Flag [Trak][Note][NewSmp][Volume][EfxNum][EfxLen][EfxData]...
  146.     ▒
  147.     ▒  The and the trailing effects and stuffs has the general struc of
  148.     ▒
  149.     ▒  [EfxNum][EfxLen][EfxData] ...
  150.     ▒
  151.     ▒  Effects can be connected in a series of chains to provide
  152.     ▒  virtually unlimited number of effects (!).
  153.     ▒  Here are detailed description of each field:
  154.     ▒
  155.     ▒FLAG:------------------------------------------------
  156.     ▒ Bit
  157.     ▒ 0     1=Track number present
  158.     ▒ 1     1=Note present
  159.     ▒ 2     1=NEW sample
  160.     ▒ 3     1=Volume present
  161.     ▒ 4     1=Efx number present
  162.     ▒ 5     1=Efx param present
  163.     ▒ 6     1=WORD for sample number! (Not BYTE!)
  164.     ▒ 7     0
  165.     ▒
  166.     ▒ When bit 7 is set, the flag is given a whole new meaning, that is,
  167.     ▒ Bit
  168.     ▒ 0     1=Global effect follows? (Here just for a nice separation of global stuffs and channel-specific stuffs -- but not used)
  169.     ▒ 1
  170.     ▒ 2
  171.     ▒ 3
  172.     ▒ 4
  173.     ▒ 5
  174.     ▒ 6
  175.     ▒ 7     1
  176.     ▒
  177.     ▒TRAK:-------------------------------------------------
  178.     ▒ Ranges from 0-255. A practical range is 1-31 (0 is not
  179.     ▒ required, as the default value on start of each row = 0).
  180.     ▒ Useful to skip empty tracks if there are more than 1
  181.     ▒ empty tracks in between 2 used tracks. (First track is 0)
  182.     ▒
  183.     ▒NOTE:-------------------------------------------------
  184.     ▒ xxxxyyyy
  185.     ▒ xxxx = Octave (0-15) (!)
  186.     ▒ yyyy = Note (0-11)
  187.     ▒ 255  = Key off
  188.     ▒
  189.     ▒SAMPLE:-----------------------------------------------
  190.     ▒ Ranges from 1-255.
  191.     ▒ However, if bit 2 of the Flag is set, value ranges from
  192.     ▒ 1-65535.
  193.     ▒ 0=Use previous sample and reset sample param
  194.     ▒
  195.     ▒VOLUME:-----------------------------------------------
  196.     ▒ Value ranges from 0-255.
  197.     ▒
  198.     ▒EFFECT NUMBER:----------------------------------------
  199.     ▒ Ranges from 1-127. 0=No efx (It IS not an effect anyway...)
  200.     ▒ If bit 7 is set, extended effect follows after this efx.
  201.     ▒
  202.     ▒EFFECT DATA:------------------------------------------
  203.     ▒ Usually a 1-byte value. But can be more or variable sized,
  204.     ▒ depending on the effect itself.
  205.     ▒
  206.     ▒
  207.     ▒NOTE:  Though it may not seem to be 100% compatible with other
  208.     ▒       formats (noticable, the volume setting column), AMM2's
  209.     ▒       ability to chain effects make it possible for the conversion
  210.     ▒       process to mimic all the effects and the happenings rather
  211.     ▒       faithfully. This actually means the compatibility issue
  212.     ▒       is more on the converter rather than the music interpreter.
  213.     ▒       Saves me loads of shitaches...
  214.     ▒
  215.     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  216.  
  217.  
  218. ==========================================================================
  219. INSTRUMENT STRUCTURES
  220. ==========================================================================
  221.     4       char    'LIST'
  222.     4       ulong   Size of chunk
  223.     4       char    'INST'
  224.  
  225.     ?       AMI     Instrument0, followed by envelopes and samples
  226.     ?       AMI     Instrument1, followed by envelopes and samples
  227.     :       :       :
  228.     :       :       :
  229.  
  230.     *NOTE:
  231.     *Each instrument is actually a collection of instrument info
  232.     *(including envelopes), and samples
  233.  
  234.  
  235.  
  236.  
  237. *END OF AMM MODULE*
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  253.  
  254.     E F F E C T S
  255.  
  256. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  257.  
  258. EACH EFFECT CONTAINS A TABLE OF FLAGS AND LENGTH OF PARAMETER.
  259. FLAGS:  0=Use value AS IT IS (even 00)
  260.     1= 00=Use previous (same efx, same channel) effect's param
  261.     2= 00=Use previous (whatever, but same channel!) effect's param
  262. LENGTH: 0-249 = Length
  263.         250 Rsvd
  264.         251 Rsvd
  265.         252 Rsvd
  266.         253 = BYTE length flag present
  267.         254 = WORD Length flag present
  268.         255 = DWORD Length flag present
  269.  
  270.  
  271. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  272. GLOBAL/OVERALL/MUSIC SYSTEM/PATTERN/SPEED
  273. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  274. 00▒▒▒▒▒▒NO EFFECT
  275.  
  276. 01▒▒▒▒▒▒SET SPEED
  277. xx[2]   00      Use previous value
  278.     ??      Set speed. Default is 6.
  279.  
  280. 02▒▒▒▒▒▒SET TEMPO (BPM)
  281. xx[2]   00      Use previous value
  282.     ??      Set tempo (BPM) to xx. Default is 125.
  283.  
  284. 04▒▒▒▒▒▒JUMP TO ORDER
  285. xxxx[0] Jump to order xxxx (ushort), at row 0 (that is, if Pattern Break
  286.     wasn't set. If pat break has set the row, we don't modify it!).
  287.  
  288. 05▒▒▒▒▒▒PATTERN BREAK
  289. xxxx[0] Pattern break to row xxxx (ushort).
  290.     Jumps to next order (if JUMP TO ORDER was not used to set
  291.     the next target orderr), at row xxxx.
  292.  
  293. 16▒▒▒▒▒▒PATTERN LOOP
  294. xy[0]   00      Set start of loop as current row.
  295.     ??      Set end of loop and number of repetitions.
  296.  
  297. 17▒▒▒▒▒▒PATTERN DELAY
  298. xx[0]   00      No delay
  299.     ??      Repeats current row x times without triggering the notes
  300.         again, but applying the effects.
  301.  
  302. 03▒▒▒▒▒▒SET MASTER VOLUME
  303. xx[0]   Varies from 0 to 64. (or 0-255?)
  304.     ! Internally, it is multiplied by 4 for range of 0-256 used in AM3.
  305.  
  306. 1E▒▒▒▒▒▒MASTER VOLUME SLIDE
  307. xy[1]   00      Continue previous master volume slide
  308.     x0      Slide up volume, with speed x.
  309.     0y      Slide down volume, with speed y.
  310.  
  311. 23▒▒▒▒▒▒SET EVENT
  312. xx[0]   Set the event flag (Music engine only) on and it's value to xx.
  313.     Useful for programmers only.
  314.  
  315.  
  316. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  317. NOTE VOLUME
  318. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  319. 21▒▒▒▒▒▒SET VOLUME
  320. xx[0]   Sets volume of channel's note to xx.
  321.  
  322. 06▒▒▒▒▒▒VOLUME SLIDE
  323. xy[2]   00      Continue previous (fine/slide)
  324.     x0      Volume slide up by x
  325.     0y      Volume slide down by y
  326.     xF      Fine volume slide up by x
  327.     Fy      Fine volume slide down by y
  328.     FF      Fine volume slide up by F (slide up has more priority).
  329.     * EARLY S3M BUG: Faster by 1 tick (perform volume slide on first
  330.       tick).
  331.  
  332. 0B▒▒▒▒▒▒TREMOLO (VOLUME MODULATION)
  333. xy[1]   00      Continue previous.
  334. [2]?    xy      Vibrate pitch using active waveform with speed x and
  335.         depth y.
  336.     0y      Retains speed. Sets depth to y.
  337.     Vibration wave used is based upon type selected.
  338.     Set 'SET TRERMOLO WAVEFORM'.
  339.  
  340. 1F▒▒▒▒▒▒KEY OFF
  341.     Turns off note (no parameter)
  342.  
  343. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  344. NOTE PITCH
  345. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  346.  
  347. 07▒▒▒▒▒▒SLIDE UP (PORTAMENTO UP)
  348. xy[2]   00      Continue previous (extra/fine/slide)
  349.     Ey      Extra fine slide up with speed y.
  350.     Fy      Fine slide up with speed y.
  351.     ??      Slide up with speed xy (if xy not [extra] fine).
  352.         Checked last?
  353.     Normal slides changes period by units of 4 on every tick.
  354.     Fine slides changes period by units of 4, once.
  355.     Extra fine slides are like fine slides, except they're in 1 units.
  356.  
  357. 08▒▒▒▒▒▒SLIDE DOWN (PORTAMENTO DOWN)
  358. xy[2]   00      Continue previous (extra/fine/slide)
  359.     Ey      Extra fine slide down with speed y.
  360.     Fy      Fine slide down with speed y.
  361.     ??      Slide down with speed xy (if xy not [extra] fine).
  362.         Checked last?
  363.     Normal slides changes period by units of 4 on every tick.
  364.     Fine slides changes period by units of 4, once.
  365.     Extra fine slides are like fine slides, except they're in 1 units.
  366.  
  367. 09▒▒▒▒▒▒SLIDE TO NOTE (PORTAMENTO TO NOTE)
  368. xx[1]   00      Continue slide with previous *slide to note* speed.
  369.     ??      Slide to note by with speed xx.
  370.     Apparently, there is a small difference between S3M and MOD at
  371.     handling this situation. (Most module players fail here).
  372.     If previously, there wasn't a note played and you try to issue
  373.     a slide to note, S3M (The original Scream Tracker) will assume that
  374.     you start from C-4. However, MOD implementation is not so. It will
  375.     not play the sound at all.
  376.  
  377. 0A▒▒▒▒▒▒VIBRATO (PITCH MODULATION)
  378. xy[1]   00      Continue previous.
  379.     xy      Vibrate pitch using active waveform with speed x and
  380.         depth y.
  381.     0y      Retains speed. Sets depth to y.
  382.     Vibration wave used is based upon type selected.
  383.     Set 'SET VIBRATO WAVEFORM'.
  384.  
  385. 1D▒▒▒▒▒▒FINE VIBRATO
  386. xy[1]   00      Continue previous.
  387.     xy      Vibrate pitch using active waveform with speed x and
  388.         depth y.
  389.     0y      Retains speed. Sets depth to y.
  390.     Vibration wave used is based upon type selected.
  391.     Set 'SET VIBRATO WAVEFORM'.
  392.     Similar to Vibrato, but 4x finer.
  393.  
  394.  
  395. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  396. NOTE PANNING
  397. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  398.  
  399. 12▒▒▒▒▒▒SET PANNING
  400. xx[0]   Set panning
  401.     00-128  Left(0)   Middle(64)    Right(128)
  402.     254     Surround (Not supported yet)
  403.     255     Disable channel
  404.  
  405. 20▒▒▒▒▒▒PANNING SLIDE
  406. xy[1]   00      Continue previous panning slide
  407.     x0      Pan left, speed x.
  408.     0y      Pan right, speed y.
  409.     Values are clipped and kept within range of 0-128!
  410.  
  411. General note:
  412.     GUS only allows 16 pan values, and thus, values are quantized
  413.     from 128 to 16.
  414.  
  415. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  416. SAMPLE
  417. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  418. 0F▒▒▒▒▒▒SET SAMPLE OFFSET
  419. xx[0]   Set sample offset
  420.     Sets sample offset to xx*256.
  421.  
  422. 10▒▒▒▒▒▒SET LONG SAMPLE OFFSET
  423. xxxx[0] Set sample offset
  424.     Sets sample offset to xxxx*256. (Up to 65536x256!)
  425.     That is, 16 megs!
  426.         (In future, we might need set FINE sample offset :-) Byte granularity!)
  427.  
  428. 11▒▒▒▒▒▒SET FINE SAMPLE OFFSET
  429. xxxxxxxx[0] Set fine sample offset
  430.     This special feature enables users to create 'true stereophonic'
  431.     sounds, by doing a small delay...but it's usually unnecessary.
  432.  
  433. !NO USE! 1B▒▒▒▒▒▒SET SAMPLE FINE TUNE (SET C4 RATE)
  434. 0x[0]   Values for x:
  435.         0       - 7895 Hz
  436.         1       - 7941 Hz
  437.         2       - 7985 Hz
  438.         3       - 8046 Hz
  439.         4       - 8107 Hz
  440.         5       - 8169 Hz
  441.         6       - 8232 Hz
  442.         7       - 8280 Hz
  443.         8       - 8363 Hz (No finetune)
  444.         9       - 8413 Hz
  445.         A       - 8463 Hz
  446.         B       - 8529 Hz
  447.         C       - 8581 Hz
  448.         D       - 8651 Hz
  449.         E       - 8723 Hz
  450.         F       - 8757 Hz
  451.     To convert old amiga fine tunes to current fine tune value,
  452.     perform [(ADD 8) AND 1111b].
  453.     Maintained for MOD/S3M compatibility!
  454.  
  455. 1C▒▒▒▒▒▒SET SAMPLE C4 FREQUENCY
  456. xxxxxxxx[0]  Set C4 frequency to xxxxxxxx (ulong)
  457.  
  458.  
  459. 24▒▒▒▒▒▒INVERT SAMPLE LOOP (NOT THE AMIGA INVERT LOOP)
  460. 0x[0]   0       Normal forward loop
  461.     1       Reverse the loop (for backward loops (eg, ping pong,etc..,
  462.         reverse it to forward!)
  463.         2       Ping Pong loop
  464.  
  465. 22▒▒▒▒▒▒SET ENVELOPE POSITION
  466. xxxx[0] Sets volume of channel's note to xxxx.
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  474. MISCELLANEOUS EFFECTS
  475. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  476. !NO USE! 0D▒▒▒▒▒▒CONTINUE VIBRATO AND DO VOLUME SLIDE
  477. xy[2]   00      Continue previous volume slide speed.
  478.     ??      Volume slide, with the same parameters as the normal volume
  479.         slide.
  480.  
  481. !NO USE! 0E▒▒▒▒▒▒CONTINUE SLIDE TO NOTE AND DO VOLUME SLIDE
  482. xy[2]   00      Continue previous volume slide speed.
  483.     Others  Volume slide, with the same parameters as the normal volume
  484.         slide.
  485.  
  486. But if planning to write a tracker, it will be quite useful as it simplifies
  487. some jobs.
  488.  
  489. 0C▒▒▒▒▒▒ARPEGGIO
  490. xy[1]   00      Continue previous.
  491.     ??      Switch between 3 notes, including the current note quickly
  492.         at every tick. Plays in the order... Current Note,
  493.         Current Note+x semitones, Current Note+y semitones.
  494.  
  495. 11▒▒▒▒▒▒RETRIGGER NOTE [+ OPTIONAL VOLUME CHANGE]
  496. xy[2?]  Retriggers note and optionally do volume slide too.
  497.     x=Volume slide type
  498.         0: 0    (No volumeslide)
  499.         1: -1
  500.         2: -2
  501.         3: -4
  502.         4: -8
  503.         5: -16
  504.         6: 2/3 times the current volume
  505.         7: 1/2 times the current volume
  506.         8: ?
  507.         9: +1
  508.         A: +2
  509.         B: +4
  510.         C: +8
  511.         D: +16
  512.         E: 3/2 times the current volume
  513.         F: 2 times the current volume
  514.         After changing volume, set the volume as current volume.
  515.     y=Retrigger note at every y ticks.
  516.  
  517. 15▒▒▒▒▒▒TREMOR
  518. xy[2]   00      Continue use of previous values.
  519.                 NOTE! S3M BUG:
  520.                 If previous values are undefined, use param of 00!!
  521.     ??      Turns sound on for x+1 ticks and off for y+1 ticks
  522.         throughout the row.
  523.     Tremor counter is retriggered upon reaching a new note.
  524.  
  525. 13▒▒▒▒▒▒CUT NOTE
  526. xx[0]   00      No cut
  527.     ??      Cut notes after xx ticks.
  528.  
  529. 14▒▒▒▒▒▒DELAY NOTE
  530. xx[0]   Delay note
  531.     00      Note not played.
  532.     ??      Delays note and triggers it only after xx ticks.
  533.  
  534. 18▒▒▒▒▒▒SET VIBRATO WAVEFORM
  535. xx[0]                                        xx VALUES
  536.     Waveform   Name                Retriggered  No Retrigger
  537.     ---------- ------------------- -----------  ------------
  538.     /\  /\     Sine (default)           0            4
  539.       \/  \/
  540.  
  541.     |\ |\      Ramp down                1            5
  542.       \| \|
  543.  
  544.     ,-, ,-,    Square                   2            6
  545.       '-' '-'
  546.  
  547.     ?????????  Random                   3            7
  548.            Use any one of the
  549.            above!
  550.  
  551.     Retrigger means that it will reset the position within the sine
  552.     table everytime a new note is encountered. Usually, when a new
  553.     note is encountered, the waveform-table-counter is reset to 0.
  554.     By default, the waveform is 0.
  555.  
  556. 19▒▒▒▒▒▒SET TREMOLO WAVEFORM
  557. xx[0]   See SET VIBRATO WAVEFORM.
  558.     Has similar effects.
  559.  
  560. 1A▒▒▒▒▒▒SET GLISSANDO FLAG
  561. xx[0]   00      Disable glissando
  562.     ??      Enable glissando. Usually, value 1 is used to enable it.
  563.  
  564. 25▒▒▒▒▒▒MISCELLANEOUS DATA PRESENT
  565. Size    Length of data, in ushort follows. After that, is the data itself.
  566. Data    Note: This one is used to store other stuffs! Dunno what, though!)
  567.     NOT PROCESSED.
  568.  
  569. 26▒▒▒▒▒▒SET LYRIC FOR CURRENT CHANNEL'S CURRENT ROW.
  570. Size    Length of lyric
  571. Lyric   Lyric
  572.  
  573.  
  574.  
  575. ??▒▒▒▒▒▒FINE DELAY NOTE
  576. xxxx[0] Fine delay note
  577.     Note is delayed 1/xxxxth of a second.
  578.     Note that this might not be the exact value, as the hardware
  579.     limitation or software routine might just round them to a certain
  580.     value.
  581.     Using set fine sample offset is a much better approach at this.
  582.  
  583.  
  584. ??▒▒▒▒▒▒SET STEREOPHONIC POSITION
  585. xxzz[0] Set stereophonic position
  586.     xx      Signed X coordinates, in metres
  587.     zz      Signed Z coordinates, in metres
  588.     Note: Delay is performed only for one side. On the other side,
  589.           sound is heard immediately
  590. CANNOT WORK BECAUSE 2 CHANNELS REQUIRED!
  591.  
  592.  
  593.  
  594.  
  595.  
  596. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  597. UNSUPPORTED
  598. ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  599.  
  600. XX▒▒▒▒▒▒SET FILTER
  601. xx      An old Amiga hardware stuff. NOT IMPLEMENTED.
  602.  
  603. YY▒▒▒▒▒▒SET STEREO CONTROL
  604. xx      An old Scream Tracker command. NOT IMPLEMENTED.
  605.  
  606. YY▒▒▒▒▒▒SELECT SOUND DEVICE INTERPOLATION/FILTERING METHOD
  607. xx      00      No interpolation/filtering (raw sound)
  608.     01      1/4 low pass filter
  609.     02      1/2 low pass filter
  610.     03      (others -- selects effect type)
  611.  
  612. * Note: Valid for software mixing devices only *
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  621. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  622. BELOW IS THE 'OLDER' SUGGESTED FORMAT, WHICH IS NOW OBSOLETE, BUT IT
  623. CONTAINS SEVERAL INFO ON ENVELOPES, AND STUFFS...MAINLY TAKEN FROM XM.
  624.  
  625. Basically, the idea is, ignore everything below this line :)
  626. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  627. ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  628.  
  629.  
  630. ───────────────────────────────────────────────────────────────────────────
  631. 00
  632.     NO EFFECT
  633. ────────────────────────────────────────────────────────────────────────────
  634. Find method of encoding!
  635.  
  636. [x] = Flag
  637.  
  638. WHOOPSSS!! SET ALSO THE FLAGS! CHECK SOURCE CODEZ!
  639.  
  640. SET PERIOD!
  641. SET FREQUENCY?
  642.  
  643.  
  644. Another effect -- set volume to sample/instrument default
  645.            -- set pan to sample/instrument default
  646.            -- set offset to start of sample (?)
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653. ──────────────────────────────────────────────────────────────────────────
  654. INSTRUMENT STRUCTURES (VARIABLE SIZED)
  655. ──────────────────────────────────────────────────────────────────────────
  656. ?       ?       struc   Instrument1 structure with sample headers
  657. ?       ?       struc   Instrument2 structure with sample headers
  658. :       :       :       :
  659. :       :       :       :
  660. ?       ?       struc   InstrumentX structure with sample headers
  661.  
  662. Instrument structures are similar to the AMI header.
  663.  
  664. ──────────────────────────────────────────────────────────────────────────
  665. SAMPLE DATA (VARIABLE SIZED)
  666. ──────────────────────────────────────────────────────────────────────────
  667. ?       ?       ?       Sample data stored in sequential order
  668.             Instrument 1:Smp1,2,3....
  669.             Instrument 2:Smp1,2,3....
  670.                    :
  671.                    :
  672.             Instrument X:Smp1,2,3....
  673.  
  674. ──────────────────────────────────────────────────────────────────────────
  675. SPECIAL DATA (VARIABLE SIZED)
  676. ──────────────────────────────────────────────────────────────────────────
  677. ?       ?       ?       Special data (ignored by AM4)
  678.             Actual data here is NOT PART of the AMM module.
  679.  
  680.  
  681. *END OF AMM MODULE*
  682.  
  683.  
  684.  
  685. MAKE SAMPLE LIBRARY POSSIBLE! (MODS WITHOUT SAMPLES...!)
  686.  
  687.  
  688.  
  689.     Byte    BIT 0 1=Note & instrument present
  690.             1 1=Volume present
  691.             2 1=Change in effect number
  692.             3 1=Change in effect data
  693.             4 \     Number empty rows after events (post-event RLE)
  694.             5  }--- This function is available only if PACKING METHOD 2
  695.             6 /     is used.
  696.             7 1=Event present (lower 4-bits has events)
  697.               0=Packed patterns
  698.               PACKING METHOD 1 or 2:
  699.               Bit 0-6 = Number empty rows-1
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711. 58      2       short   Song length (number patterns)
  712. 60      2       word    Master volume (S3M's Global Volume) (0-64)
  713. 62      2       word    Amplification/Mixing mode (S3M's Master volume)
  714.             0-32767 Amplification.
  715.                 FinalWaveForm = (Amplification x WaveForm) /256
  716.  
  717.             32768   Quality SHIFT mode. The final resultant waveform
  718.             -32775  is shifted x-32768 bits to the right (averaging).
  719.                 Valid only for 8-bit sound output.
  720.  
  721.             65535   Standard mixing mode. Lowest quality, but ensures
  722.                 no clipping is done.
  723. 64      1       byte    Song source
  724.             0=Unknown
  725.             1=AM Tracker
  726.             2=MOD/NST
  727.             3=S3M
  728.             4=MTM
  729.             5=669
  730.             6=XM
  731. 65      1       byte    Song-source-specific flags
  732.             AM:     Does not use this flag
  733.             MOD:
  734.             S3M:    Bit 0
  735.             XM:
  736. 66      4       dword   Number of bytes in extra data section
  737. 70      2       word    Native tracker version (HI:LO)
  738. 72      6       byte    Reserved
  739. 78      1       byte    Startup speed
  740. 79      1       byte    Startup tempo
  741.  
  742.  
  743.  
  744. TRAK    Tracks...
  745.  
  746. 60      2       short   Number of tracks (channels) (Max 32)
  747. 62      2       short   Number of patterns (Max 128)
  748. 52      2       word    Number Tracks
  749. 54      2       word    Number Patterns (Max 128)
  750. 56      2       word    Number Instruments (Max 128)
  751.  
  752. PAT0    Unpacked pattern
  753. PAT1    Packed pattern
  754. PAT2    Extra-packed pattern
  755.  
  756. 50      1       byte    Pattern packing type
  757.             0  Not packed
  758.             1  RLE encoded
  759.             2  RLE encoded + Extra RLE
  760. 51      1       byte    Reserved
  761. 52      2       word    Number Tracks (Max 32)
  762. 54      2       word    Number Patterns (Max 128)
  763. 56      2       word    Number Instruments (Max 128)
  764. 58      2       word    Song length (number patterns)
  765. 60      2       word    Master volume (S3M's Global Volume) (0-64)
  766. 62      2       word    Amplification/Mixing mode (S3M's Master volume)
  767.             0-32767 Amplification.
  768.                 FinalWaveForm = (Amplification x WaveForm) /256
  769.  
  770.             32768   Quality SHIFT mode. The final resultant waveform
  771.             -32775  is shifted x-32768 bits to the right (averaging).
  772.                 Valid only for 8-bit sound output.
  773.  
  774.             65535   Standard mixing mode. Lowest quality, but ensures
  775.                 no clipping is done.
  776. 64      1       byte    Song source
  777.             0=Unknown
  778.             1=AM Tracker
  779.             2=MOD/NST
  780.             3=S3M
  781.             4=MTM
  782.             5=669
  783.             6=XM
  784. 65      1       byte    Song-source-specific flags
  785.             AM:     Does not use this flag
  786.             MOD:
  787.             S3M:    Bit 0
  788.             XM:
  789. 66      4       dword   Number of bytes in extra data section
  790. 70      2       word    Native tracker version (HI:LO)
  791. 72      6       byte    Reserved
  792. 78      1       byte    Startup speed
  793. 79      1       byte    Startup tempo
  794.  
  795. TOTAL 80 bytes for header
  796.  
  797.  
  798. ──────────────────────────────────────────────────────────────────────────
  799. EXTRA DATA SECTION (HEADER EXTENSION)
  800. ──────────────────────────────────────────────────────────────────────────
  801. ?       ?       ?       Extra data (new extension to file format)
  802.  
  803. ──────────────────────────────────────────────────────────────────────────
  804. VARIABLE-SIZED INFO AFTER FIXED-SIZE HEADER
  805. ──────────────────────────────────────────────────────────────────────────
  806. NOT=Number Of Tracks
  807. NOP=Number of Patterns
  808. NOS=Number of sequences
  809.  
  810. 80      NOT     byte    Track startup pan/info flags.
  811.             0 (Left most)   64 (Middle)     128 (Right)
  812.             255=Disabled track
  813.             254=Surround (not supported yet)
  814.             Others: Planned for Adlib?
  815.  
  816. 80+NOT  NOS     word    Pattern sequence. Contains pattern numbers.
  817.             65535=End of song marker
  818.             65534=Skipped order (as in S3M)
  819.                 Note! This marker will not be used...it will,
  820.                 however, be present in the order list.
  821. 80+NOT  NOP     word    Number rows in pattern
  822. +NOS
  823.  
  824. ──────────────────────────────────────────────────────────────────────────
  825. PATTERNS (VARIABLE SIZED)
  826. ──────────────────────────────────────────────────────────────────────────
  827. 80+NOT  ?       ?       Patterns for Track 1
  828. +NOS
  829. +NOP
  830. ?       ?       ?       Patterns for Track x (Repeated for each tracks)
  831.             All patterns for one track are grouped together
  832.             into one chunk, sort of like the way MTM handles
  833.             music?
  834.  
  835.     --------------------------------------------------------------------
  836.     RAW PATTERN STRUC: (Used when loaded into memory or in unpacked pat)
  837.     --------------------------------------------------------------------
  838.     TotalNumberRowsInSong=Total of rows in all patterns.
  839.  
  840.     FOR 1 TO TotalNumberRowsInSong
  841.  
  842.     Byte    Note (Upper nibble=Octave Lower nibble=Note)
  843.         255     = No note
  844.         254     = Key off
  845.         Valid values: Octave 0-8
  846.                   Note 0-11 (0=C, 1=C#... 11=B)
  847.     Byte    Sample number
  848.         255     = No sample number
  849.     Byte    Volume effect (or other special effect)
  850.         00h-40h = Volume
  851.         41h-4Fh = Reserved
  852.         50h-5Fh = Volume slide down
  853.         60h-6Fh = Volume slide up
  854.         70h-7Fh = Fine volume slide down
  855.         80h-8Fh = Fine volume slide up
  856.         90h-9Fh = Set vibrato speed
  857.         A0h-AFh = Vibrato
  858.         B0h-BFh = Set panning
  859.         C0h-CFh = Panning slide left
  860.         D0h-DFh = Panning slide right
  861.         E0h-EFh = Tone porta
  862.         FFh     = Nothing
  863.     Byte    Effect number (Please see list of effects).
  864.         255     = No effect
  865.         Else,   if bit 7 set, it means that there is another effect
  866.         after this one, but ON THE SAME ROW.
  867.     Byte    Effect value
  868.  
  869.     ENDLOOP
  870.  
  871.  
  872.     -------------------------------------------
  873.     PACKED PATTERN FORMAT STRUC: (Used in file)
  874.     -------------------------------------------
  875.     dword   Length of compressed block excluding this 4-byte value.
  876.     ?       Event
  877.     ?       Event
  878.  
  879.     Events are coded in a one-byte header.
  880.     Byte    BIT 0 1=Note & instrument present
  881.             1 1=Volume present
  882.             2 1=Change in effect number
  883.             3 1=Change in effect data
  884.             4 \     Number empty rows after events (post-event RLE)
  885.             5  }--- This function is available only if PACKING METHOD 2
  886.             6 /     is used.
  887.             7 1=Event present (lower 4-bits has events)
  888.               0=Packed patterns
  889.               PACKING METHOD 1 or 2:
  890.               Bit 0-6 = Number empty rows-1
  891.  
  892.     IF THERE ARE EVENT(S) PRESENT, THESE BYTE(S) FOLLOW...
  893.     Byte    Note & Instrument (if present)
  894.     Byte    Volume column data (if present)
  895.     Byte    New effect number (if present)
  896.     Byte    New effect data (if present)
  897.  
  898.     I used change in effect number as opposed to present effect because
  899.     I notice many songs, particularly S3Ms by Purple Motion/Skaven
  900.     uses a same effect for more than 1 row. (Esp. Vibrato,etc...)
  901.     Thus, I took advantage of this to create smaller files.
  902.     For each track, by startup, the previous effect and effect data are
  903.     assumed to be 255 (no efx).
  904.     The RLE, however, *DOES NOT FALL INTO THIS CONTEXT*. It is purely
  905.     meant for really empty tracks, with all it's values 255 in memory.
  906.  
  907. ──────────────────────────────────────────────────────────────────────────
  908. INSTRUMENT STRUCTURES (VARIABLE SIZED)
  909. ──────────────────────────────────────────────────────────────────────────
  910. ?       ?       struc   Instrument1 structure with sample headers
  911. ?       ?       struc   Instrument2 structure with sample headers
  912. :       :       :       :
  913. :       :       :       :
  914. ?       ?       struc   InstrumentX structure with sample headers
  915.  
  916. Instrument structures are similar to the AMI header.
  917.  
  918. ──────────────────────────────────────────────────────────────────────────
  919. SAMPLE DATA (VARIABLE SIZED)
  920. ──────────────────────────────────────────────────────────────────────────
  921. ?       ?       ?       Sample data stored in sequential order
  922.             Instrument 1:Smp1,2,3....
  923.             Instrument 2:Smp1,2,3....
  924.                    :
  925.                    :
  926.             Instrument X:Smp1,2,3....
  927.  
  928. ──────────────────────────────────────────────────────────────────────────
  929. SPECIAL DATA (VARIABLE SIZED)
  930. ──────────────────────────────────────────────────────────────────────────
  931. ?       ?       ?       Special data (ignored by AM4)
  932.             Actual data here is NOT PART of the AMM module.
  933.  
  934.  
  935. *END OF AMM MODULE*
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956. ──────────────────────────────────────────────────────────────────────────
  957. INSTRUMENT SAMPLE STRUCTURES
  958. ──────────────────────────────────────────────────────────────────────────
  959. ?       80      struc   Sample1 structure
  960. ?       80      struc   Sample2 structure
  961. ?       80      struc   Sample2 structure
  962. :       :       :       :
  963. :       :       :       :
  964. ?       80      struc   SampleX structure
  965.  
  966. Sample structures are similar to the AMS header.
  967.  
  968. ──────────────────────────────────────────────────────────────────────────
  969. SAMPLE DATA
  970. ──────────────────────────────────────────────────────────────────────────
  971. ?       ?       ?       Sample data stored in sequential order
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981. SELECT ENVELOPE NUMBER
  982. ETC..
  983.  
  984.  
  985. WAH!
  986.  
  987.     ▒
  988.     ▒ We cannot use change in efx number/param because the loader is
  989.     ▒ an optimizing loader. Take for example, in a row, we have 4
  990.     ▒ effects places.
  991.     ▒         Efx1    Efx2    Efx3    Efx4
  992.     ▒ Now, suppose that Efx1 and Efx3 are used. But Efx2 and Efx4 are
  993.     ▒ not. Out optimizing loader will move Efx3 to Efx2s place. And
  994.     ▒ we'll need only to chain 2.
  995.  
  996.  
  997. SHIT...WHY NOT LIMIT IT TO 4 EFFECTS (OR IF RERALLY NECESSARY, 8)
  998.  
  999. DON'T FORGET *GLOBAL EFFECTS* !!
  1000.  
  1001.     ▒
  1002.     ▒ This could pose problems when Efx3 requires that we use the
  1003.     ▒ previous Efx3's parameter! One solution is to make the import
  1004.     ▒ loader in such a way that, it checks the previous Efx3's value,
  1005.     ▒ and poke in the value itself (that is, replace 00 with the
  1006.     ▒ ACTUAL value). This is rather inefficient where file size is
  1007.     ▒ concerned.
  1008.     ▒
  1009.     ▒ A probably easier (but memory/disk inefficient) method, is to
  1010.     ▒ chain even empty Efx2 (But not Efx4, as it's the last Efx and
  1011.     ▒ it's unused). And our music player would probably keep track of
  1012.     ▒ up to 4 effects per channel. That way, we can keep track of
  1013.     ▒ the 'previous value'. But this method has several limitations.
  1014.     ▒ Namely,
  1015.     ▒         ■ Some flag state/etc... stuffs are shared by the same
  1016.     ▒           channel. For example, slide to note speed. We only
  1017.     ▒           have one of it...that is, for that particular channel.
  1018.     ▒           However, if there are 2 slide to notes (not necessarily
  1019.     ▒           on the same row), we'll only keep track of the last one's
  1020.     ▒           speed. (really stupid to use 2 slide to notes anyway. But
  1021.     ▒           problems *could* arise...hmmm...maybe not).
  1022.     ▒           We could increase them...buthmmm...inefficient...
  1023.     ▒           redundant!
  1024.     ▒         ■
  1025.     ▒
  1026.     ▒ AM4 currently uses the latter approach. (We'll just ignore the
  1027.     ▒ 2 slide to notes). It's much easier...and not very memory
  1028.     ▒ consuming! (Sort of!)
  1029.  
  1030.  
  1031. 1=Xtended effects present
  1032.  
  1033.     ▒
  1034.     ▒TRAK:-------------------------------------------------
  1035.     ▒ Ranges from 0-255. A prractical range is 1-15 (0 is not
  1036.     ▒ required, as the default value on start of each row = 0).
  1037.     ▒ Useful to skip empty tracks if there are more than 1
  1038.     ▒ empty tracks in between 2 used tracks.
  1039.     ▒
  1040.     ▒NOTE:-------------------------------------------------
  1041.     ▒ xxxxyyyy
  1042.     ▒       xxxx = Octave (0-15) (!)
  1043.     ▒       yyyy = Note (0-11)
  1044.     ▒       255  = Key off
  1045.     ▒
  1046.     ▒INSTRUMENT:-------------------------------------------
  1047.     ▒ Ranges from 1-255. 0=Use previous instrument!?????
  1048.     ▒
  1049.     ▒EFFECT NUMBER:----------------------------------------
  1050.     ▒ Ranges from 1-127. 0=No efx (It IS not effect anyway...)
  1051.     ▒ If bit 7 is set, extended effect follows after this efx.
  1052.     ▒ (Only set in extended effects. Normal main effects doesn't
  1053.     ▒ use this flag, but one in the main flag.)
  1054.     ▒
  1055.     ▒EFFECT DATA:------------------------------------------
  1056.     ▒ Usually a 1-byte value. But can be more or variable sized,
  1057.     ▒ depending on the effect itself.
  1058.     ▒
  1059.     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  1060.  
  1061.  
  1062. ==========================================================================
  1063. PATTERNS
  1064. ==========================================================================
  1065.  
  1066.  
  1067. *********************************************************************
  1068. *********************************************************************
  1069. *********************************************************************
  1070. *********************************************************************
  1071. *********************************************************************
  1072. *********************************************************************
  1073. *********************************************************************
  1074. *********************************************************************
  1075. *********************************************************************
  1076. *********************************************************************
  1077.  
  1078. PROBLEM!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
  1079.     WE CAN'T USE PARAMETER 0 IN EXTENDED COMMANDS TO CONTINUE PREVIOUS!
  1080.     THIS IS BECAUSE WE DON'T KNOW WHAT'S IN THE PREVIOUS CHANNEL'S
  1081.     PARAM!
  1082.     WE CAN'T KEEP TRACK OF ALL EFFECTS.
  1083.     SO, THE DECODER ROUTINE WILL SET EFFECT PARAM 00 TO THE PREV
  1084.     EFFECT IS REQUIRED??
  1085.     NO NEED THAT FOR THE MAIN PARAM...
  1086.  
  1087. No effect parameter size is present. All of that is done by the music player.
  1088. Players does that by keeping a table of parameter length for all effects.
  1089. If set to 255, it means that a it's a variable-sized parameter, and
  1090. a word follows after the effect number. This word contains the number of
  1091. bytes in parameter. (0-65535 bytes for param!)
  1092.  
  1093. *********************************************************************
  1094. *********************************************************************
  1095. *********************************************************************
  1096. *********************************************************************
  1097. *********************************************************************
  1098. *********************************************************************
  1099. *********************************************************************
  1100. *********************************************************************
  1101. *********************************************************************
  1102. *********************************************************************
  1103.  
  1104.  
  1105.  
  1106. xxxxxx = Effect number
  1107.  
  1108.  
  1109. 0       Note
  1110. 1       Inst changed(? Probably not good -- empty rows!)
  1111. 2       Vol
  1112. 3       Efx num
  1113. 4       Efx param
  1114. 5       x
  1115. 6       x               xx=Number of extra effects (Must have both num and param)
  1116. 7       1
  1117.  
  1118. OR ...
  1119.  
  1120. 0       Note
  1121. 1       Inst
  1122. 2       Vol
  1123. 3       Efx num
  1124. 4       Efx param
  1125. 5       x
  1126. 6       1=Extended data present. If set, the bytes after
  1127.     [note][inst][vol][efxnum][efxparam] will be another flag. It is
  1128.     shown below...
  1129. 7       1
  1130.  
  1131. Extended data flag:
  1132. 0       x
  1133. 1       x
  1134. 2       x
  1135. 3       x
  1136. 4       x
  1137. 5       x
  1138. 6       1=8-bit Length of follows
  1139. 7       1=Another extended data flag after this data (Chains - UNLiMiTED!!)
  1140.  
  1141. xxxxx = Efx number
  1142. Followed after that is the effect data (might not be an effect...could
  1143. be a lyric/etc...)
  1144.  
  1145. Then, if another extended data flag is present, it will be here, and the
  1146. whole process repeats...etc...blah blah...
  1147.  
  1148.  
  1149.  
  1150.  
  1151. Note:   xyyyzzzz
  1152.     x   = Note/Flag bit. 0=Note 1=Flags
  1153.     yyy = Octave
  1154.     zzzz= Note
  1155.     7Fh = Stop sound
  1156.  
  1157.  
  1158.  
  1159.