home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Loisirs 16
/
PC_LOISIRS_n016_PCLOISIRS16.iso
/
sharewar
/
music
/
dos
/
st3
/
tech.doc
< prev
Wrap
Text File
|
1995-06-21
|
18KB
|
371 lines
Scream Tracker 3.01 BETA File Formats And Mixing Info
=====================================================
This document finally containts the OFFICIAL information on s3m format and
much more. There might be some errors though I've even checked this a few
times, so if something seems weird, don't just blindly believe it but think
first if it could be just a typo or something.
-----------------------------------------------------------------------------
What is the S3M file format?
What is the samplefile format?
What is the adlib instrument format?
The first table describes the S3M header. All other blocks are
pointer to by pointers, so in theory they could be anywhere in
the file. However, the practical standard order is:
- header
- instruments in order
- patterns in order
- samples in order
Next the instrument header is described. It is stored to S3M
for each instrument and also saved to the start of all samples
saved from ST3. Same header is also used by Advance Digiplayer.
The third part is the description of the packed pattern format.
S3M Module header
0 1 2 3 4 5 6 7 8 9 A B C D E F
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
0000: │ Song name, max 28 chars (end with NUL (0)) │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0010: │ │1Ah│Typ│ x │ x │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0020: │OrdNum │InsNum │PatNum │ Flags │ Cwt/v │ Ffv │'S'│'C'│'R'│'M'│
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0030: │g.v│i.s│i.t│m.v│ x │ x │ x │ x │ x │ x │ x │ x │ x │ x │Special│
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0040: │Channel settings for 32 channels, 255=unused,+128=disabled │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0050: │ │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0060: │Orders; length=OrdNum (should be even) │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
xxx1: │Parapointers to instruments; length=InsNum*2 │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
xxx2: │Parapointers to patterns; length=PatNum*2 │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
xxx1=70h+orders
xxx2=70h+orders+instruments*2
Parapointers to file offset Y is (Y-Offset of file header)/16.
You could think of parapointers as segments relative to the
start of the S3M file.
Type = File type: 16=ST3 module
Ordnum = Number of orders in file (should be even!)
Insnum = Number of instruments in file
Patnum = Number of patterns in file
Cwt/v = Created with tracker / version: &0xfff=version, >>12=tracker
ST3.00:0x1300
ST3.01:0x1301
Ffv = File format version;
1=old version used long ago (samples signed)
2=standard (samples unsigned)
Flags = [ These are old flags for Ffv1. Not supported in ST3.01
| +1:st2vibrato
| +2:st2tempo
| +4:amigaslides
| +32:enable filter/sfx with sb
]
+8: 0vol optimizations
Automatically turn off looping notes whose volume
is zero for >2 note rows.
+16: amiga limits
Disallow any notes that go beond the amiga hardware
limits (like amiga does). This means that sliding
up stops at B#5 etc. Also affects some minor amiga
compatibility issues.
+128: special custom data in file
Special = pointer to special custom data (not used by ST3.01)
g.v = global volume (see next section)
m.v = master volume (see next section) 7 lower bits
bit 8: stereo(1) / mono(0)
i.s = initial speed (command A)
i.t = initial tempo (command T)
Channel settings:
bit 8: channel enabled
bit 0-7: channel type
0..7 : Left Sample Channel 1-8
8..15 : Right Sample Channel 1-8
16..31 : Adlib channels (9 melody + 5 drums)
Global volume directly divides the volume numbers used. So
if the module has a note with volume 48 and master volume
is 32, the note will be played with volume 24. This affects
both Gravis & SoundBlasters.
Master volume only affects the SoundBlaster. It controls
the amount of sample multiplication (see mixing section
of this doc). The bigger the value the bigger the output
volume (and thus quality) will be. However if the value
is too big, the mixer may have to clip the output to
fit the 8 bit output stream. The default value works
pretty well. Note that in stereo, the mastermul is
internally multiplied by 11/8 inside the player since
there is generally more room in the output stream.
Order list lists the order in which to play the patterns. 255=--
is the end of tune mark and 254=++ is just a marker that is
skipped.
Digiplayer/ST3 samplefileformat
0 1 2 3 4 5 6 7 8 9 A B C D E F
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
0000: │[T]│ Dos filename (12345678.ABC) │ MemSeg │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0010: │Length │HI:leng│LoopBeg│HI:LBeg│LoopEnd│HI:Lend│Vol│ x │[P]│[F]│
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0020: │C2Spd │HI:C2sp│ x │ x │ x │ x │Int:Gp │Int:512│Int:lastused │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0030: │ Sample name, 28 characters max... (incl. NUL) │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
0040: │ ...sample name... │'S'│'C'│'R'│'S'│
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
xxxx: sampledata
Length / LoopBegin / LoopEnd are all 32 bit parameters although
ST3 only support file sizes up to 64,000 bytes. Files bigger
than that are clipped to 64,000 bytes when loaded to ST3. NOTE
that LoopEnd points to one byte AFTER the end of the sample,
so LoopEnd=100 means that byte 99.9999 (fixed) is the last one
played.
C2Spd = Herz for middle C. ST3 only uses lower 16 bits.
Vol = Default volume 0..64
Memseg = Pointer to sampledata
Inside a sample or S3M, MemSeg tells the parapointer to
the actual sampledata. In files all 24 bits are used.
In memory the value points to the actual sample segment
or Fxxx if sample is in EMS under handle xxx. In memory
the first memseg byte is overwritten with 0 to create
the dos filename terminator nul.
Int:Gp = Internal: Address of sample in gravis memory /32
(only used while module in memory)
Int:512= Internal: flags for soundblaster loop expansion
(only used while module in memory)
Int:las= Internal: last used position (only works with sb)
(only used while module in memory)
[T]ype 1=Sample, 2=adlib melody, 3+=adlib drum (see below for
adl