home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / ultrk1_6.zip / ULT_FORM.TXT < prev    next >
Text File  |  1994-06-21  |  9KB  |  203 lines

  1.                     ULTRA TRACKER File Format
  2.                   by FreeJack of The Elven Nation
  3.    (some additional infos on the new format (V1.4/5/6) by MAS -> * marked)
  4.  
  5. I've done my best to document the file format of Ultra Tracker (UT).
  6. If you find any errors please contact me.
  7. The file format has stayed consistent through the first four public releases.
  8. At the time of this writting, Ultra Tracker is up to version 1.3
  9. (* With version V1.4/5/6 there are some changes done in the format. *)
  10.  
  11. INFO from MAS:
  12. --------------
  13. I don't make any changes to this format after version 1.6 ! So if you want to 
  14. support the ULT format, this is the up to date formatdiscription.
  15. If any things are added, changed, etc. I'll rename the extension to something
  16. like: u2t, utm or similar !
  17. Big sorry for the many changes in the past !
  18.  
  19. Thanks go to :
  20. SoJa of YLYSY for help translating stuff.
  21.  
  22. Marc André Schallehn
  23. Thanks for putting out this GREAT program.
  24. Also thanks for the info on 16bit samples.
  25.  
  26. With all this crap out of the way lets get to the format.
  27.  
  28. Sample Structure :
  29. ______________________________________________________________________________
  30. Samplename : 32 bytes Sample name
  31. DosName    : 12 bytes when you load a sample into UT,
  32.                       it records the file name here
  33. LoopStart  : dbl word loop start point
  34. LoopEnd    : dbl word loop end point
  35. SizeStart  : dbl word see below
  36. SizeEnd    : dbl word see below
  37. volume     : byte     UT uses a logarithmic volume setting, ranging 
  38.                       from 0-255
  39.                       * from v1.4: uses linear Volume ranging from 0-255 *)
  40. Bidi Loop  : byte     see below
  41. FineTune   : word     Fine tune setting, uses full word value
  42.                       Linear Finetune
  43. -- Additional in v1.6 --
  44. C2-Freqency: word     This is the frequency, UT uses to play a middle C, 
  45.                       all other notes are calculated relatively to this 
  46.                       value.
  47. ______________________________________________________________________________
  48. 8 Bit Samples  :
  49.  
  50. SizeStart  :
  51. The SizeStart is the starting offset of the sample. 
  52. This seems to tell UT how to load the sample into the Gus's onboard memory. 
  53. All the files I have worked with start with a value of 32 for the first sample, 
  54. and the previous SizeEnd value for all sample after that. (See Example below)
  55. If the previous sample was 16bit, then SizeStart = (Last SizeEnd * 2)
  56. SizeEnd : 
  57. Like the SizeStart, SizeEnd seems to tell UT where to load the sample into the 
  58. Gus's onboard memory. SizeEnd equal SizeStart + the length of the sample.
  59.  
  60. Example :
  61. If a UT file had 3 samples, 1st 12000 bytes, 2nd 5600  bytes, 3rd 8000 byte. 
  62. The SizeStart and SizeEnd would look like this:
  63.  
  64. Sample        SizeStart         SizeEnd
  65. 1st            32                12032
  66. 2nd            12032             17632
  67. 3rd            17632             25632
  68.  
  69. ***Note***
  70. Samples may NOT cross 256k boundaries. If a sample is too large to fit into the
  71. remaining space, its Sizestart will equal the start of the next 256k boundary.
  72. UT does keep track of the free space at the top of the 256k boundaries, and
  73. will load a sample in there if it will fit.
  74. Example : EndSize = 252144
  75. If the next sample was 12000 bytes, its SizeStart would be 262144, not 252144.
  76. Note that this leaves 10000 bytes unused. If any of the following sample could
  77. fit between 252144 and 262144, its Sizestart would be 252144.
  78. Say that 2 samples after the 12000 byte sample we had a sample that was only
  79. 5000 bytes long. Its SizeStart would be 252144 and its SizeEnd would be 257144.
  80. This also applies to 16 Bit Samples.
  81.  
  82. 16 Bit Samples :
  83. 16 bit samples are handled a little different then 8 bit samples.
  84. The SizeStart variable is calculated by dividing offset (last SizeEnd)
  85. by 2. The SizeEnd variable equals SizeStart + (SampleLength / 2).
  86. If the first sample is 16bit, then SizeStart = 16.
  87. Example :
  88.           sample1 = 8bit, 1000 bytes
  89.           sample2 = 16bit, 5000 bytes
  90.  
  91.           sample1 SizeStart = 32
  92.                   SizeEnd   = 1032 (32 + 1000)
  93.  
  94.           sample2 SizeStart = 516 (offset (1032) / 2)
  95.                   SizeEnd   = 3016 (516 + (5000/2))
  96.  
  97. ***Note***
  98. If a 16bit sample is loaded into banks 2,3, or 4
  99. the SizeStart variable will be
  100. (offset / 2) + 262144 (bank 2)
  101. (offset / 2) + 524288 (bank 3)
  102. (offset / 2) + 786432 (bank 4)
  103. The SizeEnd variable will be
  104. SizeStart + (SampleLength / 2) + 262144 (bank 2)
  105. SizeStart + (SampleLength / 2) + 524288 (bank 3)
  106. SizeStart + (SampleLength / 2) + 786432 (bank 4)
  107.  
  108. BiDi Loop : (Bidirectional Loop)
  109. UT takes advantage of the Gus's ability to loop a sample in several different
  110. ways. By setting the Bidi Loop, the sample can be played forward or backwards,
  111. looped or not looped. The Bidi variable also tracks the sample
  112. resolution (8 or 16 bit).
  113.  
  114. The following table shows the possible values of the Bidi Loop.
  115. Bidi = 0  : No looping, forward playback,  8bit sample
  116. Bidi = 4  : No Looping, forward playback, 16bit sample
  117. Bidi = 8  : Loop Sample, forward playback, 8bit sample
  118. Bidi = 12 : Loop Sample, forward playback, 16bit sample
  119. Bidi = 24 : Loop Sample, reverse playback 8bit sample
  120. Bidi = 28 : Loop Sample, reverse playback, 16bit sample
  121. ______________________________________________________________________________
  122. Event Structure:
  123. ______________________________________________________________________________
  124. Note                : byte (See note table below)
  125. SampleNumber        : byte (Sample Number)
  126. Effect1             : nib (Effect1)
  127. Effect2             : nib (Effect2)
  128. EffectVar           : word (Effect variables)
  129.  
  130. The High order byte of EffectVar is the Effect variable for Effect1.
  131. The Low order byte of EffectVar is the Effect variable for Effect2.
  132. ***(Note)***
  133. UT uses a form of compression on repetitive events. Say we read in the first
  134. byte, if it = $FC then this signifies a repeat block. The next byte is the
  135. repeat count. followed by the event structure to repeat.
  136. If the first byte read does NOT = $FC then this is the note of the event.
  137. So repeat blocks will be 7 bytes long : RepFlag      : byte ($FC)
  138.                                         RepCount     : byte
  139.                                         note         : byte
  140.                                         samplenumber : byte
  141.                                         effect1      : nib
  142.                                         effect2      : nib
  143.                                         effectVar    : word
  144.  
  145. Repeat blocks do NOT bridge patterns. 
  146. ______________________________________________________________________________
  147. Note Table:
  148. ______________________________________________________________________________
  149. note value of 0 = pause
  150. C-0 to B-0    1 to 12
  151. C-1 to B-1    13 to 24
  152. C-2 to B-2    26 to 36
  153. C-3 to B-3    39 to 48
  154. C-4 to B-4    52 to 60
  155. ______________________________________________________________________________
  156. Offset     Bytes            Type                   Description
  157. ______________________________________________________________________________
  158. 0             15           byte           ID block : should contain
  159.                                                      'MAS_UTrack_V001'
  160.                                           
  161.                                           (* v1.4: 'MAS_UTrack_V002')
  162.                                           (* v1.5: 'MAS_UTrack_V003')
  163.                                           (* v1.6: 'MAS_UTrack_V004')
  164.  
  165. 15            32           AsciiZ         Song Title
  166. 47            1            reserved       This byte is reserved and
  167.                                           always contain 0;
  168.  
  169.                                           (* v1.4: jump-value: reserved * 32; 
  170.                                            space between is used for song
  171.                                            text;
  172.                                            [reserved * 32] = RES ! )
  173.  
  174. 48+RES        1            byte           Number of Samples (NOS)
  175. 49+RES        NOS * 64     SampleStruct   Sample Struct (see Sample Structure)
  176.  
  177. Patt_Seq = 48 + (NOS * 64) + RES
  178.                        
  179. Patt_Seq          256        byte            Pattern Sequence
  180. Patt_Seq+256      1          byte            Number Of Channels (NOC) Base 0
  181. Patt_Seq+257      1          byte            Number Of patterns (NOP) Base 0
  182.  
  183.                                              (* V1.5: PAN-Position Table
  184.                                               Length: NOC * 1byte
  185.                                               [0 left] - [0F right] )
  186.  
  187. NOC+Patt_Seq+258      varies     EventStruct     Pattern Data (See Event Structure)
  188.  
  189. ______________________________________________________________________________
  190. The remainder of the file is the raw sample data. (signed)
  191. ______________________________________________________________________________
  192.  
  193. That should about cover it. If you have any questions , feel free
  194. to e-mail me at
  195. freejack@shell.portal.com
  196.  
  197. I can also be contacted on The UltraSound Connection   (813) 787-8644 
  198. The UltraSound Connection is a BBS dedicated to the Gravis Ultrasound Card.
  199.  
  200. Also I'm the author of Ripper and Gvoc. If anyone has any questions or problems,
  201. please contact me.
  202.  
  203.