Odyssey paper #08
31 марта 1999

From the top - Description of the file format *. MOD music editor Amiga ProTracker.

<b>From the top</b> - Description of the file format *. MOD music editor Amiga ProTracker.
 From the top
 ________

 Description of the file format *. MOD music editor Amiga 
ProTracker. 

(C) Russian Digital Computing
Recycling and the addition: Phantom Lord


 MOD files are composed of three parts: pervayaopisanie block 
instruments, the second - musical scores, the third - the tools 
themselves. The first block begins with the beginning of the 
file. His format is shown below (decimal):


0 - 20 - The name of the tune, 20 characters, if
less - zero ends

+20 - 22 - name of the first instrument (zero -
end)

42 - 2 - length of the first tool
words (to get the length in bytes is multiplied by two). All 
the numbers in the format of the processor Motorola, for 
conversion to processor DEC, Intel, Zilog, etc. swap bytes in a 
word before multiplying 

+44 - 1 - Low 4 bits, the number with the sign
- The value of fine adjustment of frequency

45 - 1 - Default volume for the first instrument - in the range 
0 · 64 

+46 - 2 - Offset from the start of an instrument -
beginning of cycling (in words)

48 - 2 - The length of loops in
words.

 Next comes information on the remaining 30
instruments, each record to 30 bytes
only 31 instrument.Posle records about the tools is a 
description of melody: 


950 - 1 - Length of the tunes in the positions of
list

951 - 1 - Not used

952 - 128 (regardless of 950) - List
positions, each of its elements - number pattern'a from 0 to 63.

1080 - 4 - Tag format ProTracker -
letters "M.K."

+1084 - 1024 - musical scores pattern'a 0


     Musical scores for each pattern'a is 1 kilobyte. The total 
number of pattern'ov can be determined by finding the maximum 
number in the list of positions and subtracting his unit, 
because pattern'y numbered from zero.

 Each note is four bytes in pattern'e go 64 blocks of four 
notes to four channels. Pattern'y are continuously

one after another, after the last pattern'a immediately begins 
the first tool, followed by the second, etc. Provision of tools 
in the file can be calculated based on their lengths.


 Description format notes.

 The note consists of four bytes (from 1 to 4).


 _____BAYT 1_____ BAYT2_
/ /
0000 0000-00000000

 Senior Notes Period.
four bits (12 bits)
Tool number.



 _____BAYT 3_____ BAYT4_
/ /
0000 0000-00000000

Junior Code and the information bytes
four bits
numbers in-effects.
strumenta


 Note is given in the form of a period conversion, use the 
table: 



     Nota Period


from C-1 to B-1 - 856,808,762,720,678,640,

                604,570,538,508,480,453
from C-2 to B-2 - 428,404,381,360,339,320,

                302,285,269,254,240,226
from C-3 to B-3 - 214,202,190,180,170,160,

                151,143,135,127,120,113



If the period is zero, then continues
play the previous note.
If the tool number zero - to play
the previous tool.
 Codes of special effects are as follows:

 0 - None / Arpeggio 8 - * NOT USED *
 1 - Portamento Up 9 - SampleOffset
 2 - Portamento Down A - VolumeSlide
 3 - TonePortamento B - PositionJump
 4 - Vibrato C - Set Volume
 5 - ToneP + VolSlide D - PatternBreak
 6 - Vibra + VolSlide E - Misc. Cmds
 7 - Tremolo F - Set Speed


 Command code E:

 E0-Filter On / Off E8-* NOT USED *
 E1-Fineslide Up E9-Retrig Note
 E2-Fineslide Down EA-FineVol Up
 E3-Glissando Control EB-FineVol Down
 E4-Vibrato Control EC-NoteCut
 E5-Set Finetune ED-NoteDelay
 E6-Patternloop EE-PatternDelay
 E7-Tremolo Control EF-Invert Loop


 Description of the Sonderkommando.

 0 - Arpeggio. If inf. B - zero means do nothing (ie just 
played note. If not zero, then the tool played as follows: 
rapidly interspersed musical intervals, first note is played, 
then note + lowest hex digits info

bytes in semitones, then again the note, then
note + senior figure info. bytes.
 1 - Portamento Up. Continuously improves the tone of
rate of Inform. bytes.
 2 - Portamento Down. - / / - Lowers -//-.
 3 - Tone Portamento. With a given rate
bring the tone up tone of the current sheet, ie current note 
does not begin immediately.  4 - Vibrato. Fluctuations tone 
with a frequency of significant digit info. bytes and the 
amplitude of the lowest figures.

 5 - Tone Portamento + Volume Slide. A similar effect is the 
effect, but during his action remains Effect 3

if he previously was.
 6 - Vibrato + Volume Slide.Analogichen effect of A, but the 
earlier the effect of four preserved.

 7 - Tremolo. Instant on / off
sound. Significant digit info. byte indicates the time at which 
the tool is included, and the youngest - the time off.  8 - Not 
used.  9 - Sample Offset. Specifies the offset from the 
beginning a tool for playing the current notes.

 A - Volume Slide. Smooth change in volume, the highest figure 
info. byte indicates rate of increase in volume, and the 
youngest - reduction.

 B - Position Jump.Perehod at a given position in the list 
pattern'ov after execution the current note.

 C - Set Volume. Specifying the volume of the current sheet in 
the range 0-64 (if not specified, is taken from a list of 
tools).  D - Pattern Break. Interrupts play after the execution 
of the current pattern'a current notes and advances to the next 
pattern'u the list.  E - Misc. Commands.Starshaya inf.bayta 
digit specifies the number of teams from the additional 
sixteen, the youngest figure - the code of the command.  F - 
Set Speed. Setting the tempo. If the range 0-F, a rough, if 
more, then smooth.


 Additional commands:

 E0-Filter On / Off. Apparently, this is a hardware filter 
upper-lower frequencies.

 E1-Fineslide Up. - E2-Fineslide Down. - E3-Glissando Control - 
E4-Vibrato Control - E5-Set Finetune. Continuous setting tone 
within one semitone.  E6-Patternloop. - E7-Tremolo Control. - 
E8-Not used.  E9-Retrig Note. Repetition tech. notes with

rate of younger figures.
 EA-FineVol Up. - EB-FineVol Down. - EC-NoteCut. - 
ED-NoteDelay. - EE-PatternDelay. - EF-Invert Loop. -  All of 
the above has been obtained by educated bet ... It only remains 
to thank Dmitry Komissarov (XPEHsoft) for invaluable assistance.







Other articles:

From the authors - The eighth number is not long in coming.

News - MOT done our musician Wolfu computer.

From the top - Description of the file format *. MOD music editor Amiga ProTracker.

Algorithms - a rotation in three-dimensional coordinate system. Matrix.

Gallery - a few photos from Consul Party'97.

Music Page - the song "All will pass" - Civil Defence.

Epilogue - the authors of the paper.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Intro - the resurrection, the description of the viewer.
Mosaic - A pair of Cheat'ov ... When you see MASM128 & Monster Commander v2.1.
Muzoboz - Describes the two contest works: Axis of Evil, Faces-I.
About Spectrum - thinking about the future of the Spectrum.

В этот день...   21 November