                      SOUNDTRACK MODULE FILE FORMAT (*.MOD)
                      -------------------------------------

[Byte count]
[20]   Song name , ASCII string

[30]   Sample  1 infos
       [22]= Name               , ASCII string
        [2]= Length             , in words
        [1]= Default fine tune  , b3-b0= Signed 4-bit
        [1]= Default volume     , (0-64)
        [2]= Repeat loop start  , in words
        [2]= Repeat loop length , in words , 0 or 1: None
[30]   Sample  2 infos
[30]   Sample  3 infos
[30]   Sample  4 infos
[30]   Sample .. infos
[30]   Sample 13 infos
[30]   Sample 14 infos
[30]   Sample 15 infos
if the module is a 31 sample module (See Chunk)
[30]   Sample 16 infos
[30]   Sample 17 infos
[30]   Sample 18 infos
[30]   Sample .. infos
[30]   Sample 29 infos
[30]   Sample 30 infos
[30]   Sample 31 infos
endif

[1]    Song table length , (1-128)
[1]    0
[128]  Song table , each pattern number on a byte

[4]    Chunk 'M.K.' for 31 sample module
       or also 'M!K!' 'M&K&' 'FLT4' 'FLT6' 'FLT8'

[1024] Pattern   0
       [16] Pattern position 0
            [4] Voice 0
                Played on left channel
                [2]b12=    5th bit of the sample number for 31 sample module
                   b11-b0= Note period (113-856) , 36 notes , 3 octaves

                   Per. Frequ.   Note   Per. Frequ.   Note   Per. Frequ.   Note
                   113  987.8 Hz B 3    226  493.9 Hz B 2    453  246.9 Hz B 1
                   120  932.4 Hz A#3    240  466.2 Hz A#2    480  233.1 Hz A#1
                   127  880.0 Hz A 3    254  440.0 Hz A 2    508  220.0 Hz A 1
                   135  830.6 Hz G#3    269  415.3 Hz G#2    538  207.6 Hz G#1
                   143  784.0 Hz G 3    285  392.0 Hz G 2    570  196.0 Hz G 1
                   151  740.0 Hz F#3    302  370.0 Hz F#2    604  185.0 Hz F#1
                   160  698.6 Hz F 3    320  349.3 Hz F 2    640  174.6 Hz F 1
                   170  659.4 Hz E 3    339  329.7 Hz E 2    678  164.8 Hz E 1
                   180  622.4 Hz D#3    360  311.2 Hz D#2    720  155.6 Hz D#1
                   190  587.4 Hz D 3    381  293.7 Hz D 2    762  146.8 Hz D 1
                   202  554.4 Hz C#3    404  277.2 Hz C#2    808  138.6 Hz C#1
                   214  523.4 Hz C 3    428  261.7 Hz C 2    856  130.8 Hz C 1

                   In music: NextNoteFreq=NoteFreq*2^(1/12)

                   On Amiga: ReplayFrequency=(3579546 Hz)/(NotePeriod)
                             between 4 KHz to 32KHz for the 3 octaves
                             ex: for C2 , ReplayFrequency=3579546/428=8363 Hz

                [1]b7-b4= Sample number (1-15) , 0: Previous
                   b3-b0= Effect (0-15)
                          Refreshed each timer period
                [1] Parameters
                   b7-b4= P
                   b3-b0= Q
                          Effect
                           0: Normal play (PQ=0 )
                              Arpeggio    (PQ<>0)
                              P= 1st half-tone to add to pitch
                              Q= 2nd half-tone to add to pitch

                           1: Portamento up
                              PQ= Pitch increase step

                           2: Portamento down
                              PQ= Pitch decrease step

                           3: Tone portamento
                              PQ= Pitch slide step , 0: Previous

                           4: Vibrato
                              P= Pitch change step  , 0: Previous
                              Q= Pitch change depth , 0: Previous

                           5: Tone portamento + Volume slide
                              P= Volume increase step , in priority
                              Q= Volume decrease step

                           6: Vibrato + Volume slide
                              P= Volume increase step , in priority
                              Q= Volume decrease step

                           7: Tremolo
                              P= Volume change step  , 0: Previous
                              Q= Volume change depth , 0: Previous

                           8: Phasor effect
                              PQ= Phase offset on sample

                           9: Sample offset
                              PQ= Offset in sample /256 , 0: Previous

                          10: Volume slide
                              P= Volume increase step , in priority
                              Q= Volume decrease step

                          11: Position jump
                              PQ= Song position (0-127)

                          12: Volume
                              PQ= Volume (0-64)
                               0: Stop
                               1:-36.1 dB  17:-11.5 dB  33:- 5.8 dB  49:- 2.3 dB
                               2:-30.1 dB  18:-11.0 dB  34:- 5.5 dB  50:- 2.1 dB
                               3:-26.6 dB  19:-10.5 dB  35:- 5.2 dB  51:- 2.0 dB
                               4:-24.1 dB  20:-10.1 dB  36:- 5.0 dB  52:- 1.8 dB
                               5:-22.1 dB  21:- 9.7 dB  37:- 4.8 dB  53:- 1.6 dB
                               6:-20.6 dB  22:- 9.3 dB  38:- 4.5 dB  54:- 1.5 dB
                               7:-19.2 dB  23:- 8.9 dB  39:- 4.3 dB  55:- 1.3 dB
                               8:-18.1 dB  24:- 8.5 dB  40:- 4.1 dB  56:- 1.2 dB
                               9:-17.0 dB  25:- 8.2 dB  41:- 3.9 dB  57:- 1.0 dB
                              10:-16.1 dB  26:- 7.8 dB  42:- 3.7 dB  58:- 0.9 dB
                              11:-15.3 dB  27:- 7.5 dB  43:- 3.5 dB  59:- 0.7 dB
                              12:-14.5 dB  28:- 7.2 dB  44:- 3.3 dB  60:- 0.6 dB
                              13:-13.8 dB  29:- 6.9 dB  45:- 3.1 dB  61:- 0.4 dB
                              14:-13.2 dB  30:- 6.6 dB  46:- 2.9 dB  62:- 0.3 dB
                              15:-12.6 dB  31:- 6.3 dB  47:- 2.7 dB  63:- 0.1 dB
                              16:-12.0 dB  32:- 6.0 dB  48:- 2.5 dB  64:  0   dB

                          13: Pattern break
                              PQ= Stop the current pattern and
                                  jump to the next song position
                                  at pattern position P*10+Q (0-63)

                          14: Extend command
                              P= 0 Filter
                                   Q=0: Filter on  , or LED on
                                   Q=1: Filter off , or LED off

                              P= 1 Fine portamento up
                                   Q= Value to add to pitch
                                      each pattern position

                              P= 2 Fine portamento down
                                   Q= Value to subtract from pitch
                                      each pattern position

                              P= 3 Tone portamento control
                                   Q=0: Off , the slide is straight , default
                                   Q=1: On  , the slide is halftone to halftone

                              P= 4 Vibrato waveform
                                   Qb1-b0=0: Sinus , default
                                   Qb1-b0=1: Ramp down
                                   Qb1-b0=2: Square
                                   Qb1-b0=3: Random
                                   Qb2=0: Waveform has to be restarted each note
                                          , default

                              P= 5 Fine tune
                                   Q= Fine tune value
                                      NewNoteFreq=NoteFreq*2^(Finetune/96)

                              P= 6 Pattern position loop
                                   Q =0: Set loop start pattern position
                                   Q<>0: Jump to loop start pattern position and
                                         play Q times

                              P= 7 Tremolo waveform
                                   Qb1-b0=0: Sinus , default
                                   Qb1-b0=1: Ramp down
                                   Qb1-b0=2: Square
                                   Qb1-b0=3: Random
                                   Qb2=0: Waveform has to be restarted each note
                                          , default

                              P= 8 Stop playing

                              P= 9 Retrig sample
                                   Q= Retrig sample each Q*TimerPeriod

                              P=10 Fine volume slide up
                                   Q= Value to add to volume
                                      each pattern position

                              P=11 Fine volume slide down
                                   Q= Value to subtract from volume
                                      each pattern position

                              P=12 Note cut
                                   Q= Cut note after Q*TimerPeriod
                                      volume is only set to 0

                              P=13 Note delay
                                   Q= Note delay
                                      Wait Q*TimerPeriod before playing note

                              P=14 Pattern position delay
                                   Q= Pattern position delay
                                      Wait (Q+1)*PatternPositionDelay

                              P=15 Invert repeat loop , Funk
                                   Q= Glissando funk
                                      0:   0 , off        8:  16
                                      1:   5              9:  19
                                      2:   6             10:  22
                                      3:   7             11:  26
                                      4:   8             12:  32
                                      5:  10             13:  43
                                      6:  11             14:  64
                                      7:  13             15: 128
                                      Invert the sign of sample data inside
                                      sample repeat loop ,
                                      one byte each (128/Q)*TimerPeriod
                                      This effect is permanent and
                                      modifies the samples.

                          15: Speed
                              PQ=0      Stop playing
                              PQ=1-32   One pattern position each PQ*TimerPeriod
                                        default=6
                              PQ=33-255 TimerPeriod=(125/PQ)/50 second
                                        default=125
            [4] Voice 1
                Played on right channel
            [4] Voice 2
                Played on right channel
            [4] Voice 3
                Played on left channel
       [16] Pattern position  1
       [16] Pattern position  2
       [16] Pattern position  3
       [16] Pattern position ..
       [16] Pattern position 61
       [16] Pattern position 62
       [16] Pattern position 63
[1024] Pattern   1
[1024] Pattern   2
[1024] Pattern   3
[1024] Pattern ...
[1024] Pattern 125
[1024] Pattern 126
[1024] Pattern 127 , number of pattern stored is equal to the highest
                     pattern number +1 in the song table

[X]   Sample  1 data , Signed-8 bit , ex: sampling frequency=8363 Hz for C2
[X]   Sample  2 data , Signed-8 bit
[X]   Sample  3 data , Signed-8 bit
[X]   Sample .. data , Signed-8 bit
[X]   Sample 29 data , Signed-8 bit
[X]   Sample 30 data , Signed-8 bit
[X]   Sample 31 data , Signed-8 bit
