home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / it214v3.zip / ITTECH.TXT < prev    next >
Text File  |  1997-11-11  |  47KB  |  908 lines

  1.  
  2.                              Impulse Header Layout
  3.  
  4.         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  5.       ┌───┬───┬───┬───┬───────────────────────────────────────────────┐
  6. 0000: │'I'│'M'│'P'│'M'│ Song Name, max 26 characters, includes NULL   │
  7.       ├───┴───┴───┴───┴───────────────────────────────────────┬───────┤
  8. 0010: │.......................................................│PHiligt│
  9.       ├───────┬───────┬───────┬───────┬───────┬───────┬───────┼───────┤
  10. 0020: │OrdNum │InsNum │SmpNum │PatNum │ Cwt/v │ Cmwt  │ Flags │Special│
  11.       ├───┬───┼───┬───┼───┬───┼───────┼───────┴───────┼───────┴───────┤
  12. 0030: │GV │MV │IS │IT │Sep│PWD│MsgLgth│Message Offset │   Reserved    │
  13.       ├───┴───┴───┴───┴───┴───┴───────┴───────────────┴───────────────┤
  14. 0040: │ Chnl Pan (64 bytes)...........................................│
  15.       ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┤
  16.  
  17.       ├───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┤
  18. 0080: │ Chnl Vol (64 bytes)...........................................│
  19.       ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┤
  20.  
  21.       ├───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┤
  22. 00C0: │ Orders, Length = OrdNum                                       │
  23.       ├───────────────────────────────────────────────────────────────┤
  24. xxxx: │ 'Long' Offset of instruments, Length = InsNum*4 (1)           │
  25.       ├───────────────────────────────────────────────────────────────┤
  26. xxxx: │ 'Long' Offset of samples headers, Length = SmpNum*4 (2)       │
  27.       ├───────────────────────────────────────────────────────────────┤
  28. xxxx: │ 'Long' Offset of patterns, Length = PatNum*4 (3)              │
  29.       └───────────────────────────────────────────────────────────────┘
  30.  
  31.       (1) Offset = 00C0h+OrdNum
  32.       (2) Offset = 00C0h+OrdNum+InsNum*4
  33.       (3) Offset = 00C0h+OrdNum+InsNum*4+SmpNum*4
  34.  
  35.         Note that if the (long) offset to a pattern = 0, then the
  36.         pattern is assumed to be a 64 row empty pattern.
  37.  
  38.       PHiliht = Pattern row hilight information. Only relevant for pattern
  39.                 editing situations.
  40.  
  41.       Cwt:      Created with tracker.
  42.                  Impulse Tracker y.xx = 0yxxh
  43.       Cmwt:     Compatible with tracker with version greater than value.
  44.                  (ie. format version)
  45.       OrdNum:   Number of orders in song.
  46.       InsNum:   Number of instruments in song
  47.       SmpNum:   Number of samples in song
  48.       PatNum:   Number of patterns in song
  49.       Flags:    Bit 0: On = Stereo, Off = Mono
  50.                 Bit 1: Vol0MixOptimizations - If on, no mixing occurs if
  51.                        the volume at mixing time is 0 (redundant v1.04+)
  52.                 Bit 2: On = Use instruments, Off = Use samples.
  53.                 Bit 3: On = Linear slides, Off = Amiga slides.
  54.                 Bit 4: On = Old Effects, Off = IT Effects
  55.                         Differences:
  56.                        - Vibrato is updated EVERY frame in IT mode, whereas
  57.                           it is updated every non-row frame in other formats.
  58.                           Also, it is two times deeper with Old Effects ON
  59.                        - Command Oxx will set the sample offset to the END
  60.                          of a sample instead of ignoring the command under
  61.                          old effects mode.
  62.                        - (More to come, probably)
  63.                 Bit 5: On = Link Effect G's memory with Effect E/F. Also
  64.                             Gxx with an instrument present will cause the
  65.                             envelopes to be retriggered. If you change a
  66.                             sample on a row with Gxx, it'll adjust the
  67.                             frequency of the current note according to:
  68.  
  69.                               NewFrequency = OldFrequency * NewC5 / OldC5;
  70.                 Bit 6: Use MIDI pitch controller, Pitch depth given by PWD
  71.                 Bit 7: Request embedded MIDI configuration
  72.                        (Coded this way to permit cross-version saving)
  73.  
  74.       Special:  Bit 0: On = song message attached.
  75.                        Song message:
  76.                         Stored at offset given by "Message Offset" field.
  77.                         Length = MsgLgth.
  78.                         NewLine = 0Dh (13 dec)
  79.                         EndOfMsg = 0
  80.  
  81.                        Note: v1.04+ of IT may have song messages of up to
  82.                              8000 bytes included.
  83.                 Bit 1: Reserved
  84.                 Bit 2: Reserved
  85.                 Bit 3: MIDI configuration embedded
  86.                 Bit 4-15: Reserved
  87.  
  88.       GV:       Global volume. (0->128) All volumes are adjusted by this
  89.       MV:       Mix volume (0->128) During mixing, this value controls
  90.                 the magnitude of the wave being mixed.
  91.       IS:       Initial Speed of song.
  92.       IT:       Initial Tempo of song
  93.       Sep:      Panning separation between channels (0->128, 128 is max sep.)
  94.       PWD:      Pitch wheel depth for MIDI controllers
  95.       Chnl Vol: Volume for each channel. Ranges from 0->64
  96.       Chnl Pan: Each byte contains a panning value for a channel. Ranges from
  97.                  0 (absolute left) to 64 (absolute right). 32 = central pan,
  98.                  100 = Surround sound.
  99.                  +128 = disabled channel (notes will not be played, but note
  100.                                           that effects in muted channels are
  101.                                           still processed)
  102.       Orders:   This is the order in which the patterns are played.
  103.                  Valid values are from 0->199.
  104.                  255 = "---", End of song marker
  105.                  254 = "+++", Skip to next order
  106.  
  107.  
  108.                   Old Impulse Instrument Format (cmwt < 200h)
  109.  
  110.         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  111.       ┌───┬───┬───┬───┬───────────────────────────────────────────────┐
  112. 0000: │'I'│'M'│'P'│'I'│ DOS FileName (12345678.123)                   │
  113.       ├───┼───┼───┼───┼───┬───┬───┬───┬───────┬───┬───┬───────┬───┬───┤
  114. 0010: │00h│Flg│VLS│VLE│SLS│SLE│ x │ x │FadeOut│NNA│DNC│TrkVers│NoS│ x │
  115.       ├───┴───┴───┴───┴───┴───┴───┴───┴───────┴───┴───┴───────┴───┴───┤
  116. 0020: │ Instrument Name, max 26 bytes, includes NUL...................│
  117.       ├───────────────────────────────────────┬───┬───┬───┬───┬───┬───┤
  118. 0030: │.......................................│ x │ x │ x │ x │ x │ x │
  119.       ├───────────────────────────────────────┴───┴───┴───┴───┴───┴───┤
  120. 0040: │ Note-Sample/Keyboard Table, Length = 240 bytes................│
  121.       ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┤
  122.  
  123.       ├───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┤
  124. 0130: │ Volume envelope (200 bytes)...................................│
  125.       ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┤
  126.  
  127.                                       ├───┴───┴───┴───┴───┴───┴───┴───┤
  128. 01F8:                                 │ Node points (25x2 bytes)......│
  129.                                       └───────────────────────────────┘
  130.  
  131.         Total length of old instrument header is 554 bytes.
  132.  
  133.       Flg:      Bit 0. On = Use volume envelope
  134.                 Bit 1. On = Use volume loop
  135.                 Bit 2. On = Use sustain volume loop
  136.       VLS:      Volume loop start (node number)
  137.       VLE:      Volume loop end (node number)
  138.       SLS:      Sustain loop start (node number)
  139.       SLE:      Sustain loop end (node number)
  140.       FadeOut:  Ranges between 0 and 64, but the fadeout "Count" is 512.
  141.                 Fade applied when:
  142.                 1) Note fade NNA is selected and triggered (by another note)
  143.                 2) Note off NNA is selected with no volume envelope
  144.                    or volume envelope loop
  145.                 3) Volume envelope end is reached
  146.  
  147.       DNC:      Duplicate note check (0 = Off, 1 = On)
  148.       NNA:      New note action:
  149.                         0 = Note cut
  150.                         1 = Note continue
  151.                         2 = Note off
  152.                         3 = Note fade
  153.  
  154.       TrkVers:  Tracker version used to save the instrument. This is only
  155.                 used in the instrument files.
  156.       NoS:      Number of samples associated with instrument. This is only
  157.                 used in the instrument files.
  158.  
  159.       Note-Sample/Keyboard Table.
  160.        Each note of the instrument is first converted to a sample number
  161.        and a note (C-0 -> B-9). These are stored as note/sample pairs
  162.        (note first, range 0->119 for C-0 to B-9, sample ranges from
  163.        1-99, 0=no sample)
  164.  
  165.        Volume envelope: Values from 0->64, 0FFh indicating end of envelope.
  166.        (after which note fade applies)
  167.  
  168.       Node data: Tick THEN magnitude
  169.  
  170.  
  171.  
  172.                            Impulse Instrument Format
  173.  
  174.         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  175.       ┌───┬───┬───┬───┬───────────────────────────────────────────────┐
  176. 0000: │'I'│'M'│'P'│'I'│ DOS FileName (12345678.123)                   │
  177.       ├───┼───┼───┼───┼───────┬───┬───┬───┬───┬───┬───┬───────┬───┬───┤
  178. 0010: │00h│NNA│DCT│DCA│FadeOut│PPS│PPC│GbV│DfP│RV │RP │TrkVers│NoS│ x │
  179.       ├───┴───┴───┴───┴───────┴───┴───┴───┴───┴───┴───┴───────┴───┴───┤
  180. 0020: │ Instrument Name, max 26 bytes, includes NUL...................│
  181.       ├───────────────────────────────────────┬───┬───┬───┬───┬───────┤
  182. 0030: │.......................................│IFC│IFR│MCh│MPr│MIDIBnk│
  183.       ├───────────────────────────────────────┴───┴───┴───┴───┴───────┤
  184. 0040: │ Note-Sample/Keyboard Table, Length = 240 bytes................│
  185.       ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┤
  186.  
  187.       ├───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┤
  188. 0130: │ Envelopes.....................................................│
  189.       ├───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┤
  190.  
  191.         IFC = Initial Filter cutoff
  192.         IFR = Initial Filter resonance
  193.  
  194.         NNA = New Note Action
  195.                 0 = Cut                 1 = Continue
  196.                 2 = Note off            3 = Note fade
  197.  
  198.         DCT = Duplicate Check Type
  199.                 0 = Off                 1 = Note
  200.                 2 = Sample              3 = Instrument
  201.  
  202.         DCA: Duplicate Check Action
  203.                 0 = Cut
  204.                 1 = Note Off
  205.                 2 = Note fade
  206.  
  207.       FadeOut:  Ranges between 0 and 128, but the fadeout "Count" is 1024
  208.                 See the Last section on how this works.
  209.                 Fade applied when:
  210.                 1) Note fade NNA is selected and triggered (by another note)
  211.                 2) Note off NNA is selected with no volume envelope
  212.                    or volume envelope loop
  213.                 3) Volume envelope end is reached
  214.  
  215.         PPS: Pitch-Pan separation, range -32 -> +32
  216.         PPC: Pitch-Pan center: C-0 to B-9 represented as 0->119 inclusive
  217.  
  218.         GbV: Global Volume, 0->128
  219.         DfP: Default Pan, 0->64, &128 => Don't use
  220.         RV: Random volume variation (percentage)
  221.         RP: Random panning variation (panning change - not implemented yet)
  222.  
  223.         MCh = MIDI Channel
  224.         MPr = MIDI Program (Instrument)
  225.  
  226.       TrkVers:  Tracker version used to save the instrument. This is only
  227.                 used in the instrument files.
  228.       NoS:      Number of samples associated with instrument. This is only
  229.                 used in the instrument files.
  230.  
  231.       Note-Sample/Keyboard Table.
  232.        Each note of the instrument is first converted to a sample number
  233.        and a note (C-0 -> B-9). These are stored as note/sample byte pairs
  234.        (note first, range 0->119 for C-0 to B-9, sample ranges from
  235.        1-99, 0=no sample)
  236.  
  237.                                 Envelope layout
  238.  
  239.         Envelopes: 3 structures, first for volume (130h), second for
  240.                    panning (182h), third for pitch (1D4h).
  241.  
  242.                    Each is structured as such:
  243.  
  244.         0   1   2   3   4   5   6.......
  245.       ┌───┬───┬───┬───┬───┬───┬───────────────────────────────────┬───┐
  246. xxxx: │Flg│Num│LpB│LpE│SLB│SLE│ Node points, 25 sets, 75 bytes....│ x │
  247.       ├───┼───┼───┼───┼───┼───┼───┬───┬───┬───┬───┬───┬───┬───┬───┼───┤
  248.  
  249.         Flg: Bit 0: Envelope on/off, 1 = on, 0 = off
  250.              Bit 1: Loop on/off, 1 = on, 0 = off
  251.              Bit 2: SusLoop on/off, 1 = on, 0 = off
  252.  
  253.         For Pitch envelope only:
  254.              Bit 7: Use pitch envelope as filter envelope instead.
  255.  
  256.         Num = Number of node points
  257.  
  258.         LpB = Loop beginning            SLB = Sustain loop beginning
  259.         LpE = Loop end                  SLE = Sustain loop end
  260.  
  261.         Node point = 1 byte for y-value
  262.                         (0->64 for vol, -32->+32 for panning or pitch)
  263.                      1 word (2 bytes) for tick number (0->9999)
  264.  
  265.         Total length of an instrument is 547 bytes, but 554 bytes are
  266.         written, just to simplify the loading of the old format. (Hence
  267.         there are 7 'wasted' bytes per instrument)
  268.  
  269.  
  270.  
  271.                              Impulse Sample Format
  272.  
  273.         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  274.       ┌───┬───┬───┬───┬───────────────────────────────────────────────┐
  275. 0000: │'I'│'M'│'P'│'S'│ DOS Filename (12345678.123)                   │
  276.       ├───┼───┼───┼───┼───────────────────────────────────────────────┤
  277. 0010: │00h│GvL│Flg│Vol│ Sample Name, max 26 bytes, includes NUL.......│
  278.       ├───┴───┴───┴───┴───────────────────────────────────────┬───┬───┤
  279. 0020: │.......................................................│Cvt│DfP│
  280.       ├───────────────┬───────────────┬───────────────┬───────┴───┴───┤
  281. 0030: │ Length        │ Loop Begin    │ Loop End      │ C5Speed       │
  282.       ├───────────────┼───────────────┼───────────────┼───┬───┬───┬───┤
  283. 0040: │ SusLoop Begin │ SusLoop End   │ SamplePointer │ViS│ViD│ViR│ViT│
  284.       └───────────────┴───────────────┴───────────────┴───┴───┴───┴───┘
  285.  
  286. The cache file has the following pieces of information added on:
  287.  
  288.         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  289.       ┌───────────────┬───────┬───────┬───┬───────────────────────────┐
  290. 0050: │ File Size     │ Date  │ Time  │Fmt│...........................│
  291.       └───────────────┴───────┴───────┴───┴───────────────────────────┘
  292.  
  293.         Fmt. 0 = unchecked. 1 = directory, 2 = it sample, 3 = st sample
  294.  
  295.  
  296.       GvL:      Global volume for instrument, ranges from 0->64
  297.       Flg:      Bit 0. On = sample associated with header.
  298.                 Bit 1. On = 16 bit, Off = 8 bit.
  299.                 Bit 2. On = stereo, Off = mono. Stereo samples not supported yet
  300.                 Bit 3. On = compressed samples.
  301.                 Bit 4. On = Use loop
  302.                 Bit 5. On = Use sustain loop
  303.                 Bit 6. On = Ping Pong loop, Off = Forwards loop
  304.                 Bit 7. On = Ping Pong Sustain loop, Off = Forwards Sustain loop
  305.       Vol:      Default volume for instrument
  306.  
  307.       Length:   Length of sample in no. of samples NOT no. of bytes
  308.       LoopBeg:  Start of loop (no of samples in, not bytes)
  309.       Loop End: Sample no. AFTER end of loop
  310.       C5Speed:  Number of bytes a second for C-5 (ranges from 0->9999999)
  311.       SusLBeg:  Start of sustain loop
  312.       SusLEnd:  Sample no. AFTER end of sustain loop
  313.  
  314.       SmpPoint: 'Long' Offset of sample in file.
  315.  
  316.       ViS:      Vibrato Speed, ranges from 0->64
  317.       ViD:      Vibrato Depth, ranges from 0->64
  318.       ViT:      Vibrato waveform type.
  319.                         0=Sine wave
  320.                         1=Ramp down
  321.                         2=Square wave
  322.                         3=Random (speed is irrelevant)
  323.       ViR:      Vibrato Rate, rate at which vibrato is applied (0->64)
  324.  
  325.         The depth of the vibrato at any point is worked out in the following
  326.         way:
  327.           Every processing cycle, the following occurs:
  328.                 1) Mov AX, [SomeVariableNameRelatingToVibrato]
  329.                 2) Add AL, Rate
  330.                 3) AdC AH, 0
  331.                 4) AH contains the depth of the vibrato as a fine-linear slide.
  332.                 5) Mov [SomeVariableNameRelatingToVibrato], AX  ; For the next
  333.                                                                 ; cycle.
  334.  
  335.         For those that don't understand assembly, then the depth is
  336.         basically the running-sum of the rate divided by 256.
  337.  
  338.         Sample vibrato uses a table 256-bytes long
  339.  
  340.    Convert - bits other than bit 0 are used internally for the loading
  341.              of alternative formats.
  342.         Bit 0:
  343.          Off: Samples are unsigned   } IT 2.01 and below use unsigned samples
  344.           On: Samples are signed     } IT 2.02 and above use signed samples
  345.         Bit 1:
  346.          Off: Intel lo-hi byte order for 16-bit samples    } Safe to ignore
  347.          On: Motorola hi-lo byte order for 16-bit samples  } these values...
  348.         Bit 2:                                             }
  349.          Off: Samples are stored as PCM values             }
  350.           On: Samples are stored as Delta values           }
  351.         Bit 3:                                             }
  352.           On: Samples are stored as byte delta values      }
  353.               (for PTM loader)                             }
  354.         Bit 4:                                             }
  355.           On: Samples are stored as TX-Wave 12-bit values  }
  356.         Bit 5:                                             }
  357.           On: Left/Right/All Stereo prompt                 }
  358.         Bit 6: Reserved
  359.         Bit 7: Reserved
  360.  
  361.    DfP - Default Pan. Bits 0->6 = Pan value, Bit 7 ON to USE (opposite of inst)
  362.  
  363.  
  364.  
  365.                              Impulse Pattern Format
  366.  
  367.         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  368.       ┌───────┬───────┬───┬───┬───┬───┬───────────────────────────────┐
  369. 0000: │Length │ Rows  │ x │ x │ x │ x │ Packed data................   │
  370.       ├───┬───┼───┬───┼───┼───┼───┼───┼───┬───┬───┬───┬───┬───┬───┬───┤
  371.  
  372.       Length:   Length of packed pattern, not including the 8 byte header
  373.                 Note that the pattern + the 8 byte header will ALWAYS
  374.                 be less than 64k
  375.       Rows:     Number of rows in this pattern (Ranges from 32->200)
  376.  
  377.       Patterns are unpacked by the following pseudocode... (this may look
  378.       horrible, but in practise, it's just as convenient as the S3M
  379.       pattern format for playback (but not for display))
  380.  
  381.       GetNextChannelMarker:
  382.         Read byte into channelvariable.
  383.         if(channelvariable = 0) then end of row
  384.         Channel = (channelvariable-1) & 63              ; Channel is 0 based.
  385.         if(channelvariable & 128) then read byte into maskvariable
  386.           else maskvariable = previousmaskvariable for current channel
  387.  
  388.         if(maskvariable & 1), then read note. (byte value)
  389.                 // Note ranges from 0->119 (C-0 -> B-9)
  390.                 // 255 = note off, 254 = notecut
  391.                 // Others = note fade (already programmed into IT's player
  392.                 //                     but not available in the editor)
  393.  
  394.         if(maskvariable & 2), then read instrument (byte value)
  395.                 // Instrument ranges from 1->99
  396.  
  397.         if(maskvariable & 4), then read volume/panning (byte value)
  398.                 // Volume ranges from 0->64
  399.                 // Panning ranges from 0->64, mapped onto 128->192
  400.                 // Prepare for the following also:
  401.                 //  65->74 = Fine volume up
  402.                 //  75->84 = Fine volume down
  403.                 //  85->94 = Volume slide up
  404.                 //  95->104 = Volume slide down
  405.                 //  105->114 = Pitch Slide down
  406.                 //  115->124 = Pitch Slide up
  407.                 //  193->202 = Portamento to
  408.                 //  203->212 = Vibrato
  409.  
  410.         Effects 65 is equivalent to D0F, 66 is equivalent to D1F -> 74 = D9F
  411.         Similarly for 75-84 (DFx), 85-94 (Dx0), 95->104 (D0x).
  412.  
  413.         (Fine) Volume up/down all share the same memory (NOT shared with Dxx
  414.         in the effect column tho).
  415.  
  416.         Pitch slide up/down affect E/F/(G)'s memory - a Pitch slide
  417.         up/down of x is equivalent to a normal slide by x*4
  418.  
  419.         Portamento to (Gx) affects the memory for Gxx and has the equivalent
  420.         slide given by this table:
  421.  
  422.         SlideTable      DB      1, 4, 8, 16, 32, 64, 96, 128, 255
  423.  
  424.         Vibrato uses the same 'memory' as Hxx/Uxx.
  425.  
  426.         if(maskvariable & 8), then read command (byte value) and commandvalue
  427.                 // Valid ranges from 0->31 (0=no effect, 1=A, 2=B, 3=C, etc.)
  428.  
  429.         if(maskvariable & 16), then note = lastnote for channel
  430.         if(maskvariable & 32), then instrument = lastinstrument for channel
  431.         if(maskvariable & 64), then volume/pan = lastvolume/pan for channel
  432.         if(maskvariable & 128), then {
  433.                 command = lastcommand for channel and
  434.                 commandvalue = lastcommandvalue for channel
  435.         }
  436.         Goto GetNextChannelMarker
  437.  
  438.  
  439.  
  440.                                   Mathematics
  441.  
  442. Abbreviations:
  443.  FV = Final Volume (Ranges from 0 to 128). In versions 1.04+, mixed output
  444.       devices are reduced further to a range from 0 to 64 due to lack of
  445.       memory.
  446.  Vol = Volume at which note is to be played. (Ranges from 0 to 64)
  447.  SV = Sample Volume (Ranges from 0 to 64)
  448.  IV = Instrument Volume (Ranges from 0 to 128)
  449.  CV = Channel Volume (Ranges from 0 to 64)
  450.  GV = Global Volume (Ranges from 0 to 128)
  451.  VEV = Volume Envelope Value (Ranges from 0 to 64)
  452.  
  453. In Sample mode, the following calculation is done:
  454.  FV = Vol * SV * CV * GV / 262144               ; Note that 262144 = 2^18
  455.                                                 ; So bit shifting can be done.
  456.  
  457. In Instrument mode the following procedure is used:
  458.  
  459.  1) Update volume envelope value. Check for loops / end of envelope.
  460.  2) If end of volume envelope (ie. position >= 200 or VEV = 0FFh), then turn
  461.         on note fade.
  462.  3) If notefade is on, then NoteFadeComponent (NFC) = NFC - FadeOut
  463.         ; NFC should be initialised to 1024 when a note is played.
  464.  4) FV = Vol * SV * IV * CV * GV * VEV * NFC / 2^41
  465.  
  466. Linear slides work like this:
  467.  Final frequency = Original frequency * 2^(SlideValue/768)
  468.  
  469. (I used a lookup table for the multipliers here)
  470.  
  471. For command Exx, SlideValue = -4*EffectValue
  472. For command EEx, SlideValue = -EffectValue
  473. For command Fxx, SlideValue = 4*EffectValue
  474. For command FEx, SlideValue = EffectValue
  475.  
  476. Note that sample vibrato always uses Linear slides.
  477.  
  478. Notes about effects (as compared to other module formats)
  479.  
  480. C               This is now in *HEX*. (Used to be in decimal in ST3)
  481. E/F/G/H/U       You need to check whether the song uses Amiga/Linear slides.
  482. H/U             Vibrato in Impulse Tracker is two times finer than in
  483.                 any other tracker and is updated EVERY tick.
  484.                 If "Old Effects" is *ON*, then the vibrato is played in the
  485.                 normal manner (every non-row tick and normal depth)
  486. E/F/G           These commands ALL share the same memory.
  487. Oxx             Offsets to samples are to the 'xx00th' SAMPLE. (ie. for
  488.                 16 bit samples, the offset is xx00h*2)
  489.                 Oxx past the sample end will be ignored, unless "Old Effects"
  490.                 is ON, in which case the Oxx will play from the end of the
  491.                 sample.
  492. Yxy             This uses a table 4 times larger (hence 4 times slower) than
  493.                 vibrato or tremelo. If the waveform is set to random, then
  494.                 the 'speed' part of the command is interpreted as a delay.
  495.  
  496. If you read through this document and there are ANY points which you have
  497. troubles with (and have to try out), then let me know - because someone
  498. else will have the same questions - and I'd like to make this DOC as easy
  499. to understand as possible.
  500.  
  501. For Panning....
  502.  Here's the rough procedure used:
  503.  
  504.   NotePan = ChannelPan
  505.   if InstrumentPan=On then NotePan = InstrumentPan
  506.   NotePan = NotePan+(InstrumentNote-PPCenter)*PPSeparation/8
  507.  
  508. Pitch Envelopes
  509.  Each value on the envelope equates to half a semitone. This is interpolated
  510.  64 times for smooth pitch sliding. Positive values indicate a pitch variation
  511.  UP of x semitones, negative values indicate a pitch variation down.
  512.  
  513.                                   General Info
  514.  
  515. The player in Impulse Tracker 'allocates' channels to notes whenever they
  516. are *PLAYED*. In sample mode, the allocation is simple:
  517.                Virtual Channel (number) = 'Host' channel (number)
  518.  
  519. In instrument mode, the following procedure is used:
  520.  
  521.     Check if channel is already playing ---Yes--> set 'background' flag on.
  522.                 |                                 'Trigger' NNA. If NNA=cut,
  523.                 No                                then use this virtual
  524.                 |                                 channel.
  525.                 |                                          |
  526.                 |<------------------ else -----------------/
  527.                 |
  528.                 v
  529.     Search and find the first non-active virtual channel.
  530.                 |
  531.     Non-active channel found? ----Yes----> Use this for playback.
  532.                 |
  533.                 No
  534.                 |
  535.                 v
  536.    Search through and find the channel of lowest volume that is in the     #
  537.    'background' (ie. no longer controlled directly)                        #
  538.                 |                                                          #
  539.    Background channel found? ----Yes----> Use this for playback.           #
  540.                 |                                                          #
  541.                 No                                                         #
  542.                 |                                                          #
  543.                 v                                                          #
  544.    Return error - the note is *NOT* allocated a channel, and hence is not  #
  545.    played.                                                                 #
  546.  
  547.    This is actually quite a simple process... just that it's another of
  548.    those 'hassles' to have to write...
  549.  
  550.    ### Note: This is by far the simplest implementation of congestion
  551.              resolution. IT 2.03 and above have a greatly enhanced
  552.              method which more selectively removes the most insignificant
  553.              channel. Obviously, there is no best way to do this - I
  554.              encourage you to experiment and find new algorithms for
  555.              yourself.
  556.  
  557.  
  558.  
  559.                                 Internal Tables
  560.  
  561. FineSineData       Label   Byte
  562.         DB       0,  2,  3,  5,  6,  8,  9, 11, 12, 14, 16, 17, 19, 20, 22, 23
  563.         DB      24, 26, 27, 29, 30, 32, 33, 34, 36, 37, 38, 39, 41, 42, 43, 44
  564.         DB      45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59
  565.         DB      59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 64, 64
  566.         DB      64, 64, 64, 64, 64, 64, 63, 63, 63, 62, 62, 62, 61, 61, 60, 60
  567.         DB      59, 59, 58, 57, 56, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46
  568.         DB      45, 44, 43, 42, 41, 39, 38, 37, 36, 34, 33, 32, 30, 29, 27, 26
  569.         DB      24, 23, 22, 20, 19, 17, 16, 14, 12, 11,  9,  8,  6,  5,  3,  2
  570.         DB       0, -2, -3, -5, -6, -8, -9,-11,-12,-14,-16,-17,-19,-20,-22,-23
  571.         DB     -24,-26,-27,-29,-30,-32,-33,-34,-36,-37,-38,-39,-41,-42,-43,-44
  572.         DB     -45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56,-56,-57,-58,-59
  573.         DB     -59,-60,-60,-61,-61,-62,-62,-62,-63,-63,-63,-64,-64,-64,-64,-64
  574.         DB     -64,-64,-64,-64,-64,-64,-63,-63,-63,-62,-62,-62,-61,-61,-60,-60
  575.         DB     -59,-59,-58,-57,-56,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46
  576.         DB     -45,-44,-43,-42,-41,-39,-38,-37,-36,-34,-33,-32,-30,-29,-27,-26
  577.         DB     -24,-23,-22,-20,-19,-17,-16,-14,-12,-11, -9, -8, -6, -5, -3, -2
  578.  
  579. FineRampDownData   Label   Byte
  580.         DB      64, 63, 63, 62, 62, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 56
  581.         DB      56, 55, 55, 54, 54, 53, 53, 52, 52, 51, 51, 50, 50, 49, 49, 48
  582.         DB      48, 47, 47, 46, 46, 45, 45, 44, 44, 43, 43, 42, 42, 41, 41, 40
  583.         DB      40, 39, 39, 38, 38, 37, 37, 36, 36, 35, 35, 34, 34, 33, 33, 32
  584.         DB      32, 31, 31, 30, 30, 29, 29, 28, 28, 27, 27, 26, 26, 25, 25, 24
  585.         DB      24, 23, 23, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 16
  586.         DB      16, 15, 15, 14, 14, 13, 13, 12, 12, 11, 11, 10, 10,  9,  9,  8
  587.         DB       8,  7,  7,  6,  6,  5,  5,  4,  4,  3,  3,  2,  2,  1,  1,  0
  588.         DB       0, -1, -1, -2, -2, -3, -3, -4, -4, -5, -5, -6, -6, -7, -7, -8
  589.         DB      -8, -9, -9,-10,-10,-11,-11,-12,-12,-13,-13,-14,-14,-15,-15,-16
  590.         DB     -16,-17,-17,-18,-18,-19,-19,-20,-20,-21,-21,-22,-22,-23,-23,-24
  591.         DB     -24,-25,-25,-26,-26,-27,-27,-28,-28,-29,-29,-30,-30,-31,-31,-32
  592.         DB     -32,-33,-33,-34,-34,-35,-35,-36,-36,-37,-37,-38,-38,-39,-39,-40
  593.         DB     -40,-41,-41,-42,-42,-43,-43,-44,-44,-45,-45,-46,-46,-47,-47,-48
  594.         DB     -48,-49,-49,-50,-50,-51,-51,-52,-52,-53,-53,-54,-54,-55,-55,-56
  595.         DB     -56,-57,-57,-58,-58,-59,-59,-60,-60,-61,-61,-62,-62,-63,-63,-64
  596.  
  597. FineSquareWave     Label   Byte
  598.         DB      128 Dup (64), 128 Dup (0)
  599.  
  600. EmptyPattern            Label
  601.         DW      64, 64, 0, 0
  602.         DB      64 Dup (0)
  603.  
  604. ;───────────────────────────────────────────────────────────────────────────────
  605.  
  606. PitchTable              Label   DWord   ; Values are 16.16 bit
  607.    DW      2048, 0,   2170, 0,   2299, 0,   2435, 0,   2580, 0,   2734, 0 ; C-0
  608.    DW      2896, 0,   3069, 0,   3251, 0,   3444, 0,   3649, 0,   3866, 0 ;>B-0
  609.  
  610.    DW      4096, 0,   4340, 0,   4598, 0,   4871, 0,   5161, 0,   5468, 0 ; C-1
  611.    DW      5793, 0,   6137, 0,   6502, 0,   6889, 0,   7298, 0,   7732, 0 ;>B-1
  612.  
  613.    DW      8192, 0,   8679, 0,   9195, 0,   9742, 0,   10321, 0,  10935, 0
  614.    DW      11585, 0,  12274, 0,  13004, 0,  13777, 0,  14596, 0,  15464, 0
  615.  
  616.    DW      16384, 0,  17358, 0,  18390, 0,  19484, 0,  20643, 0,  21870, 0
  617.    DW      23170, 0,  24548, 0,  26008, 0,  27554, 0,  29193, 0,  30929, 0
  618.  
  619.    DW      32768, 0,  34716, 0,  36781, 0,  38968, 0,  41285, 0,  43740, 0
  620.    DW      46341, 0,  49097, 0,  52016, 0,  55109, 0,  58386, 0,  61858, 0
  621.  
  622.    DW      0, 1,      3897, 1,   8026, 1,   12400, 1,  17034, 1,  21944, 1
  623.    DW      27146, 1,  32657, 1,  38496, 1,  44682, 1,  51236, 1,  58179, 1
  624.  
  625.    DW      0, 2,      7794, 2,   16051, 2,  24800, 2,  34068, 2,  43888, 2
  626.    DW      54292, 2,  65314, 2,  11456, 3,  23828, 3,  36936, 3,  50823, 3
  627.  
  628.    DW      0, 4,      15588, 4,  32103, 4,  49600, 4,  2601, 5,   22240, 5
  629.    DW      43048, 5,  65092, 5,  22912, 6,  47656, 6,  8336, 7,   36110, 7
  630.  
  631.    DW      0, 8,      31176, 8,  64205, 8,  33663, 9,  5201, 10,  44481, 10
  632.    DW      20559, 11, 64648, 11, 45823, 12, 29776, 13, 16671, 14, 6684, 15
  633.  
  634.    DW      0, 16,     62352, 16, 62875, 17, 1790,  19, 10403, 20, 23425, 21
  635.    DW      41118, 22, 63761, 23, 26111, 25, 59552, 26, 33342, 28, 13368, 30
  636.  
  637. FineLinearSlideUpTable  Label ; Values are 16.16 bit
  638.         DW      0, 1,     59, 1,    118, 1,   178, 1,   237, 1    ; 0->4
  639.         DW      296, 1,   356, 1,   415, 1,   475, 1,   535, 1    ; 5->9
  640.         DW      594, 1,   654, 1,   714, 1,   773, 1,   833, 1    ; 10->14
  641.         DW      893, 1                                            ; 15
  642.  
  643. LinearSlideUpTable      Label ; Value = 2^(Val/192), Values are 16.16 bit
  644.         DW      0,     1, 237,   1, 475,   1, 714,   1, 953,  1  ; 0->4
  645.         DW      1194,  1, 1435,  1, 1677,  1, 1920,  1, 2164, 1  ; 5->9
  646.         DW      2409,  1, 2655,  1, 2902,  1, 3149,  1, 3397, 1  ; 10->14
  647.         DW      3647,  1, 3897,  1, 4148,  1, 4400,  1, 4653, 1  ; 15->19
  648.         DW      4907,  1, 5157,  1, 5417,  1, 5674,  1, 5932, 1  ; 20->24
  649.         DW      6190,  1, 6449,  1, 6710,  1, 6971,  1, 7233, 1  ; 25->29
  650.         DW      7496,  1, 7761,  1, 8026,  1, 8292,  1, 8559, 1  ; 30->34
  651.         DW      8027,  1, 9096,  1, 9366,  1, 9636,  1, 9908, 1  ; 35->39
  652.         DW      10181, 1, 10455, 1, 10730, 1, 11006, 1, 11283,1  ; 40->44
  653.         DW      11560, 1, 11839, 1, 12119, 1, 12400, 1, 12682,1  ; 45->49
  654.         DW      12965, 1, 13249, 1, 13533, 1, 13819, 1, 14106,1  ; 50->54
  655.         DW      14394, 1, 14684, 1, 14974, 1, 15265, 1, 15557,1  ; 55->59
  656.         DW      15850, 1, 16145, 1, 16440, 1, 16737, 1, 17034,1  ; 60->64
  657.         DW      17333, 1, 17633, 1, 17933, 1, 18235, 1, 18538,1  ; 65->69
  658.         DW      18842, 1, 19147, 1, 19454, 1, 19761, 1, 20070,1  ; 70->74
  659.         DW      20379, 1, 20690, 1, 21002, 1, 21315, 1, 21629,1  ; 75->79
  660.         DW      21944, 1, 22260, 1, 22578, 1, 22897, 1, 23216,1  ; 80->84
  661.         DW      23537, 1, 23860, 1, 24183, 1, 24507, 1, 24833,1  ; 85->89
  662.         DW      25160, 1, 25488, 1, 25817, 1, 26148, 1, 26479,1  ; 90->94
  663.         DW      26812, 1, 27146, 1, 27481, 1, 27818, 1, 28155,1  ; 95->99
  664.         DW      28494, 1, 28834, 1, 29175, 1, 29518, 1, 29862,1  ; 100->104
  665.         DW      30207, 1, 30553, 1, 30900, 1, 31248, 1, 31599,1  ; 105->109
  666.         DW      31951, 1, 32303, 1, 32657, 1, 33012, 1, 33369,1  ; 110->114
  667.         DW      33726, 1, 34085, 1, 34446, 1, 34807, 1, 35170,1  ; 115->119
  668.         DW      35534, 1, 35900, 1, 36267, 1, 36635, 1, 37004,1  ; 120->124
  669.         DW      37375, 1, 37747, 1, 38121, 1, 38496, 1, 38872,1  ; 125->129
  670.         DW      39250, 1, 39629, 1, 40009, 1, 40391, 1, 40774,1  ; 130->134
  671.         DW      41158, 1, 41544, 1, 41932, 1, 42320, 1, 42710,1  ; 135->139
  672.         DW      43102, 1, 43495, 1, 43889, 1, 44285, 1, 44682,1  ; 140->144
  673.         DW      45081, 1, 45481, 1, 45882, 1, 46285, 1, 46690,1  ; 145->149
  674.         DW      47095, 1, 47503, 1, 47917, 1, 48322, 1, 48734,1  ; 150->154
  675.         DW      49147, 1, 49562, 1, 49978, 1, 50396, 1, 50815,1  ; 155->159
  676.         DW      51236, 1, 51658, 1, 52082, 1, 52507, 1, 52934,1  ; 160->164
  677.         DW      53363, 1, 53793, 1, 54224, 1, 54658, 1, 55092,1  ; 165->169
  678.         DW      55529, 1, 55966, 1, 56406, 1, 56847, 1, 57289,1  ; 170->174
  679.         DW      57734, 1, 58179, 1, 58627, 1, 59076, 1, 59527,1  ; 175->179
  680.         DW      59979, 1, 60433, 1, 60889, 1, 61346, 1, 61805,1  ; 180->184
  681.         DW      62265, 1, 62727, 1, 63191, 1, 63657, 1, 64124,1  ; 185->189
  682.         DW      64593, 1, 65064, 1, 0,     2, 474,   2, 950,  2  ; 190->194
  683.         DW      1427,  2, 1906,  2, 2387,  2, 2870,  2, 3355, 2  ; 195->199
  684.         DW      3841,  2, 4327,  2, 4818,  2, 5310,  2, 5803, 2  ; 200->204
  685.         DW      6298,  2, 6795,  2, 7294,  2, 7794,  2, 8296, 2  ; 205->209
  686.         DW      8800,  2, 9306,  2, 9814,  2, 10323, 2, 10835,2  ; 210->214
  687.         DW      11348, 2, 11863, 2, 12380, 2, 12899, 2, 13419,2  ; 215->219
  688.         DW      13942, 2, 14467, 2, 14993, 2, 15521, 2, 16051,2  ; 220->224
  689.         DW      16583, 2, 17117, 2, 17653, 2, 18191, 2, 18731,2  ; 225->229
  690.         DW      19273, 2, 19817, 2, 20362, 2, 20910, 2, 21460,2  ; 230->234
  691.         DW      22011, 2, 22565, 2, 23121, 2, 23678, 2, 24238,2  ; 235->239
  692.         DW      24800, 2, 25363, 2, 25929, 2, 25497, 2, 27067,2  ; 240->244
  693.         DW      27639, 2, 28213, 2, 28789, 2, 29367, 2, 29947,2  ; 245->249
  694.         DW      30530, 2, 31114, 2, 31701, 2, 32289, 2, 32880, 2 ; 250->254
  695.         DW      33473, 2, 34068, 2                               ; 255->256
  696.  
  697. FineLinearSlideDownTable Label ; Values are 0.16 bit
  698.         DW      65535, 65477, 65418, 65359, 65300, 65241, 65182, 65359 ; 0->7
  699.         DW      65065, 65006, 64947, 64888, 64830, 64772, 64713, 64645 ; 8->15
  700.  
  701. LinearSlideDownTable    Label ; Values are 0.16 bit
  702.         DW      65535, 65300, 65065, 64830, 64596, 64364, 64132, 63901 ; 0->7
  703.         DW      63670, 63441, 63212, 62984, 62757, 62531, 62306, 62081 ; 8->15
  704.         DW      61858, 61635, 61413, 61191, 60971, 60751, 60532, 60314 ; 16->23
  705.         DW      60097, 59880, 59664, 59449, 59235, 59022, 58809, 58597 ; 24->31
  706.         DW      58386, 58176, 57966, 57757, 57549, 57341, 57135, 56929 ; 32->39
  707.         DW      56724, 56519, 56316, 56113, 55911, 55709, 55508, 55308 ; 40->47
  708.         DW      55109, 54910, 54713, 54515, 54319, 54123, 53928, 53734 ; 48->55
  709.         DW      53540, 53347, 53155, 52963, 52773, 52582, 52393, 52204 ; 56->63
  710.         DW      52016, 51829, 51642, 51456, 51270, 51085, 50901, 50718 ; 64->71
  711.         DW      50535, 50353, 50172, 49991, 49811, 49631, 49452, 49274 ; 72->79
  712.         DW      49097, 48920, 48743, 48568, 48393, 48128, 48044, 47871 ; 80->87
  713.         DW      47699, 47527, 47356, 47185, 47015, 46846, 46677, 46509 ; 88->95
  714.         DW      46341, 46174, 46008, 45842, 45677, 45512, 45348, 45185 ; 96->103
  715.         DW      45022, 44859, 44698, 44537, 44376, 44216, 44057, 43898 ;104->111
  716.         DW      43740, 43582, 43425, 43269, 43113, 42958, 42803, 42649 ;112->119
  717.         DW      42495, 42342, 42189, 42037, 41886, 41735, 41584, 41434 ;120->127
  718.         DW      41285, 41136, 40988, 40840, 40639, 40566, 40400, 40253 ;128->135
  719.         DW      40110, 39965, 39821, 39678, 39535, 39392, 39250, 39109 ;136->143
  720.         DW      38968, 38828, 38688, 38548, 38409, 38271, 38133, 37996 ;144->151
  721.         DW      37859, 37722, 37586, 37451, 37316, 37181, 37047, 36914 ;152->159
  722.         DW      36781, 36648, 36516, 36385, 36254, 36123, 35993, 35863 ;160->167
  723.         DW      35734, 35605, 35477, 35349, 35221, 35095, 34968, 34842 ;168->175
  724.         DW      34716, 34591, 34467, 34343, 34219, 34095, 33973, 33850 ;176->183
  725.         DW      33728, 33607, 33486, 33365, 33245, 33125, 33005, 32887 ;184->191
  726.         DW      32768, 32650, 32532, 32415, 32298, 32182, 32066, 31950 ;192->199
  727.         DW      31835, 31720, 31606, 31492, 31379, 31266, 31153, 31041 ;200->207
  728.         DW      30929, 30817, 30706, 30596, 30485, 30376, 30226, 30157 ;208->215
  729.         DW      30048, 29940, 29832, 29725, 29618, 29511, 29405, 29299 ;216->223
  730.         DW      29193, 29088, 28983, 28879, 28774, 28671, 28567, 28464 ;224->231
  731.         DW      28362, 28260, 28158, 28056, 27955, 27855, 27754, 27654 ;232->239
  732.         DW      27554, 27455, 27356, 27258, 27159, 27062, 26964, 26867 ;240->247
  733.         DW      26770, 26674, 26577, 26482, 26386, 26291, 26196, 26102 ;248->255
  734.         DW      26008                                                  ; 256
  735.  
  736. ;───────────────────────────────────────────────────────────────────────────────
  737.  
  738.                                   Effect Info
  739.  
  740. Here's about all the info I can think of for effects. "Process" variables are
  741. variables used internally by effects to control the direction of playback..
  742. This section has not been completed yet.
  743.  
  744. First, here is the rough flow chart for processing information, it's not fully
  745. detailed, but all of the important steps are outlined.
  746.  
  747.        ┌─────────────────────────────────────────────────────────┐
  748.        │ Set note volume to volume set for each channel          │
  749.        │ Set note frequency to frequency set for each channel    │
  750.        └────────────┬────────────────────────────────────────────┘
  751.                     │
  752.        ┌────────────┴────────────┐
  753.        │ Decrease tick counter   │        Yes
  754.        │  Is tick counter 0 ?    ├─────────────────────────┐
  755.        └────────────┬────────────┘                         │
  756.                     │                                      │
  757.                 No  │                ┌─────────────────────┴──────────────────┐
  758.        ┌────────────┴────────────┐   │ Tick counter = Tick counter set        │
  759.        │ Update effects for each │   │                  (the current 'speed') │
  760.        │  channel as required.   │   │      Decrease Row counter.             │
  761.        │                         │   │        Is row counter 0?               │
  762.        └───┬─────────────────────┘   └────────────┬──────────┬────────────────┘
  763.            │                                  No  │          │
  764.            │                ┌─────────────────────┘          │ Yes
  765.            │                │                                │
  766.            │  ┌─────────────┴──────────────┐ ┌───────────────┴────────────────┐
  767.            │  │ Call update-effects for    │ │  Row counter = 1               │
  768.            │  │ each channel.              │ │                                │
  769.            │  └──────────────┬─────────────┘ │ Increase ProcessRow            │
  770.            │                 │               │ Is ProcessRow > NumberOfRows?  │
  771.            ├─────────────────┘               └────────┬──────────────────┬────┘
  772.            │                                      Yes │                  │ No
  773.            │         ┌────────────────────────────────┴──────────────┐   │
  774.            │         │  ProcessRow = BreakRow                        │   │
  775.            │         │  BreakRow = 0                                 │   │
  776.            │         │  Increase ProcessOrder                        │   │
  777.            │         │  while Order[ProcessOrder] = 0xFEh,           │   │
  778.            │         │                         increase ProcessOrder │   │
  779.            │         │  if Order[ProcessOrder] = 0xFFh,              │   │
  780.            │         │                         ProcessOrder = 0      │   │
  781.            │         │  CurrentPattern = Order[ProcessOrder]         │   │
  782.            │         └─────────────────────┬─────────────────────────┘   │
  783.            │                               │                             │
  784.            │                               ├─────────────────────────────┘
  785.            │                               │
  786.            │         ┌─────────────────────┴──────────────────────────┐
  787.            │         │ CurrentRow = ProcessRow                        │
  788.            │         │ Update Pattern Variables (includes jumping to  │
  789.            │         │  the appropriate row if requried and getting   │
  790.            │         │  the NumberOfRows for the pattern)             │
  791.            │         └─────────────────────┬──────────────────────────┘
  792.            │                               │
  793.            ├───────────────────────────────┘
  794.            │
  795.        ┌───┴───────────────┐       Yes        ┌───────────────────────────────┐
  796.        │ Instrument mode?  ├──────────────────┤ Update Envelopes as required  │
  797.        └───┬───────────────┘                  │ Update fadeout as required    │
  798.            │                                  │ Calculate final volume if req │
  799.            │ No (Sample mode)                 │ Calculate final pan if req    │
  800.            │                                  │ Process sample vibrato if req │
  801.        ┌───┴─────────────────────────────────┐└───────────────┬───────────────┘
  802.        │ Calculate final volume if required  │                │
  803.        │ Calculate final pan if requried     │                │
  804.        │ Process sample vibrato if required  │                │
  805.        └───┬─────────────────────────────────┘                │
  806.            │                                                  │
  807.            │                                                  │
  808.            └─────────────────────────┬────────────────────────┘
  809.                                      │
  810.                     ┌────────────────┴──────────────────┐
  811.                     │ Output sound!!!                   │
  812.                     └───────────────────────────────────┘
  813.  
  814. Axx     Set Tempo
  815.  
  816.         if (xx != 0) {
  817.                 Maxtick = xx;
  818.                 Currenttick = xx;
  819.         }
  820.  
  821. Bxx     Jump to Order
  822.  
  823.         ProcessOrder = xx - 1;
  824.         ProcessRow = 0xFFFE; // indicates new pattern internally for IT...
  825.  
  826. Cxx     Break to Row
  827.  
  828.         BreakRow = xx;
  829.         ProcessRow = 0xFFFE;
  830.  
  831. Dxx     Volume slide down
  832.  
  833.         if (xx == 0) then xx = last xx for (Dxx/Kxx/Lxx) for this channel.
  834.  
  835.         Order of testing: Dx0, D0x, DxF, DFx
  836.  
  837. Dx0     Set effect update for channel enabled if channel is ON.
  838.         If x = F, then slide up volume by 15 straight away also (for S3M compat)
  839.         Every update, add x to the volume, check and clip values > 64 to 64
  840. D0x     Set effect update for channel enabled if channel is ON.
  841.         If x = F, then slide down volume by 15 straight away also (for S3M)
  842.         Every update, subtract x from the volume, check and clip values < 0 to 0
  843. DxF     Add x to volume straight away. Check and clip values > 64 to 64
  844. DFx     Subtract x from volume straight away. Check and clip values < 0 to 0
  845.  
  846. Hxy     Vibrato
  847.  
  848.         if (x != 0) {
  849.                 speed = 4*x;
  850.         }
  851.         if (y != 0) {
  852.                 depth = y * 4;
  853.                 if(OldEffects) depth <<= 1;
  854.         }
  855.         Set effect update for channel enabled if channel is ON.
  856.         Goto InitVibrato (explained later)
  857.  
  858. Ixy     Tremor, ontime x, offtime y
  859.  
  860.         if (x != 0) {
  861.                 ontime = x;
  862.                 if (oldeffects) ontime++;
  863.         }
  864.         if (y != 0) {
  865.                 offtime = y;
  866.                 if (oldeffects) offtime++;
  867.         }
  868.  
  869. Nxx     Channel volume slide down
  870.  
  871.         if (xx == 0) then xx = last Nxx for this channel.
  872.  
  873.         Order of testing: Nx0, N0x, NxF, NFx
  874.  
  875. Nx0     Set effect update for channel enabled.
  876.         Every update, add x to the volume, check and clip values > 64 to 64
  877. N0x     Set effect update for channel enabled.
  878.         Every update, subtract x from the volume, check and clip values < 0 to 0
  879. NxF     Add x to volume straight away. Check and clip values > 64 to 64
  880. NFx     Subtract x from volume straight away. Check and clip values < 0 to 0
  881.  
  882. Uxy     Fine Vibrato
  883.  
  884.         if (x != 0) {
  885.                 speed = 4*x;
  886.         }
  887.         if (y != 0) {
  888.                 depth = y;
  889.                 if(OldEffects) depth <<= 1;
  890.         }
  891.         Set effect update for channel enabled if channel is ON.
  892.         Goto InitVibrato (explained later)
  893.  
  894. Wxx     Global volume slide down
  895.  
  896.         if (xx == 0) then xx = last Wxx for this channel.
  897.  
  898.         Order of testing: Wx0, W0x, WxF, WFx
  899.  
  900. Wx0     Set effect update for channel enabled.
  901.         Every update, add x to the volume, check and clip values > 128 to 128
  902. W0x     Set effect update for channel enabled.
  903.         Every update, subtract x from the volume, check and clip values < 0 to 0
  904. WxF     Add x to volume straight away. Check and clip values > 128 to 128
  905. WFx     Subtract x from volume straight away. Check and clip values < 0 to 0
  906.  
  907. .. sorry this is incomplete..
  908.