home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PCGPEV10.ZIP / UT.TXT < prev    next >
Text File  |  1994-05-10  |  9KB  |  196 lines

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