home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / music / protracker / docs / fileformat next >
Encoding:
Text File  |  1994-06-24  |  19.3 KB  |  461 lines

  1. ProTracker file formats
  2. ------------------------
  3. Note: Throughout this file, the term 'SoundTracker' (or ST) is used to
  4.       stand for any application capable of processing song data in a manner
  5.       similar to Arc ProTracker.
  6.  
  7.   Arc ProTracker uses optimised new-format SoundTracker modules
  8.   (TFF - Tracker file format)
  9.  
  10. ProTracker can load the following format files directly without conversion:
  11.  
  12. ST Modules
  13. ----------
  14.  
  15.   Source              Filetype        Format   Tracks  Samples
  16.   ------              --------        ------   ------  -------
  17.   Tracker 1.0         &CB6            New      1-8     36
  18.   Oktalyser 1.1       &CB6            Oktal    4-8     36
  19.   Arc ProTracker 0.2  &CB6            New      1-8     0-47
  20.   TechTracker 2.0     &CB6            New      1-8     0-47  (forthcoming)
  21.   Sonic City 1.0      &CB6            New      1-8     0-47  (forthcoming)
  22.   StarTrekker 1.3     &CB6/&CC5       Old      4/8     31
  23.   SoundTracker 2.5    &701/&CB6       Old      4       15/31
  24.   ProTracker 1.1 ...  &701/&CB6/&CC5  Old      4       31
  25.   NoiseTracker        &701/&CB6/&CC5  Old      4       31
  26.  
  27. Where &701 = "ProTrack"
  28.       &CB6 = "STModule"
  29.       &CC5 = "TeqMusic"
  30.  
  31. Samples
  32. -------
  33.  
  34.   Source                 Filetype   Format
  35.   ------                 --------   ------
  36.   AudioMaster III (IFF)  &7B4       Linear signed
  37.   Tracker 1.0     (TFF)  &CB5       Logarithmic
  38.   ProTracker      (TFF)  &CB5       Logarithmic
  39.   Armadeus               &D3C       Logarithmic/Linear signed
  40.  
  41. Where &7B4 = "IFF Samp"
  42.       &CB5 = "STSample"
  43.       &D3C = "Sample"
  44.  
  45. Note: IFF Samples take account of the name, length, and loop points
  46. Note: TFF Samples take account of the name, length, volume, finetune
  47.       and loop points
  48. Note: Armadeus samples take account of the sample rate (stored as the first
  49.       byte of the file)
  50. Note: ProTracker generally hasn't a clue about the data format. Use the
  51.       'Log samples' option is the 'Options' sub-menu to select the data
  52.       type for loading samples
  53.  
  54. Patterns
  55. --------
  56.  
  57.   Source             Filetype  Format
  58.   ------             --------  ------
  59.   Tracker 1.0 (TFF)  &FF1      Fixed width 8 tracks, fixed length 64 events
  60.   ProTracker  (TFF)  &7B3      Variable width, variable length
  61.  
  62. Where &7B3 = "Pattern"
  63.       &FF1 = "RawData"
  64.  
  65. ProTracker can save the following format module files:
  66.  
  67.   Source              Filetype  Tracks  Samples
  68.   ------              --------  ------  -------
  69.   Arc ProTracker 0.2  &CB6      1-8     0-47    (TechTracker/Sonic City)
  70.   StarTrekker 1.3     &CC5      4/8     31
  71.   SoundTracker 2.5    &CC5      4       31
  72.   ProTracker 1.1 ...  &CC5      4       31
  73.   NoiseTracker        &CC5      4       31
  74.  
  75. Saving old format tunes with Arc ProTracker
  76. -------------------------------------------
  77. If the tune contains 4 or less tracks, then the first 4 tracks and first
  78. 31 instruments will be saved, and the string 'M.K.' will be inserted into the
  79. file.
  80. If the tune contains 5 or more tracks, then all 8 will be saved, along with
  81. 31 instruments, and the string 'FLT8' will be inserted into the file.
  82. N.B. these files can only be used by Fairlight's StarTrekker.
  83.  
  84. The following will be ommitted from the old format file:
  85.  
  86. 1. Author name
  87. 2. 'P' commands (set stereo)
  88. 3. 'L' commands (line jump)
  89. 4. 'R' commands (set sample rate)
  90. 5. 'X' commands (extra)
  91.  
  92. Also any 'G' and 'H' commands will be converted into 'A' commands. As old
  93. format does not support 'G' and 'H', this is the nearest approximation. In
  94. most cases, there is very little difference anyway!
  95. Old format also does not support 'V' commands, so they will also be rounded
  96. to the nearest 'C' commands.
  97.  
  98. But you will be able to load the file into the present generation of Amiga
  99. SoundTrackers. Future versions will support new format directly (we hope!)
  100.  
  101. .---------------------------------------------------------------------------.
  102. |       WE SUGGEST YOU ALWAYS KEEP A COPY OF TUNE IN THE NEW FORMAT,        |
  103. |           AS ALL THE DATA FROM OTHER FORMATS IS PRESERVED !!!!            |
  104. '---------------------------------------------------------------------------'
  105.  
  106. New format module file structure (&CB6)
  107. ---------------------------------------
  108. A new format module consists of a number of four byte chunks and the offset
  109. to the next chunk (in bytes). This makes for a very flexible file structure.
  110. (And it also makes the file human readable!!)
  111.  
  112.  MUSX - music extent                    TINF - tune information
  113.  MVOX - music voices                    STER - default stereo positions
  114.  MNAM - music name                      ANAM - author name
  115.  MLEN - music length (& restart pos.)   PNUM - patterns (number)
  116.  PLEN - pattern lengths                 SEQU - sequence
  117.  PATT - pattern data
  118.  SAMP - indicates a sample              SNAM - sample name
  119.  SVOL - sample volume (& finetune)      SLEN - sample length
  120.  ROFS - repeat offset                   RLEN - repeat length
  121.  SDAT - sample data follows
  122.  
  123. There now follows a byte by byte analysis of a new format file (from the very
  124. beginning):
  125.  
  126. Offset Chunk Offset      Bytes Description
  127. ------ ----- ------      ----- -----------
  128. 0      MUSX              4     length (eXtent) of the music
  129. 8      TINF 04 00 00 00  4     source of tune (see below)
  130. 20     MVOX 04 00 00 00  4     number of tracks
  131. 28     STER 08 00 00 00  8     defualt stereo positions list (1-7 per track)
  132. 44     MNAM 20 00 00 00  32    music name (zero-terminated)
  133. 84     ANAM 20 00 00 00  32    author name (zero-terminated)
  134. 124    MLEN 04 00 00 00  4     LSB - music length (no. of positions)
  135.                                MSB - restart position
  136. 136    PNUM 04 00 00 00  4     number of patterns
  137. 148    PLEN 40 00 00 00  64    pattern lengths for patterns 0-63
  138. 220    SEQU 80 00 00 00  128   sequence list (positions 0-127)
  139.                                each byte contains the pattern no. for that
  140.                                position
  141. 356... PATT YY XX 00 00  &XXYY pattern data. &XXYY is the length of the
  142.                                pattern (ie. pattern length x 4 x tracks)
  143.            
  144. There are as many PATT chunks in the file as the PNUM indicates.
  145. The sample data immediately follows the PATTs.
  146.  
  147. A new format tune can consist of from 1 to 8 tracks, and each pattern can
  148. consist of 1 to 64 events. Each note in the pattern is stored as 4 bytes, and
  149. all the notes at each event in the pattern are stored after each other.
  150.  
  151. eg. for four tracks  00 -  chan1 chan2 chan3 chan4
  152.                      01 -  chan1 chan2 chan3 chan4
  153.                      02 -  chan1 chan2 chan3 chan4
  154. eg. for eight tracks 00 -  chan1 chan2 chan3 chan4 chan5 chan6 chan7 chan8
  155.                      01 -  chan1 chan2 chan3 chan4 chan5 chan6 chan7 chan8
  156.                      02 -  chan1 chan2 chan3 chan4 chan5 chan6 chan7 chan8
  157.  
  158. Info for each note:
  159.  
  160.  byte 1     byte 2     byte 3     byte 4
  161. /      \   /      \   /      \   /      \
  162. 00000000   00000000   00000000   00000000
  163.  
  164. Parameter  Effect     Sample No. Note No.
  165.  
  166. The reason for the apparent backwards-ness of this arrangement is that an
  167. Archimedes word is stored LSB first - therefore an entire note can be loaded
  168. as a word and the data appears in that word in the correct order
  169. ie. 'Note No. - Sample No. - Effect - Parameter'
  170.  
  171. Sample data (TFF)
  172. -----------------
  173. The sample data immediately follows the pattern data in a new format module.
  174. There may be up to 47 SAMP chunks for each of the 47 samples a module can
  175. contain. Not all need to be present. The 'All' option on the 'Save Samp.s'
  176. sub-menu of the 'Options' sub-menu (from PT's iconbar menu) toggles whether
  177. all 47 are saved, or whether the samples up to the last one used are saved.
  178.  
  179.    Chunk             Bytes   Description
  180.    -----             -----   -----------
  181.  
  182.    SAMP ZZ YY XX 00  0       sample identifier: &XXYYZZ is the block length
  183.    SNAM XX 00 00 00  &XX     sample name &XX bytes long (not nesc. zero
  184.                                  terminated, so beware!)
  185.    SVOL 04 00 00 00  4       LSB - volume (0-&FF)
  186.                              MSB - finetune value (4 bit 2s complement)
  187.    SLEN 04 00 00 00  4       the exact length of the sample (in bytes)
  188.    ROFS 04 00 00 00  4       repeat offset in bytes
  189.    RLEN 04 00 00 00  4       repeat length in bytes
  190.    SDAT ZZ YY XX 00  &XXYYZZ sample data: &XXYYZZ is the exact length
  191.  
  192. The finetune byte only uses the least significant nibble, so the most
  193. significant nibble should be set to zero.
  194.  
  195. Old format module file structure (&701/&CC5/&CB6)
  196. -------------------------------------------------
  197. There now follows a byte by byte analysis of an old-format file
  198. (ProTracker 1.1B song/module format with NoiseTracker extensions)
  199.  
  200. Offset  Bytes  Description
  201. ------  -----  -----------
  202. 0       20     music name (zero-terminated)
  203.  
  204. Information for sample 1-31:
  205.  
  206. Offset  Bytes  Description
  207. ------  -----  -----------
  208. 20      22     sample name for sample 1: fixed length 22 characters
  209. 42      2      sample length for sample 1. Stored as number of Amiga words.
  210.                Multiply by two to get real sample length in bytes.
  211. 44      1      LSN - finetune value (4 bit 2s complement).
  212.                MSN - should be set to zero.
  213. 45      1      log volume for sample 1. Range is &00-&40.
  214. 46      2      repeat offset for sample 1. Stored as number of Amiga words
  215.                Multiply by two to get offset in bytes.
  216. 48      2      repeat length for sample 1. Stored as number of Amiga words in
  217.                loop. Multiply by two to get length in bytes.
  218.  
  219. Information for the next 30 or 14 samples starts here. It's just like the
  220. info for sample 1.
  221.  
  222. Offset  Bytes  Description
  223. ------  -----  -----------
  224. 50      30     Sample 2...
  225. 80      30     Sample 3...
  226. .
  227. .
  228. .
  229. 890     30     Sample 30... (assuming 31 instruments)
  230. 920     30     Sample 31...
  231.  
  232. Offset  Bytes  Description (assuming 31 instruments)
  233. ------  -----  -----------
  234. 950     1      music length (no. of positions)
  235. 951     1      restart position
  236. 952     128    sequence list (positions 0-127)                                              each byte contains the pattern no. for that position
  237. 1080    4      The four letters "M.K." - This is something Mahoney & Kaktus
  238.                inserted when they increased the number of samples from
  239.                15 to 31. If it's not there, the module/song uses 15 samples
  240.                or the text has been removed to make the module harder to
  241.                rip. StarTrekker puts "FLT4" or "FLT8" there instead.
  242.  
  243. Offset  Bytes  Description (assuming 31 instruments)
  244. ------  -----  -----------
  245. 1084... 1024   data for pattern 0.
  246.  
  247. There are as many patterns as the highest number+1 in the sequence list.
  248. A 15 instruments module will contain exactly the same data, only the offsets
  249. listed above will be 480 bytes less as there are 16 less samples and the
  250. 'M.K.' string does not exist.
  251.  
  252. An old format tune can consist of only 4 tracks and each pattern is a fixed
  253. 64 events long. Each note in the pattern is stored as 4 bytes, and all four
  254. notes at each event in the pattern are stored after each other.
  255.  
  256. 00 -  chan1  chan2  chan3  chan4
  257. 01 -  chan1  chan2  chan3  chan4
  258. 02 -  chan1  chan2  chan3  chan4
  259.  
  260. Info for each note:
  261.  
  262.  ______byte 1______   byte 2    ______byte 3______     byte 4
  263. /                  \ /      \  /                  \   /      \
  264. 0000            0000-00000000  0000            0000   00000000
  265.  
  266. Upper four      12 bits for    Lower four      Effect Parameter.
  267. bits of sample  note period.   bits of sample
  268. number.                        number.
  269.  
  270. The sample data immediately follows the pattern data in an old format module.
  271. As each sample is un-headered (unlike new-format, and Oktalyser) its start
  272. and end positions must be calculated by adding the lengths of the previous
  273. samples for the start, and adding the sample's length itself for the end.
  274.  
  275. Note: The Amiga words that exist in the sample information block at the
  276.       beginning of the module are only 16 bits long and are stored MSB
  277.       first. To convert to an Archimedes word, load both as separate bytes
  278.       and EOR the left byte shifted left 8 times, with the second.
  279.       The reverse is also the case.
  280.  
  281. StarTrekker 8 channel files
  282. ---------------------------
  283. With StarTrekker 8 channel format, only even pattern numbers are allowed
  284. ie. 0,2,4 etc. The odd patterns store the latter 4 channels of the previous
  285. pattern, eg. Pattern 0's first 4 channels exist in pattern 0, and the
  286. latter 4 channels are stored in pattern 1.
  287. The format of the module is identical to a 31 instrument SoundTracker file.
  288.  
  289. Oktalyser 1.1 files
  290. -------------------
  291. Oktalyser files are very similar to Arc ProTracker files, in that the tune
  292. is composed of several human readable chunks.
  293.  
  294. Offset Bytes  Description (Tune data)
  295. ------ -----  -----------
  296. &00    4      TINF = "OKTA"
  297. &04    4      Identifier = "SONG"
  298. &08    8      Chunk "CMOD" & length
  299. &10    8      4 channel pairs (T) = Number of voices
  300. &18    8      Chunk "SAMP" & length
  301.  
  302. Offset Bytes  Description  (Sample info data)
  303. ------ -----  -----------
  304. &00    22     Sample name
  305. &16    2      Sample length (MSB first) (S)
  306. &18    2      Repeat offset (MSB first)
  307. &1A    2      Repeat length (MSB first)
  308. &1C    2      Log. volume   (MSB first)
  309. &1E    2      Mode flag
  310.  
  311. Offset Bytes  Description (Tune data)
  312. ------ -----  -----------
  313. &4A0   8      Chunk "SPEE" & length
  314. &4A8   2      Speed (MSB first)
  315. &4AA   8      Chunk "SLEN" & length
  316. &4B2   2      Number of PBOD chunks in file
  317. &4B4   8      Chunk "PLEN" & length
  318. &4BC   2      Music length (MSB first)
  319. &4BE   8      Chunk "PATT" & length
  320. &4C0   L      Pattern data
  321.  
  322. Offset Bytes  Description (Pattern data)
  323. ------ -----  -----------
  324. ...    8      Chunk "PBOD" & length
  325. ...+8  2      Pattern length (MSB first) (L)
  326. ...+10 T*4*L  Actual pattern data
  327.  
  328. Offset Bytes  Description  (Sample data)
  329. ------ -----  -----------
  330. ...    8      Chunk "SBOD" & length
  331. ...+8  Sr     Actual sample data
  332.  
  333. Note: All chunk lengths are MSB first 32bit words.
  334.       Sr is a two-byte aligned version of S.
  335.       The volume and repeat values are only loaded if the mode flag is
  336.       non-zero. (Therefore their values are meaningless if the flag is zero)
  337.  
  338. TFF Sample file format (&CB5)
  339. -----------------------------
  340. When individual samples are saved by PT, the format of the file is
  341. exactly the same as a single SAMP block in a module. The 'Block length'
  342. word must still be valid even though there aren't any more SAMPs!!!
  343.  
  344. Alternative sample formats
  345. --------------------------
  346. Although the sample data stored in a module is of TFF format, there is no
  347. reason why you should not load samples of other types into TT.
  348. Currently supported types are: Raw logarithmic, Raw linear, TFF Log,
  349. TFF Linear, Armadeus Log, Armadeus Linear, IFF Log, IFF Linear
  350.  
  351. IFF Sample file format (&7B4)
  352. -----------------------------
  353. IFF Samples are a common format for interchanging sample data between
  354. applications/computers. ProTracker can load standard IFF samples of the
  355. following format:
  356.  
  357.  FORM - indicates an IFF file            VHDR - header
  358.  NAME - sample name                      ANNO - annotation (eg. source)
  359.  BODY - sample data
  360.  
  361. Offset Chunk Offset      Bytes Description
  362. ------ ----- ------      ----- -----------
  363. 0      FORM 00 00 XX YY  4     sample identifier: &XXYY is the block length
  364.                                data bytes: unique to each sample
  365. 8      VHDR 00 00 00 14  20    header information
  366. 40     NAME 00 00 00 14  20    sample name (zero-terminated)
  367. 68     ANNO 00 00 00 14  20    name of source program
  368. 96     BODY 00 00 XX YY  &XXYY sample data: &XXYY is exact length
  369.  
  370. TFF Pattern file format (&7B3)
  371. ------------------------------
  372. The individual patterns that make up a song can be saved out individually,
  373. for instance to create a pattern library, or as a intermediate stage in
  374. transferring a pattern from one song to another in concurrently loaded
  375. versions of ProTracker. The TFF pattern file format used takes account of
  376. the number of tracks and the pattern length. When loading a pattern, the
  377. pattern length is automatically snapped to the correct value.
  378.  
  379.  TTPX - pattern extent                  PVOX - pattern voices
  380.  PATT - pattern data
  381.  
  382. There now follows a byte by byte analysis of a ProTracker pattern file:
  383.  
  384. Offset Chunk Offset      Bytes Description
  385. ------ ----- ------      ----- -----------
  386. 0      TTPX              4     length of the file
  387. 8      PVOX 04 00 00 00  4     number of tracks
  388. 20     PATT YY XX 00 00  &XXYY pattern data. &XXYY is the length of the
  389.                                pattern (ie. pattern length x 4 x tracks)
  390.  
  391. New format song file structure (&7B7)
  392. -------------------------------------
  393. A new format song is functionally equivalent to an old format song, in that
  394. it contains all the data that a module contains, but without actually
  395. containing any sample data.
  396.  
  397.  SONG - song extent                     TINF - tune information
  398.  MVOX - music voices                    STER - default stereo positions
  399.  MNAM - music name                      ANAM - author name
  400.  MLEN - music length (& restart pos.)   PNUM - patterns (number)
  401.  PLEN - pattern lengths                 SEQU - sequence
  402.  PATT - pattern data
  403.  SSID - indicates a 'Song Sample ID'    SNAM - sample name
  404.  SVOL - sample volume (& finetune)      SLEN - sample length
  405.  ROFS - repeat offset                   RLEN - repeat length
  406.  
  407. There now follows a byte by byte analysis of a new format song (from the very
  408. beginning):
  409.  
  410. Offset Chunk Offset      Bytes Description
  411. ------ ----- ------      ----- -----------
  412. 0      SONG              4     length of the song
  413. 8      TINF 04 00 00 00  4     source of tune (see below)
  414. 20     MVOX 04 00 00 00  4     number of tracks
  415. 28     STER 08 00 00 00  8     defualt stereo positions list (1-7 per track)
  416. 44     MNAM 20 00 00 00  32    music name (zero-terminated)
  417. 84     ANAM 20 00 00 00  32    author name (zero-terminated)
  418. 124    MLEN 04 00 00 00  4     LSB - music length (no. of positions)
  419.                                MSB - restart position
  420. 136    PNUM 04 00 00 00  4     number of patterns
  421. 148    PLEN 40 00 00 00  64    pattern lengths for patterns 0-63
  422. 220    SEQU 80 00 00 00  128   sequence list (positions 0-127)
  423.                                each byte contains the pattern no. for that
  424.                                position
  425. 356... PATT YY XX 00 00  &XXYY pattern data. &XXYY is the length of the
  426.                                pattern (ie. pattern length x 4 x tracks)
  427.            
  428. There are as many PATT chunks in the file as the PNUM indicates.
  429. No sample data is contained in a song.
  430. The samples will be loaded using their SNAM filename after the song has been
  431. loaded. If the samples to be loaded have TFF headers then the data contained
  432. in such headers will be ignored in favour of the TFF data in the song.
  433. See the ProTracker help pages for information about possible types of sample
  434. filename.
  435.  
  436. Tune information
  437. ----------------
  438. The TINF chunk in the main tune header information contains a 4 byte code
  439. to identify the origin of the tune, as shown below:
  440.  
  441. Hex value  Text   Origin
  442. ---------  ----   ------
  443. 2E562E4F   O.V.   Archimedes ProTracker 0.2
  444. 2E4B2E4D   M.K.   Ex-Sound/Noise/ProTracker 31 instruments file 
  445. 34544C46   FLT4   Ex-StarTrekker file
  446. 38544C46   FLT8   Ex-StarTrekker 8 channel file
  447. 41544B4F   OKTA   Ex-Oktalyser 1.1 file
  448. 19111990          Tracker 1.0: the date 19/11/1990(!)
  449. 2E54582E   .XT.   Converted Tracker 1.0 file
  450. 2E74742E   .tt.   TechTracker 1.7
  451. 2E74732E   .st.   ST Convertor
  452. 2E746D2E   .mt.   MegaTracker 2.3
  453. 312E4353   SC.1   Sonic City 1.0
  454. 3444454D   MED4   Ex-MED file
  455. 3844454D   MED8   Ex-OctaMED file
  456. 27101991          Coconizer convertor: the date 27/10/1991(!)
  457. 546B7344   DskT   Ex-Desktop Tracker file
  458. 214B214D   M!K!   Ex-ProTracker 2.3 100 patternĀ file
  459.  
  460. ----------------------------------------------------------------------------
  461.