home *** CD-ROM | disk | FTP | other *** search
/ PC Loisirs 16 / PC_LOISIRS_n016_PCLOISIRS16.iso / sharewar / music / dos / st3 / tech.doc < prev   
Text File  |  1995-06-21  |  18KB  |  371 lines

  1.           Scream Tracker 3.01 BETA File Formats And Mixing Info
  2.           =====================================================
  3.  
  4. This document finally containts the OFFICIAL information on s3m format and
  5. much more. There might be some errors though I've even checked this a few
  6. times, so if something seems weird, don't just blindly believe it but think
  7. first if it could be just a typo or something.
  8.  
  9.  
  10. -----------------------------------------------------------------------------
  11. What is the S3M file format?
  12. What is the samplefile format?
  13. What is the adlib instrument format?
  14.  
  15.  
  16.         The first table describes the S3M header. All other blocks are
  17.         pointer to by pointers, so in theory they could be anywhere in
  18.         the file. However, the practical standard order is:
  19.         - header
  20.         - instruments in order
  21.         - patterns in order
  22.         - samples in order
  23.  
  24.         Next the instrument header is described. It is stored to S3M
  25.         for each instrument and also saved to the start of all samples
  26.         saved from ST3. Same header is also used by Advance Digiplayer.
  27.  
  28.         The third part is the description of the packed pattern format.
  29.  
  30.  
  31.                                 S3M Module header
  32.           0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  33.         ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
  34.   0000: │ Song name, max 28 chars (end with NUL (0))                    │
  35.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  36.   0010: │                                               │1Ah│Typ│ x │ x │
  37.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  38.   0020: │OrdNum │InsNum │PatNum │ Flags │ Cwt/v │  Ffv  │'S'│'C'│'R'│'M'│
  39.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  40.   0030: │g.v│i.s│i.t│m.v│ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │Special│
  41.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  42.   0040: │Channel settings for 32 channels, 255=unused,+128=disabled     │
  43.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  44.   0050: │                                                               │
  45.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  46.   0060: │Orders; length=OrdNum (should be even)                         │
  47.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  48.   xxx1: │Parapointers to instruments; length=InsNum*2                   │
  49.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  50.   xxx2: │Parapointers to patterns; length=PatNum*2                      │
  51.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  52.         xxx1=70h+orders
  53.         xxx2=70h+orders+instruments*2
  54.  
  55.         Parapointers to file offset Y is (Y-Offset of file header)/16.
  56.         You could think of parapointers as segments relative to the
  57.         start of the S3M file.
  58.  
  59.         Type    = File type: 16=ST3 module
  60.         Ordnum  = Number of orders in file (should be even!)
  61.     Insnum    = Number of instruments in file
  62.     Patnum    = Number of patterns in file
  63.         Cwt/v   = Created with tracker / version: &0xfff=version, >>12=tracker
  64.                         ST3.00:0x1300
  65.                         ST3.01:0x1301
  66.     Ffv    = File format version;
  67.                         1=old version used long ago (samples signed)
  68.                         2=standard (samples unsigned)
  69.         Flags   =  [ These are old flags for Ffv1. Not supported in ST3.01
  70.                    |  +1:st2vibrato
  71.                    |  +2:st2tempo
  72.                    |  +4:amigaslides
  73.                    | +32:enable filter/sfx with sb
  74.                    ]
  75.                     +8: 0vol optimizations
  76.                           Automatically turn off looping notes whose volume
  77.                           is zero for >2 note rows.
  78.                    +16: amiga limits
  79.                           Disallow any notes that go beond the amiga hardware
  80.                           limits (like amiga does). This means that sliding
  81.                           up stops at B#5 etc. Also affects some minor amiga
  82.                           compatibility issues.
  83.                   +128: special custom data in file
  84.         Special = pointer to special custom data (not used by ST3.01)
  85.     g.v    = global volume (see next section)
  86.     m.v    = master volume (see next section) 7 lower bits
  87.                   bit 8: stereo(1) / mono(0)
  88.     i.s    = initial speed (command A)
  89.     i.t        = initial tempo (command T)
  90.  
  91.         Channel settings:
  92.           bit 8: channel enabled
  93.         bit 0-7: channel type
  94.                  0..7   : Left Sample Channel 1-8
  95.                  8..15  : Right Sample Channel 1-8
  96.                  16..31 : Adlib channels (9 melody + 5 drums)
  97.  
  98.         Global volume directly divides the volume numbers used. So
  99.         if the module has a note with volume 48 and master volume
  100.         is 32, the note will be played with volume 24. This affects
  101.         both Gravis & SoundBlasters.
  102.  
  103.         Master volume only affects the SoundBlaster. It controls
  104.         the amount of sample multiplication (see mixing section
  105.         of this doc). The bigger the value the bigger the output
  106.         volume (and thus quality) will be. However if the value
  107.         is too big, the mixer may have to clip the output to
  108.         fit the 8 bit output stream. The default value works
  109.         pretty well. Note that in stereo, the mastermul is
  110.         internally multiplied by 11/8 inside the player since
  111.         there is generally more room in the output stream.
  112.  
  113.         Order list lists the order in which to play the patterns. 255=--
  114.         is the end of tune mark and 254=++ is just a marker that is
  115.         skipped.
  116.  
  117.  
  118.  
  119.                         Digiplayer/ST3 samplefileformat
  120.           0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  121.         ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
  122.   0000: │[T]│ Dos filename (12345678.ABC)                   │    MemSeg │
  123.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  124.   0010: │Length │HI:leng│LoopBeg│HI:LBeg│LoopEnd│HI:Lend│Vol│ x │[P]│[F]│
  125.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  126.   0020: │C2Spd  │HI:C2sp│ x │ x │ x │ x │Int:Gp │Int:512│Int:lastused   │
  127.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  128.   0030: │ Sample name, 28 characters max... (incl. NUL)                 │
  129.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  130.   0040: │ ...sample name...                             │'S'│'C'│'R'│'S'│
  131.         ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
  132.   xxxx:    sampledata
  133.  
  134.         Length / LoopBegin / LoopEnd are all 32 bit parameters although
  135.         ST3 only support file sizes up to 64,000 bytes. Files bigger
  136.         than that are clipped to 64,000 bytes when loaded to ST3. NOTE
  137.         that LoopEnd points to one byte AFTER the end of the sample,
  138.         so LoopEnd=100 means that byte 99.9999 (fixed) is the last one
  139.         played.
  140.         C2Spd  = Herz for middle C. ST3 only uses lower 16 bits.
  141.         Vol    = Default volume 0..64
  142.         Memseg = Pointer to sampledata
  143.                  Inside a sample or S3M, MemSeg tells the parapointer to
  144.                  the actual sampledata. In files all 24 bits are used.
  145.                  In memory the value points to the actual sample segment
  146.                  or Fxxx if sample is in EMS under handle xxx. In memory
  147.                  the first memseg byte is overwritten with 0 to create
  148.                  the dos filename terminator nul.
  149.         Int:Gp = Internal: Address of sample in gravis memory /32
  150.                  (only used while module in memory)
  151.         Int:512= Internal: flags for soundblaster loop expansion
  152.                  (only used while module in memory)
  153.         Int:las= Internal: last used position (only works with sb)
  154.                  (only used while module in memory)
  155.         [T]ype   1=Sample, 2=adlib melody, 3+=adlib drum (see below for
  156.                  adl