Difference between revisions of "BMS file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(started a page on how to make interactive music.)
 
m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
A .bms file holds data for sequenced music in pikmin 1 and 2. Bms files are sort of like midis, but with more advanced features. A custom bms file can be
+
A <code>.bms</code> file holds data for sequenced music in ''Pikmin 2''. BMS files are similar to [[wikipedia:MIDI|MIDI files]], but have many more advanced features. Custom BMS files can be made with Flaaffy by Arookas (which can be found [https://github.com/arookas/flaaffy/releases here]), however Yoshi2's fork of Flaaffy is better suited to making BMS files for ''Pikmin 2''. You can find that [https://github.com/RenolY2/flaaffy/releases here].
made with Flaaffy by Arookas, which can be found here: https://github.com/arookas/flaaffy/releases.
 
  
 
+
== Documentation ==
== Documentation: ==
 
 
 
{{todo|Actually document every byte of a bms header and music data and what it all means.}}
 
{{todo|Actually document every byte of a bms header and music data and what it all means.}}
  
 +
== List of BMS files ==
 +
A full list of all the BMS files in ''Pikmin 2'' can be found [[Pikmin 2 BMS file list|here]].
  
 +
== Interactive music ==
 +
A lot of BMS music in ''Pikmin 2'' is interactive, meaning that parts of it change depending on what you do in the game. BMS files produced by Flaaffy do not support this by default, however they can be modified to be interactive. A tutorial to do this can be found [[Creating Interactive BMS Files|here]]. This currently only applies to overworld music and will not work for caves.
  
== Custom Interactive Music: ==
+
[[Category:File formats]]
So you want your pikmin 2 music to have the interactivity of normal pikmin 2 songs? Well, I can tell you how to do that. While Flaaffy made bms files dont have interactivity, enough hex editing can fix that. Note that this all only applies to the four overworld themes. Caves use a completely different system for interactive music that isn't yet understood. Also note that music made this way wont have the Louie swing variant, just the interactive event tracks(working, treasure, enemy near, combat, spiderwort) and the sunset version.
+
[[Category:Pikmin 2]]
 
 
 
 
 
 
== Getting started: ==
 
First off, make your midi. It's good to know ahead of time what tracks will serve what purpose. Remember that the combined total of all tracks can't exceed 16. I usually have between 5 - 8 main tracks and 1-2 for each of the special mixes. also make sure you have AudioRes/Seqs/seq.arc extracted, with all the bms files ready to replace. n_tutorial.bms is the Valley of Repose theme, Forest.bms is the Awakening Wood theme, yakushima.bms is the Perplexing Pool theme, and last.bms is the Wistful Wild theme.
 
 
 
Next, make the bms of your midi like you normally would with Flaaffy. The instruments and banks you choose with flaaffy don't matter. Make sure each track only loads an instrument and program once at the beginning of the track and never again. Get your bms and open it in HxD. Also open specifically the original last.bms in HxD. Regardless of what song your making, last.bms is the easiest to work with by far.
 
 
 
In last.bms, delete everytyhing after <code>0x04 90</code>, leaving just the header. Now, in your flaaffy bms do a search for the first instance of <code>a4 20</code> in the bms, and delete everything before that. It should be around 2 lines in. Now, cut and paste whats left of the flaaffy bms to the end of last.bms.
 
 
 
 
 
== Staying Organized: ==
 
You will surely want a text file with notes to keep yourself orgranized, because things can get messy coming up. Look at figure 1 to see how I format mine. From now on a track of the flaaffy bms will be reffered to as a "note track" and the actual tracks of the bms are just "tracks". You'll want to write down the offset of every instrument youre using, the offset of every note track, and what track uses what note track and instrument. Using this will make the "track setting" step far easier.
 
 
 
 
 
== Setting Loops: ==
 
 
 
Now that you have the base of your interactive bms, its time to set the looping for every track. First, go to <code>0x04 90</code>. You should see <code>A4 20</code>. Remember the offset this <code>a4 20</code> is at. Now search for the next <code>a420</code> in the bms. Now you're at the start of the next note track. Before anything else, add padding 00s to move the a420 you just found to the start of a new line. It will simplify steps in the future. Look back a bit and you will see the last track's looping jump branch. In a standard flaaffy bms, it will be an offset to the start of the note track followed by a "E7". Replace this E7 with FF and change the offset right before it to the start of the previous <code>a4 20</code> plus 0x6. For example. If a track has a <code>a4 20</code> starting at <code>0x0d 90</code>, the loop offset at the end should look like this, <code>C8 00 00 0d 96</code>. Continue to do this for every note track, search for <code>a4 20</code>, move it to the start of next line, change the loop offset to point to the <code>a4 20</code> +6, change the E7 to FF. do this until you get to the final track. Make sure as you do this, take notes of the offset of every <code>a4 20</code>. The final line has to be 32 byte aligned, so add 00 padding if needed. You will see a A4 20
 
 
 
 
 
== Setting Instruments: ==
 
Go to the top part of your bms. Specifically, jump to offset <code>0x 03 2b</code>. You will see a C4, followed by 00 00 01 8E. This part shouldn't be touched, but the part after it is important. There should be a <code>A4 20 XX A4 21 XX</code>. The byte following a4 20 is the bank this instrument will use. The a4 21 is the program. Make sure you know what bank and programs can be used within the bms you are replacing. Also keep in mind these are hex values, so program 14 would be entered as <code>A4 21 0e</code>, not <code>A4 21 14</code>. Continue to look around for these a4 21s, and take notes on the program number and the offset to the <code>C4</code> in the <code>C4 00 00 01 8E</code> before it. The instrument offset at <code>0x 04 53</code> specifically is strange because it sets a program twice, only the second one matters though.
 
 
 
== Setting Tracks: ==
 
Now that you have the loops for all the note tracks set up, and all the instrument setting in place, its time to actually assign the note track offsets and instrument offsets for each track.
 
 
 
 
 
== Final Touches: ==
 

Latest revision as of 16:44, 18 August 2019

A .bms file holds data for sequenced music in Pikmin 2. BMS files are similar to MIDI files, but have many more advanced features. Custom BMS files can be made with Flaaffy by Arookas (which can be found here), however Yoshi2's fork of Flaaffy is better suited to making BMS files for Pikmin 2. You can find that here.

Documentation[edit]

To do: Actually document every byte of a bms header and music data and what it all means.

List of BMS files[edit]

A full list of all the BMS files in Pikmin 2 can be found here.

Interactive music[edit]

A lot of BMS music in Pikmin 2 is interactive, meaning that parts of it change depending on what you do in the game. BMS files produced by Flaaffy do not support this by default, however they can be modified to be interactive. A tutorial to do this can be found here. This currently only applies to overworld music and will not work for caves.