home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / ULTRA161.ZIP / ULT_FORM.TXT < prev    next >
Encoding:
Text File  |  1994-07-27  |  11.1 KB  |  195 lines

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