home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FAQSYS18.ZIP / FAQS.DAT / ULT-FORM.TXT < prev    next >
Text File  |  1996-01-04  |  9KB  |  192 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. 00h Samplename : 32 bytes (Sample name)
  24. 20h DosName    : 12 bytes (when you load a sample into UT,
  25.                       it records the file name here)
  26. 2Ch LoopStart  : dbl word (loop start point)
  27. 30h LoopEnd    : dbl word (loop end point)
  28. 34h SizeStart  : dbl word (see below)
  29. 38h SizeEnd    : dbl word (see below)
  30. 3Ch volume     : byte (UT uses a logarithmic volume setting, 0-255)
  31.                  (* V1.4: uses linear Volume ranging from 0-255 *)
  32. 3Dh Bidi Loop  : byte (see below)
  33. 3Eh 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. 0 Note                : byte (See note table below)
  113. 1 SampleNumber        : byte (Sample Number)
  114. 2 Effect1             : nib (Effect1)
  115. 2 Effect2             : nib (Effect2)
  116. 3 Effect2Data         : byte
  117. 4 Effect1Data         : byte
  118.  
  119. The High order byte of EffectVar is the Effect variable for Effect1.
  120. The Low order byte of EffectVar is the Effect variable for Effect2.
  121. ***(Note)***
  122. UT uses a form of compression on repetitive events. Say we read in the first
  123. byte, if it = $FC then this signifies a repeat block. The next byte is the
  124. repeat count. followed by the event structure to repeat.
  125. If the first byte read does NOT = $FC then this is the note of the event.
  126. So repeat blocks will be 7 bytes long : RepFlag      : byte ($FC)
  127.                                         RepCount     : byte
  128.                                       0 note         : byte
  129.                                       1 samplenumber : byte
  130.                                       2 effect1      : nib
  131.                                         effect2      : nib
  132.                                       3 effectVar    : word
  133.  
  134. Repeat blocks do NOT bridge patterns. 
  135. ______________________________________________________________________________
  136. Note Table:
  137. ______________________________________________________________________________
  138. note value of 0 = pause
  139. C-0 to B-0    1 to 12
  140. C-1 to B-1    13 to 24
  141. C-2 to B-2    26 to 36
  142. C-3 to B-3    39 to 48
  143. C-4 to B-4    52 to 60
  144. ______________________________________________________________________________
  145. Offset     Bytes            Type                   Description
  146. ______________________________________________________________________________
  147. 0             15           byte           ID block : should contain
  148.                                                      'MAS_UTrack_V001'
  149.                                           
  150.                                           (* V1.4: 'MAS_UTrack_V002')
  151.  
  152.                                           (* V1.5: 'MAS_UTrack_V003')
  153.  
  154. 15            32           AsciiZ         Song Title
  155. 47            1            reserved       This byte is reserved and
  156.                                           always contain 0;
  157.  
  158.                                           (* V1.4: jump-value: reserved * 32; 
  159.                                            space between is used for song
  160.                                            text;
  161.                                            [reserved * 32] = RES ! )
  162.  
  163. 48+RES        1            byte           Number of Samples (NOS)
  164. 49+RES        NOS * 64     SampleStruct   Sample Struct (see Sample Structure)
  165.  
  166. Patt_Seq = 48 + (NOS * 64) + RES
  167.                        
  168. Patt_Seq          256        byte            Pattern Sequence
  169. Patt_Seq+256      1          byte            Number Of Channels (NOC) Base 0
  170. Patt_Seq+257      1          byte            Number Of patterns (NOP) Base 0
  171.  
  172.                                              (* V1.5: PAN-Position Table
  173.                                               Length: NOC * 1byte
  174.                                               [0 left] - [0F right] )
  175.  
  176. NOC+Patt_Seq+258      varies     EventStruct     Pattern Data (See Event Structure)
  177.  
  178. ______________________________________________________________________________
  179. The remainder of the file is the raw sample data. (signed)
  180. ______________________________________________________________________________
  181.  
  182. That should about cover it. If you have any questions , feel free
  183. to e-mail me at
  184. freejack@shell.portal.com
  185.  
  186. I can also be contacted on The UltraSound Connection   (813) 787-8644 
  187. The UltraSound Connection is a BBS dedicated to the Gravis Ultrasound Card.
  188.  
  189. Also I'm the author of Ripper and Gvoc. If anyone has any questions or problems,
  190. please contact me.
  191.  
  192.