home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / buzz1.zip / Dev / bmformat.txt < prev    next >
Text File  |  1998-07-22  |  5KB  |  210 lines

  1.  
  2. BM* format. I wrote this for myself so it may be a bit hard to understand. :)
  3. BMW is just like BMX except it doesn't include the 'WAVE' section.
  4.  
  5. Header:
  6.  
  7. Type/Size    Description
  8. -------------------------------------------------------------------------
  9. 4              "Buzz"
  10. dword        number of sections
  11. 12*31        up to 31 section dir entries
  12.  
  13. =========================================================================
  14.  
  15. Section dir entry:
  16.  
  17. Type/Size    Description
  18. -------------------------------------------------------------------------
  19. 4            four-char name of section
  20. dword        offset from begin of file
  21. dword        size in bytes
  22.  
  23. =========================================================================
  24.  
  25. Section 'MACH' - machines
  26.  
  27. Type/Size    Description
  28. -------------------------------------------------------------------------
  29. word        number of machines
  30.  
  31. (first machine - always master)
  32. asciiz        name 
  33. byte            type (0 = master, 1 = generator, 2 = effect)
  34. asciiz        name of DLL if type is 1 or 2
  35. float        X coordinate in machines view [-1..1]
  36. float        Y coordinate in machines view [-1..1]
  37. dword        size of machine specific data
  38. x            data
  39. word        number of attributes
  40.  
  41. (first attribute)
  42. asciiz        key
  43. dword        value
  44.  
  45. (second attribute)
  46. ...
  47.  
  48. x            state of global parameters
  49. word        number of tracks 
  50. x            state of track parameters for each track
  51.  
  52. (second machine)
  53. ...
  54.  
  55. =========================================================================
  56.  
  57. Section 'CONN' - machine connections
  58.  
  59. Type/Size    Description
  60. -------------------------------------------------------------------------
  61. word        number of connections
  62.  
  63. (first connection)
  64. word         index of source machine
  65. word        index of destination machine
  66. word        amp
  67. word        pan
  68.  
  69. (second connection)
  70. ...
  71.  
  72.  
  73. =========================================================================
  74.  
  75. Section 'PATT' - patterns for each machine 
  76.  
  77. Type/Size    Description
  78. -------------------------------------------------------------------------
  79. (first machine)
  80. word        number of patterns
  81. word        number of tracks
  82.  
  83. (first pattern)
  84. asciiz        name 
  85. word        length of pattern in number of ticks (rows)
  86. x            pattern data
  87.  
  88. (second pattern)
  89. ...
  90.  
  91. (second machine)
  92. ...
  93.  
  94. =========================================================================
  95.  
  96. Section 'SEQU' - pattern sequences 
  97.  
  98. Type/Size    Description
  99. -------------------------------------------------------------------------
  100. dword        end of song 
  101. dword        begin of loop
  102. dword        end of loop    
  103. word        number of sequences
  104.  
  105. (first sequence)
  106. word        index of machine
  107. dword        number of events
  108. byte        bytes per event pos 
  109. byte        bytes per event (2 if there are more than 112 patterns)
  110. x            event list (pos, event, pos, event, pos, event...). events:
  111.                 00 = mute, 01 = break, 02 = thru
  112.                 0x10 = first pattern, 0x11 = second pattern, etc.
  113.                 msb=1 indicates loop
  114.  
  115. (second sequence)
  116. ...
  117.  
  118. =========================================================================
  119.  
  120. Section 'WAVT' - wavetable 
  121.  
  122. Type/Size    Description
  123. -------------------------------------------------------------------------
  124. word        number of waves
  125.  
  126. (first wave)
  127. word        index
  128. asciiz        full file name, e.g. "c:\waves\blah.wav"
  129. asciiz        name
  130. float        volume 
  131. byte        flags:
  132.                 bit 0: loop
  133.                 bit 1: don't save
  134.                 bit 2: floating point memory format
  135.                 bit 7: envelopes follow (since alpha 14)  
  136.  
  137. if flag bit 7 --------->
  138.     word        number of envelopes 
  139.     
  140.     (first envelope)
  141.     word        Attack time
  142.     word        Decay time
  143.     word        Sustain level
  144.     word        Release time
  145.     byte        ADSR Subdivide
  146.     byte        ADSR Flags: 0-1 = attack mode, 2-3 = release mode, 4 = linear decay, 5 = sustain
  147.         
  148.     word        number of points (can be zero) (bit 15 set = envelope disabled)
  149.     
  150.     (first point)
  151.     word        x 
  152.     word        y 
  153.     byte        flags: bit 0 = sustain
  154.                     
  155.     (second point)
  156.     ...
  157.     
  158.     (second envelope)
  159.     ...
  160. <----------- end of if flag bit 7
  161.  
  162. byte        number of levels
  163.  
  164. (first level)
  165. dword        number of samples
  166. dword        loop begin
  167. dword        loop end
  168. dword        samples per second
  169. byte        root note
  170.  
  171. (second level)
  172. ...
  173.  
  174. (second wave)
  175. ...
  176.  
  177.  
  178. =========================================================================
  179.  
  180. Section 'WAVE' - wave data
  181.  
  182. Type/Size    Description
  183. -------------------------------------------------------------------------
  184. word        number of waves
  185.  
  186. (first wave)
  187. word        index of wave    
  188. byte        format:
  189.                 0 - raw 16bit, intel byteorder
  190. dword        number of bytes in all levels
  191.   
  192. (data for first level)
  193. ..
  194.  
  195. (data for second level)
  196. ...
  197.  
  198. (second wave)
  199. ...
  200.  
  201. =========================================================================
  202.  
  203. Section 'BLAH' - song info
  204.  
  205. Type/Size    Description
  206. -------------------------------------------------------------------------
  207. dword        number of characters
  208. x            raw ascii text (no zero at end)
  209.  
  210.