home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / buzzmachines_massive.exe / Dev / bmformat.txt < prev    next >
Encoding:
Text File  |  2001-08-26  |  6.9 KB  |  295 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.  
  26.  
  27. Section 'MACH' - machines
  28.  
  29. v1.2 note: machines with MIF_CONTROL_MACHINE flag should be the last machines in this section
  30.  
  31. Type/Size    Description
  32. -------------------------------------------------------------------------
  33. word        number of machines
  34.  
  35. (first machine - always master)
  36. asciiz        name 
  37. byte        type (0 = master, 1 = generator, 2 = effect)
  38. asciiz        name of DLL if type is 1 or 2
  39. float        X coordinate in machines view [-1..1]
  40. float        Y coordinate in machines view [-1..1]
  41. dword        size of machine specific data
  42. x        data
  43. word        number of attributes
  44.  
  45. (first attribute)
  46. asciiz        key
  47. dword        value
  48.  
  49. (second attribute)
  50. ...
  51.  
  52. x            state of global parameters
  53. word        number of tracks 
  54. x            state of track parameters for each track
  55.  
  56. (second machine)
  57. ...
  58.  
  59. =========================================================================
  60.  
  61. Section 'CONN' - machine connections
  62.  
  63. Type/Size    Description
  64. -------------------------------------------------------------------------
  65. word        number of connections
  66.  
  67. (first connection)
  68. word         index of source machine
  69. word        index of destination machine
  70. word        amp
  71. word        pan
  72.  
  73. (second connection)
  74. ...
  75.  
  76.  
  77. =========================================================================
  78.  
  79. Section 'PATT' - patterns for each machine 
  80.  
  81. Type/Size    Description
  82. -------------------------------------------------------------------------
  83. (first machine)
  84. word        number of patterns
  85. word        number of tracks
  86.  
  87. (first pattern)
  88. asciiz        name 
  89. word        length of pattern in number of ticks (rows)
  90. x        pattern data
  91.  
  92. (second pattern)
  93. ...
  94.  
  95. (second machine)
  96. ...
  97.  
  98. =========================================================================
  99.  
  100. Section 'SEQU' - pattern sequences 
  101.  
  102. Type/Size    Description
  103. -------------------------------------------------------------------------
  104. dword        end of song 
  105. dword        begin of loop
  106. dword        end of loop    
  107. word        number of sequences
  108.  
  109. (first sequence)
  110. word        index of machine
  111. dword        number of events
  112. byte        bytes per event pos 
  113. byte        bytes per event (2 if there are more than 112 patterns)
  114. x            event list (pos, event, pos, event, pos, event...). events:
  115.                 00 = mute, 01 = break, 02 = thru
  116.                 0x10 = first pattern, 0x11 = second pattern, etc.
  117.                 msb=1 indicates loop
  118.  
  119. (second sequence)
  120. ...
  121.  
  122. =========================================================================
  123.  
  124. Section 'WAVT' - wavetable 
  125.  
  126. Type/Size    Description
  127. -------------------------------------------------------------------------
  128. word        number of waves
  129.  
  130. (first wave)
  131. word        index
  132. asciiz        full file name, e.g. "c:\waves\blah.wav"
  133. asciiz        name
  134. float        volume 
  135. byte        flags:
  136.                 bit 0: loop
  137.                 bit 1: don't save
  138.                 bit 2: floating point memory format
  139.                 bit 3: stereo (since 1.2)
  140.                 bit 4: bidirectional loop (since 1.2)
  141.                 bit 7: envelopes follow (since alpha 14)  
  142.  
  143. if flag bit 7 --------->
  144.     word        number of envelopes 
  145.     
  146.     (first envelope)
  147.     word        Attack time
  148.     word        Decay time
  149.     word        Sustain level
  150.     word        Release time
  151.     byte        ADSR Subdivide
  152.     byte        ADSR Flags: 0-1 = attack mode, 2-3 = release mode, 4 = linear decay, 5 = sustain
  153.         
  154.     word        number of points (can be zero) (bit 15 set = envelope disabled)
  155.     
  156.     (first point)
  157.     word        x 
  158.     word        y 
  159.     byte        flags: bit 0 = sustain
  160.                     
  161.     (second point)
  162.     ...
  163.     
  164.     (second envelope)
  165.     ...
  166. <----------- end of if flag bit 7
  167.  
  168. byte        number of levels
  169.  
  170. (first level)
  171. dword        number of samples
  172. dword        loop begin
  173. dword        loop end
  174. dword        samples per second
  175. byte        root note
  176.  
  177. (second level)
  178. ...
  179.  
  180. (second wave)
  181. ...
  182.  
  183.  
  184. =========================================================================
  185.  
  186. Section 'CWAV' or 'WAVE' - wave data, check for 'CWAV' first then for 'WAVE'
  187.  
  188.  
  189. Type/Size    Description
  190. -------------------------------------------------------------------------
  191. word        number of waves
  192.  
  193. (first wave)
  194. word        index of wave    
  195. byte        format:
  196.                 0 - raw 16bit, intel byteorder
  197.                 1 - proprietary compressed format (v1.2 uses this one by default)
  198.                 
  199. format 0:
  200.  
  201. dword        number of bytes in all levels
  202.   
  203. (data for first level)
  204. ..
  205.  
  206. (data for second level)
  207. ...
  208.  
  209. (second wave)
  210. ...
  211.  
  212. =========================================================================
  213.  
  214. Section 'BLAH' - song info
  215.  
  216. Type/Size    Description
  217. -------------------------------------------------------------------------
  218. dword        number of characters
  219. x        raw ascii text (no zero at end)
  220.  
  221. =========================================================================
  222.  
  223. Section 'PARA' - parameter information for machines
  224.  
  225.  - added in v1.2. This section is not required for loading the song if user
  226.    has right versions of all machines installed. otherwise the information
  227.    here can be used to convert pattern data to the new format.
  228.    
  229. Type/Size    Description
  230. -------------------------------------------------------------------------
  231. dword        number of machines
  232.  
  233. (first machine)
  234. asciiz        name
  235. asciiz        type (for example "Jeskola Tracker")
  236. dword        number of global parameters
  237. dword        number of track parameters
  238.  
  239. (first parameter - all global first followed track-parameters)
  240.  see CMachineParameter in MachineInterface.h for more information
  241.  all fields except "Description" are saved
  242.  
  243. byte        type
  244. asciiz        name
  245. int        minvalue
  246. int        maxvalue
  247. int        novalue
  248. int        flags
  249. int        defvalue
  250.  
  251. (second parameter)
  252. ...
  253.  
  254. (second machine)
  255. ...
  256.  
  257.  
  258. =========================================================================
  259.  
  260. Section 'PDLG' - parameter dialog placements on screen
  261. - added in v1.2
  262.  
  263. byte        flags:
  264.             bit 1: dialogs visible
  265.  
  266. list of positions followed by terminating zero byte:
  267.  
  268. asciiz        name of machine
  269. WINDOWPLACEMENT    win32 window placement structure (see win32 documentation)
  270.  
  271.  
  272. =========================================================================
  273.  
  274. Section 'MIDI' - midi controller bindings
  275. - added in v1.2
  276.  
  277. list of bindings followed by terminating zero byte:
  278.  
  279. asciiz        name of machine
  280. byte        parameter group
  281. byte        parameter track
  282. byte        parameter number
  283. byte        midi channel
  284. byte        midi controller number
  285.  
  286.  
  287. =========================================================================
  288.  
  289. Section 'BVER' - buzz version information
  290. - added in v1.2
  291.  
  292. asciiz        buzz version, date and time of build
  293.  
  294.  
  295. =========================================================================