Advertisement
loveemu

Hudson music format (SNES) - Video Game Music Formats Wiki

Nov 15th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.76 KB | None | 0 0
  1. Hudson's SNES music driver (also known as SFX SOUND DRIVER) is a standard music engine used by games developed by Hudson.
  2.  
  3. The driver usually writes its version to APU RAM.
  4.  
  5. <pre>
  6. Example: SFX SOUND DRIVER Version 1.16 Copyright(c) 1993,94 Hudson Soft Program : LU.Iwabuchi Driver : Kazumi-TYPE
  7. </pre>
  8.  
  9. There are a lot of slightly different versions.
  10. However, they can be classified roughly in Ver 1.xx and Ver 2.xx.
  11. This article explains about the driver, through the specification of Super Bomberman 5 music, and mentions the version differences.
  12.  
  13. == Applications ==
  14.  
  15. The following is the list of games which use this music driver.
  16.  
  17. * No Version String
  18. ** Super Bomberman 2 (mostly 1.xx compatible)
  19. ** Hagane (mostly 1.xx compatible)
  20. ** An American Tail: Fievel Goes West (1.xx compatible?)
  21. * Version 1.xx
  22. ** Super Bomberman 3 (1.16)
  23. ** Super Genjin 2 (1.16E)
  24. ** Caravan Shooting Collection (1.17s)
  25. * Version 2.xx
  26. ** Do-Re-Mi Fantasy (2.10)
  27. ** Tengai Makyou Zero (2.27b)
  28. ** Super Bomberman 4 (2.28)
  29. ** Kishin Douji Zenki 3 (2.28)
  30. ** Same Game (2.30a)
  31. ** Super Bomberman 5 (2.32)
  32. ** Bomberman B-Daman (2.32)
  33.  
  34. == Whole Structure ==
  35.  
  36. * Note: Numbers are stored in little-endian.
  37. * Note: Addresses ($xxxx) in this document are APU RAM address. You can convert the RAM address to an offset in SPC file, by adding 0x100 to the address.
  38.  
  39. Whole structure of sound data on APU RAM is something like the following.
  40.  
  41. <pre>
  42. [Explanatory Chart]
  43. Region Name ($xxxx : starting address)
  44. + Address 1: Field Name 1 = $yyyy Example of value
  45. + Address 2: Field Name 2 = $zzzz Example of value
  46.  
  47. [Music Data Structure Sample]
  48. Music Data Pointer Region
  49. + 0803: Music Data Region Pointer = $3000
  50.  
  51. Music Data Region ($3000)
  52. + 3000: Song List Pointer = $3002
  53.  
  54. Song List Region ($3002)
  55. + 3002: Song Header Pointer 1 = $35b6
  56. + 3004: Song Header Pointer 2 = $xxxx
  57.  
  58. Song Header Region ($35b6)
  59. + 35b6: Header Events (Variable Length)
  60. </pre>
  61.  
  62. In the case of Super Bomberman 5, you can access to the song data sequentially from $0803.
  63.  
  64. Since the driver can have and use multiple songs in APU RAM, it has song list region prior to an individual song.
  65. The first song is used in most cases. Some jingles might be at the second song.
  66.  
  67. You can access a song header from the song list. The next section explain the detail of the header.
  68.  
  69. == Song Header ==
  70.  
  71. Like a usual song data, a song header is a collection of header events.
  72. The first byte specifies the type of the header event, and the following bytes can be parameters (length depends on the event type).
  73. Header event 00 means the end of header.
  74.  
  75. Score data locations for each channels must be specified by a header event.
  76.  
  77. The following is the list of song header events.
  78.  
  79. * 00 - End Of Header
  80. * 01 xx .. - Set Channel Addresses
  81. * 02 xx - Set Timebase
  82. * 03 xx .. - Set Instrument Table
  83. * 04 xx .. - Set Rhythm Kit Table
  84. * 05 xx .. - Set Unknown Table 1
  85. * 06 xx .. - Set Unknown Table 2
  86. * 07 xx .. - Set Initial Echo Parameters
  87. * 08 xx - Set Unknown Byte
  88. * 09 xx .. - Set Unknown Table 3
  89.  
  90. === 01 xx .. [Set Channel Addresses] ===
  91.  
  92. This event can specify which channel is used, and set start address of them.
  93.  
  94. The first byte specifies which channel is used. Each bits is a flag for each channels.
  95.  
  96. <pre>
  97. 87654321 : bit (channel number)
  98. xxxxxxxx : 1=active, 0=inactive
  99. </pre>
  100.  
  101. Address of each channel is located after the first byte.
  102. The number of addresses must be determined how many channels will be active.
  103. Smallest channel appears at the first.
  104.  
  105. <pre>
  106. [Example Of Header Event 01]
  107. Header Event 01
  108. + 35b5: $01
  109. + 35b6: Channel Active/Inactive Flags (1 byte) = $ff
  110. + 35b7: Score Data Address 1 = $4222
  111. + 35b9: Score Data Address 2 = $4303
  112. : (continues for all active channels, maximum count is 8)
  113.  
  114. Score Data 1 ($4222)
  115. + 4222: ...
  116. Score Data 2 ($4303)
  117. + 4303: ...
  118. :
  119. </pre>
  120.  
  121. === 02 xx [Set Timebase] ===
  122.  
  123. This event can set timebase.
  124. xx must be in the range of 0-3.
  125. Actual timebase value will be (48 >> xx).
  126.  
  127. === 03 xx .. [Set Instrument Table] ===
  128.  
  129. This event can set instrument table address.
  130. An instrument table has SRCN and ADSR information for each instruments.
  131.  
  132. xx is the number of elements in the table.
  133. The table contents continue after it for (xx * 4) bytes.
  134.  
  135. An instrument table has the following fields.
  136.  
  137. * 00: SRCN
  138. * 01: ADSR(1)
  139. * 02: ADSR(2)
  140. * 03: GAIN
  141.  
  142. === 04 xx .. [Set Rhythm Kit Table] ===
  143.  
  144. This event can set rhythm kit table address.
  145. The table is used when rhythm kit mode is turned on by FE 03.
  146. It determines instruments, volumes, etc. for each note numbers.
  147.  
  148. xx is the number of elements in the table.
  149. The table contents continue after it for (xx * 4) bytes.
  150.  
  151. An rhythm kit table has the following fields.
  152.  
  153. * 00: Instrument # (same as event D6)
  154. * 01: Note Number (0-71)
  155. * 02: Volume (same as event D9)
  156. * 03: Panpot (same as event DA)
  157.  
  158. === 05 xx .. [Unknown Table] ===
  159.  
  160. This event can set a table address.
  161. The usage of the table is not analyzed yet.
  162.  
  163. xx is the number of elements in the table.
  164. The table contents continue after it for (xx * 2) bytes.
  165.  
  166. === 06 xx .. [Unknown Table 2] ===
  167.  
  168. This event can set a table address.
  169. The usage of the table is not analyzed yet.
  170.  
  171. xx is the number of elements in the table.
  172. The table contents continue after it for (xx * 2) bytes.
  173.  
  174. === 07 xx .. [Initial Echo Settings] ===
  175.  
  176. This event can set initial echo settings of the song.
  177. This event is a variable-length event, and the first byte determines the length.
  178.  
  179. When the first byte xx is 0, values of echo registers will continue after it.
  180. The values will appear in order of EVOL(L), EVOL(R), EDL, EFB, FIR #, EON.
  181.  
  182. When the first byte xx is not 0, it will take no additional parameters, and it applies a default echo settings.
  183. Default echo settings are probably located at $0858.
  184.  
  185. === 08 xx [Unknown Byte] ===
  186.  
  187. Unknown event.
  188.  
  189. === 09 xx .. [Unknown Table 3] ===
  190.  
  191. This event can set a table address.
  192. The usage of the table is not analyzed yet.
  193.  
  194. xx is the number of elements in the table.
  195. The table contents continue after it for (xx * 2) bytes.
  196.  
  197. === 00 [End Of Header] ===
  198.  
  199. This event must exist at the end of header.
  200.  
  201. After the process of those header events, the music engine will start playing the song by parsing the score of each channel addresses set by header event 01.
  202.  
  203. == Score Data ==
  204.  
  205. The music engine is internally tick-based.
  206. Timebase (TPQN) can be chosen from 48, 24, 12 and 6, and the default timebase is 12. (see header event 02 for details)
  207.  
  208. The following is the list of score events.
  209.  
  210. * 00~CF (xx) - Rest/Note (Variable-Length Event)
  211. * D0 - ?
  212. * D1 xx - Set Tempo
  213. * D2 xx - Set Octave
  214. * D3 - Octave Up
  215. * D4 - Octave Down
  216. * D5 xx - Set Quantize
  217. * D6 xx - Set Instrument
  218. * D7 - NOP
  219. * D8 - NOP
  220. * D9 xx - Set Volume
  221. * DA xx - Set Panpot
  222. * DB xx - Set Reverse-Phase
  223. * DC xx - Increase/Decrease Volume
  224. * DD xx - Repeat Start
  225. * DE - Repeat End
  226. * DF xx yy - Subroutine Call
  227. * E0 xx yy - Jump
  228. * E1 xx - Tuning
  229. * E2 xx yy zz - Set Vibrato
  230. * E3 xx - Set Vibrato Delay
  231. * E4 xx yy - Set Echo Volume
  232. * E5 xx yy zz - Set Echo Delay, Feedback, FIR
  233. * E6 - Echo On
  234. * E7 xx - Key Shift (Absolute)
  235. * E8 xx - Key Shift (Relative)
  236. * E9 xx yy zz - Set Attack Pitch Envelope
  237. * EA - Set Attack Pitch Envelope Off
  238. * EB - Set Song Loop Point
  239. * EC - Jump To Song Loop Point
  240. * ED - Set Song Loop Point (Works Only Once)
  241. * EE xx - NOP
  242. * EF xx yy - ?
  243. * F0 xx - ?
  244. * F1 xx yy - Set Portamento
  245. * F2 xx - ?
  246. * F3 xx - ?
  247. * F4~FD - NOP
  248. * FE xx .. - Subevents
  249. * FF - End Of Subroutine / End Of Track
  250.  
  251. === 00~CF (xx) [Rest/Note] (Variable-Length Event) ===
  252.  
  253. The note byte itself work as a parameter.
  254.  
  255. <pre>
  256. [Bits of Note Byte]
  257. kkkkslll
  258. k : Key (0~11) 0=C, 1=C# ... 11=B
  259. s : Slur/Tie (1=on, 0=off)
  260. l : Length (0~7)
  261. </pre>
  262.  
  263. The key of note is specified by bits 4~7.
  264. Octave can be specified by another event. (see event D2~D4)
  265.  
  266. Slue/Tie bit is used when the note will be combined to the next note.
  267. (the next note will just change the pitch and keep volume envelopes)
  268.  
  269. If the length field is 0, the next byte (xx) is the actual note length (in ticks).
  270.  
  271. If the length field is not 0, it will not take an additional parameter, and the note length is determined from the following table.
  272.  
  273. {|
  274. ! Value
  275. ! Length
  276. ! Ticks (in case of TPQN=48)
  277. |-
  278. | 1
  279. | Whole Note
  280. | 192
  281. |-
  282. | 2
  283. | Half Note
  284. | 96
  285. |-
  286. | 3
  287. | Quarter Note
  288. | 48
  289. |-
  290. | 4
  291. | Eighth Note
  292. | 24
  293. |-
  294. | 5
  295. | Sixteenth Note
  296. | 12
  297. |-
  298. | 6
  299. | Thirty-second Note
  300. | 6
  301. |-
  302. | 7
  303. | Sixty-fourth Note
  304. | 3
  305. |}
  306.  
  307. If timebase is halved (TPQN=24), ticks are halved like the following.
  308.  
  309. {|
  310. ! Value
  311. ! Length
  312. ! Ticks (in case of TPQN=24)
  313. | 1
  314. | Whole Note
  315. | 96
  316. |-
  317. | 2
  318. | Half Note
  319. | 48
  320. |-
  321. | 3
  322. | Quarter Note
  323. | 24
  324. |-
  325. | 4
  326. | Eighth Note
  327. | 12
  328. |-
  329. | 5
  330. | Sixteenth Note
  331. | 6
  332. |-
  333. | 6
  334. | Thirty-second Note
  335. | 3
  336. |-
  337. | 7
  338. | Sixty-fourth Note
  339. | 1.5
  340. |}
  341.  
  342. Note that the music engine will handle the decimal part of 1.5 ticks.
  343. Do not use sixteenth note if TPQN is less than 24, or the music engine will read the out of table range and perform unexpectedly.
  344.  
  345. The actual "duration" of the note can be adjusted by quantize event. (see event D5)
  346.  
  347. === D0 [?] ===
  348.  
  349. Unknown event.
  350.  
  351. === D1 xx [Set Tempo] ===
  352.  
  353. Set tempo in BPM. Default value is 120.
  354.  
  355. === D2 xx [Set Octave] ===
  356.  
  357. Set octave in the range of 0~5.
  358.  
  359. === D3 [Octave Up] ===
  360.  
  361. Increase octave, if the current octave is not 5 (maximum value).
  362.  
  363. === D4 [Octave Down] ===
  364.  
  365. Decrease octave, if the current octave is not 0 (minimum value).
  366.  
  367. === D5 xx [Set Quantize] ===
  368.  
  369. Set quantize (duration rate of note).
  370.  
  371. ;xx=0~8
  372. :Duration will be (L * xx / 8). (where L is the full length of a note, in ticks)
  373. ;xx=9~
  374. :Duration will be (L - (xx - 8)).
  375.  
  376. === D6 xx [Set Instrument] ===
  377.  
  378. Set instrument.
  379. Actual sample number and ADSR envelopes are obtained from xxth element of instrument table.
  380. (see header event 03)
  381.  
  382. === D9 xx [Set Volume] ===
  383.  
  384. Set channel volume. xx is treated as a signed value, and is clipped in the range of 0~79.
  385.  
  386. Actual volume amount is determined by the following table.
  387.  
  388. <syntaxhighlight lang="c">
  389. const byte volTableV2[] = {
  390. 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02,
  391. 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03,
  392. 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05,
  393. 0x05, 0x06, 0x06, 0x06, 0x07, 0x07, 0x08, 0x08,
  394. 0x09, 0x09, 0x0a, 0x0a, 0x0b, 0x0b, 0x0c, 0x0d,
  395. 0x0e, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14,
  396. 0x15, 0x17, 0x18, 0x1a, 0x1b, 0x1d, 0x1e, 0x20,
  397. 0x22, 0x24, 0x26, 0x28, 0x2b, 0x2d, 0x30, 0x33,
  398. 0x36, 0x39, 0x3d, 0x40, 0x44, 0x48, 0x4c, 0x51,
  399. 0x56, 0x5b, 0x60, 0x66, 0x6c, 0x72, 0x79, 0x80,
  400. };
  401. </syntaxhighlight>
  402.  
  403. === DA xx [Set Panpot] ===
  404.  
  405. Set panpot.
  406. xx is treated as a signed value, and is clipped in the range of 0~30.
  407. 0 is the most right, 15 is the center, and 30 is the most left.
  408. (note that the direction is opposite from MIDI)
  409.  
  410. Actual volume balance is determined by the following table.
  411.  
  412. <syntaxhighlight lang="c">
  413. const byte panTable[] = {
  414. 0x00, 0x07, 0x0d, 0x14, 0x1a, 0x21, 0x27, 0x2e,
  415. 0x34, 0x3a, 0x40, 0x45, 0x4b, 0x50, 0x55, 0x5a,
  416. 0x5e, 0x63, 0x67, 0x6b, 0x6e, 0x71, 0x74, 0x77,
  417. 0x79, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x7f,
  418. };
  419. </syntaxhighlight>
  420.  
  421. === DB xx [Set Reverse-Phase] ===
  422.  
  423. Set reverse-phase switch for left/right speaker (per-channel event).
  424. 0 for no-reverse, +2 for reverse-left, and +1 for reverse-right.
  425.  
  426. === DC xx [Increase/Decrease Volume] ===
  427.  
  428. Increase or decrease volume which is set by event D9.
  429. xx is a signed value, and it is added to the current volume (clipped to 0~79).
  430.  
  431. === DD xx [Repeat Start] ===
  432.  
  433. Repeat playing the phrase surrounded by event DD and DE for xx times (0 means 256 times).
  434. Those events can be nested.
  435.  
  436. This event will push 3 bytes to the return address stack.
  437. Since the stack size is 16 bytes, maximum nest level is 5.
  438. Also, the stack is shared with Call-Return events.
  439.  
  440. === DE [Repeat End] ===
  441.  
  442. Specifies the end of repeat. (see event DD)
  443.  
  444. Jump to the repeat start address, until the phrase is repeated for specified times.
  445.  
  446. === DF xx yy [Subroutine Call] ===
  447.  
  448. Jump to $yyxx, and can return from there by event FF.
  449.  
  450. This event will push 2 bytes to the return address stack.
  451. Since the stack size is 16 bytes, maximum nest level is 8.
  452. Also, the stack is shared with Repeat events.
  453.  
  454. === FF [End Of Subroutine / End Of Track] ===
  455.  
  456. Jump to the return address saved by event DF.
  457. If it's not in subroutine, stop the activity of the channel.
  458.  
  459. === E0 xx yy [Jump] ===
  460.  
  461. Jump to $yyxx (goto).
  462.  
  463. This event is usually not used, because some other events are available for setting an infinite loop.
  464.  
  465. === EB [Set Song Loop Point] ===
  466.  
  467. Set loop point to this position. (see event EC)
  468.  
  469. === EC [Jump To Song Loop Point] ===
  470.  
  471. Jump to the loop point set by event EB.
  472. If no loop point is set, it will jump to the beginning.
  473.  
  474. === ED [Set Song Loop Point (Works Only Once)] ===
  475.  
  476. Set loop point to this position.
  477. This event works the same as event EB, except it only works the first time.
  478. Event EB can work regardless of this event.
  479.  
  480. === E1 xx [Tuning] ===
  481.  
  482. Adjust the pitch of note. Amount is (xx / 256 * 100) cents.
  483.  
  484. === E2 xx yy zz [Set Vibrato] ===
  485.  
  486. Set vibrato (pitch LFO).
  487.  
  488. ;xx
  489. :Vibrato Speed ?
  490. ;yy
  491. :Vibrato Depth ?
  492. ;zz
  493. :?
  494.  
  495. === E3 xx [Set Vibrato Delay] ===
  496.  
  497. Set vibrato delay, the amount of time that elapses from when a key is played to when the Vibrato effect starts.
  498. The higher the value, the longer the delay before the onset of the Vibrato effect.
  499.  
  500. === E4 xx yy [Set Echo Volume] ===
  501.  
  502. Set echo volume.
  503.  
  504. ;xx
  505. :Echo Volume (L)
  506. ;yy
  507. :Echo Volume (R)
  508.  
  509. === E5 xx yy zz [Set Echo Delay, Feedback, FIR] ===
  510.  
  511. Set echo parameters.
  512.  
  513. ;xx
  514. :Echo Delay
  515. ;yy
  516. :Echo Feedback
  517. ;zz
  518. :Echo FIR # (0~17?)
  519.  
  520. I am not sure about the valid range of FIR #, but I think the following ones are allowed.
  521.  
  522. <pre>
  523. 00: 7f 00 00 00 00 00 00 00
  524. 01: 58 bf db f0 fe 07 0c 0c
  525. 02: 0c 21 2b 2b 13 fe f3 f9
  526. 03: 34 33 00 d9 e5 01 fc eb
  527. 04: 23 ca f8 2c eb 08 fb 02
  528. 05: 04 f9 f8 27 27 f8 f9 04
  529. 06: 14 ff da 1d 1f e0 ff 0c
  530. 07: 1b db 33 f2 fd 0e fc fd
  531. 08: 3b ba 13 1b 02 f6 fd 01
  532. 09: 29 b9 fd 24 0d f7 fa 00
  533. 0a: 35 a8 ff 1a 12 04 f8 fb
  534. 0b: 1c cc 2f ec f8 12 00 fa
  535. 0c: 3b ba 13 1b 02 f6 fd 01
  536. 0d: fa 00 1c 29 29 1c 00 fa
  537. 0e: fe fd 16 34 34 16 fd fc
  538. 0f: fe fb 10 3a 3a 10 fb fe
  539. 10: 48 26 0a dd 08 0d f9 00
  540. 11: 38 48 14 e6 01 0a fe fe
  541. </pre>
  542.  
  543. === E6 [Echo On] ===
  544.  
  545. Enable channel echo.
  546. To disable echo, use event FE.
  547.  
  548. === E7 xx [Key Shift (Absolute)] ===
  549.  
  550. Set the transpose amount to xx semitones, where xx is a signed value.
  551.  
  552. === E8 xx [Key Shift (Relative)] ===
  553.  
  554. Increase (Decrease) the transpose amount to by xx semitones, where xx is a signed value.
  555.  
  556. === E9 xx yy zz [Set Attack Pitch Envelope] ===
  557.  
  558. Turn pitch slider on, to make the pitch change at key-on.
  559.  
  560. ;xx
  561. :Pitch Envelope Speed
  562. ;yy
  563. :Pitch Envelope Depth
  564. ;zz
  565. :Direction (0=from up to down, otherwise=from down to up)
  566.  
  567. === EA [Set Attack Pitch Envelope Off] ===
  568.  
  569. Disable the pitch envelope set by event E9.
  570.  
  571. === F1 xx yy [Set Portamento] ===
  572.  
  573. Set portamento (also called as slide, sweep).
  574.  
  575. ;xx
  576. :Portamento Speed (0=portamento off)
  577. ;yy
  578. :Not Used? (usually 0)
  579.  
  580. === FE xx .. [Subevents] ===
  581.  
  582. Do various operations specified by xx.
  583. Valid range of xx is 0x00~0x1f.
  584. The length of event depends on xx.
  585.  
  586. === NOP (No Operations) ===
  587.  
  588. Do nothing.
  589.  
  590. == Subevents (vcmd FE) ==
  591.  
  592. === FE 00 ===
  593.  
  594. Stop activity of the channel.
  595. This event works the same as event FF with no subroutines.
  596.  
  597. === FE 01 ===
  598.  
  599. Disable channel echo.
  600. To enable echo, use event E6.
  601.  
  602. === FE 03 ===
  603.  
  604. Turn rhythm kit mode on.
  605. When it is on, each note numbers can have a different sample, just like MIDI drums.
  606. See header event 04 for detail of note-instrument mappings.
  607.  
  608. === FE 04 ===
  609.  
  610. Turn rhythm kit mode off.
  611.  
  612. === NOP (No Operations) ===
  613.  
  614. * FE 05
  615. * FE 06
  616. * FE 07
  617. * FE 0E
  618. * FE 0F
  619.  
  620. Do nothing.
  621.  
  622. === Operator Events ===
  623.  
  624. * FE 10 xx yy (mov rxx, #yy)
  625. * FE 11 xx yy (mov rxx, ryy)
  626. * FE 12 xx yy (cmp rxx, #yy)
  627. * FE 13 xx yy (cmp rxx, ryy)
  628. * FE 14 xx yy (bne $yyxx)
  629. * FE 15 xx yy (beq $yyxx)
  630. * FE 16 xx yy (bcs $yyxx)
  631. * FE 17 xx yy (bcc $yyxx)
  632. * FE 18 xx yy (bmi $yyxx)
  633. * FE 19 xx yy (bpl $yyxx)
  634.  
  635. Do pseudo CPU operations.
  636. Pseudo registers r00~r07 can be used for operation.
  637. Registers are shared by all channels.
  638.  
  639. === ADSR Envelopes ===
  640.  
  641. * FE 10 xx (AR)
  642. * FE 11 xx (DR)
  643. * FE 12 xx (SL)
  644. * FE 13 xx (SR)
  645. * FE 14 xx (RR)
  646.  
  647. Set ADSR envelopes.
  648. Though hardware envelope of DSP does not have Release Rate,
  649. the music engine will set (0xa0 | xx) to GAIN at the software key-off timing.
  650.  
  651. === Unknown Events ===
  652.  
  653. * FE 02
  654. * FE 08
  655. * FE 09
  656. * FE 0A
  657. * FE 0B
  658. * FE 0C
  659. * FE 0D xx
  660.  
  661. == Differences in Version 1.x ==
  662.  
  663. This section explains about the differences between ver 1.x and ver 2.x, through the specification of Super Bomberman 3 music.
  664.  
  665. === Root Address ===
  666.  
  667. <blockquote>
  668. In the case of Super Bomberman 5, you can access to the song data sequentially from $0803.
  669. </blockquote>
  670.  
  671. In the case of Super Bomberman 3, the root address is $07c2.
  672.  
  673. In the case of Super Bomberman 2, the root address is $000d.
  674.  
  675. === Song Header ===
  676.  
  677. In ver 2.xx, channel addresses are defined through the header event 01.
  678.  
  679. In ver 1.xx, the parameter part of header event 01 must come at the beginning of header,
  680. and additional header events continue after it.
  681.  
  682. <pre>
  683. [Example of Song Header 1.xx]
  684. ff ; same as header event 01 of ver 2.xx (bitflags and addresses)
  685. 00 40
  686. 00 41
  687. 00 42
  688. 00 43
  689. 00 44
  690. 00 45
  691. 00 46
  692. 00 47
  693. 01 02 ; header event 01 (timebase)
  694. 00 ; header event 00 (end of header)
  695. </pre>
  696.  
  697. Also, header events are listed in a different order.
  698. Ver 1.xx has less events.
  699.  
  700. * 00 - End Of Header
  701. * 01 xx - Set Timebase
  702. * 02 xx .. - Set Instrument Table (Old)
  703. * 03 xx .. - Set Rhythm Kit Table (Old)
  704. * 04 xx .. - Set Instrument Table
  705. * 05 xx .. - Set Unknown Table
  706.  
  707. ==== 02 xx .. [Set Instrument Table (Old)] ====
  708.  
  709. This event can set instrument table address. xx is the length of the table (in bytes).
  710.  
  711. ==== 03 xx .. [Set Rhythm Kit Table (Old)] ====
  712.  
  713. This event can set rhythm kit table address. xx is the length of the table (in bytes).
  714.  
  715. === Score Data ===
  716.  
  717. Some events have different behavior.
  718.  
  719. * D0 - NOP
  720. * D7 xx - NOP (2 bytes)
  721. * D8 xx - NOP (2 bytes)
  722. * D9 xx - Set Volume
  723. * DA xx - Set Panpot
  724. * E2 xx yy - Set Vibrato
  725. * EE xx - Set Volume From Table
  726. * F2~FD - NOP
  727. * FE xx .. - Subevents
  728.  
  729. ==== D9 xx [Set Volume] ====
  730.  
  731. Set channel volume. xx is treated as a unsigned value.
  732.  
  733. Unlike ver 2.xx, it does not use any tables and it sets volume value directly.
  734. Event EE is more similar to ver 2.xx, which sets the volume from a table.
  735. (Super Bomberman 3 prefers event EE rather than this event)
  736.  
  737. ==== DA xx [Set Panpot] ====
  738.  
  739. Set panpot. xx is must be in the range of 0~30.
  740.  
  741. This event works the same as ver 2.xx, except the range check.
  742. When xx is more than 30, the music engine will perform unexpectedly.
  743.  
  744. ==== E2 xx yy [Set Vibrato] ====
  745.  
  746. Set vibrato (pitch LFO).
  747. Parameters are less than ver 2.xx.
  748.  
  749. ;xx
  750. :Vibrato Speed
  751. ;yy
  752. :Vibrato Depth
  753.  
  754. ==== EE xx [Set Volume From Table] ====
  755.  
  756. Set channel volume. xx is treated as a unsigned value, and is clipped in the range of 0~90.
  757.  
  758. Actual volume amount is determined by the following table.
  759.  
  760. <syntaxhighlight lang="c">
  761. const byte volTable[] = {
  762. 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
  763. 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
  764. 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
  765. 0x06, 0x06, 0x06, 0x07, 0x07, 0x08, 0x08, 0x09,
  766. 0x09, 0x0a, 0x0a, 0x0b, 0x0b, 0x0c, 0x0d, 0x0e,
  767. 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
  768. 0x17, 0x18, 0x1a, 0x1b, 0x1d, 0x1e, 0x20, 0x22,
  769. 0x24, 0x26, 0x28, 0x2b, 0x2d, 0x30, 0x33, 0x36,
  770. 0x39, 0x3c, 0x40, 0x44, 0x48, 0x4c, 0x51, 0x55,
  771. 0x5a, 0x60, 0x66, 0x6c, 0x72, 0x79, 0x80, 0x87,
  772. 0x8f, 0x98, 0xa1, 0xaa, 0xb5, 0xbf, 0xcb, 0xd7,
  773. 0xe3, 0xf1, 0xff,
  774. };
  775. </syntaxhighlight>
  776.  
  777. ==== FE xx .. [Subevents] ====
  778.  
  779. Do various operations specified by xx.
  780. Valid range of xx is 0x00~0x09.
  781. The following events are different from ver 2.xx.
  782.  
  783. * FE 05
  784. * FE 06
  785. * FE 07
  786.  
  787. Set vibrato type to 0, 1 or 2.
  788. Actually vibrato type 2 works the same as type 1.
  789.  
  790. ;0
  791. :Full form, pitch changes up and down from the base pitch.
  792. ;1
  793. :Half form, pitch changes up from the base pitch, but will never change down than base pitch. (vibrato speed will also be faster)
  794.  
  795. == External links ==
  796.  
  797. * [http://d.hatena.ne.jp/loveemu/20130610/Hudson_SFX_SOUND_DRIVER_SPC_Spec HUDSON SFX SOUND DRIVER (Super Bomberman 5, etc.) Specification - loveemu log]
  798. * [http://loveemu.googlecode.com/ Video game reverse engineering tool projects of loveemu] (MIDI converter tool called hudspc is available)
  799.  
  800. [[ja:ハドソン音楽フォーマット_(スーパーファミコン)]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement