home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / ultra150.zip / FORMAT.UT < prev    next >
Text File  |  1994-02-20  |  9KB  |  191 lines

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