Editing Pikmin 2 custom music

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
''Pikmin 2'' uses a sequenced music format called BMS for some of its music. It is a powerful format containing commands that are executed by an interpreter built into the game that is, among other things, capable of basic maths on a limited number of registers and conditional branching, thus it is more powerful than MIDI. The following article will describe a few details that are important to creating a custom BMS file that actually plays in-game.
+
Pikmin 2 uses a sequenced music format called BMS for some of its music. It is a powerful format containing commands that are executed by a BMS interpreter built into the game that is, among other things, capable of basic maths on a limited number of registers and conditional branching. Thus it is more similar to machine code than MIDI. The following article will describe a few details that are important to creating a custom BMS file that actually plays ingame.
  
= About BMS =
+
The flaaffy toolchain created by arookas is important to creating custom BMS files and can also be used to dump instrument banks (IBNK) and sounds (WSYS) from Pikmin 2 and can be found here: https://github.com/arookas/flaaffy
The BMS files are located inside <code>/AudioRes/Seqs/Seq.arc</code>. <code>Seq.arc</code> is a [[RARC file (Pikmin 2)|RARC]] archive so you need a tool that can unpack and repack those archives.
 
  
The game uses 6 instrument banks in total but banks 4 and 5 (counting starts with 0) are used primarily for music, with the rest being primarily for sound effects. Which instruments can be played depends on the <code>wScene</code> files (wave archives) that are loaded. Use Dolphin's log with file monitoring enabled to figure out which <code>wScene</code> is loaded in a level.
+
-- Background Info--
 +
The BMS files are located inside \AudioRes\Seqs\Seq.arc. Seq.arc is a RARC archive. Information related to sounds/music is stored inside \AudioRes\PSound.aaf.
 +
Pikmin 2 contains 6 instrument banks numbered 0 to 5. You will find 6 occurences of IBNK inside PSound.aaf. It has exactly one occurence of WSYS inside PSound.aaf which references the wave archives stored in \AudioRes\Banks. There are 49 wave archives numbered wScene_0.aw through wScene_48.aw. Only some archives are loaded at a time, so you cannot play any sounds you wish. Turn on file monitoring in Dolphin's log configuration and check what wave banks are used in a specific scene/level.
  
Check [[Pikmin_2_custom_music/available_instruments|here]] for which instruments from which instrument banks can be played if a given <code>wScene</code> file is loaded:
+
Check here for which instruments from which instrument banks can be played if a given wScene file is loaded: [[/available_instruments]]
  
= Convert MIDI to BMS =
+
-- Convert MIDI to BMS --
  
Download [https://github.com/RenolY2/flaaffy/releases/tag/v0.6.1 this flaaffy fork] which has some changes added to help the user with creating a working bms file.
+
Download flaaffy from the github link above (check Releases for a compiled exe).
 +
Making a BMS out of a MIDI is a two step process. mareep.exe is a command line tool so you need to open the command line in the same folder as mareep.exe or create a bat file in the same folder to do the conversion.
  
You can use the provided .bat files using drag&drop or you can use these commands in the command line:
+
Example:
 
<pre>mareep -errand jolt -input your_midi.midi -output your_cotton.txt -loop
 
<pre>mareep -errand jolt -input your_midi.midi -output your_cotton.txt -loop
 
mareep -errand cotton -input your_cotton.txt -output your_bms.bms</pre>
 
mareep -errand cotton -input your_cotton.txt -output your_bms.bms</pre>
 
The work routine is like this: First you convert the midi into cotton. Cotton is flaffy's assembly language that compiles directly into bms. In this form you can make changes to the instrument and bank values to have the music sound better ingame by editing the variables at the top. Once you are done with the editing you can convert the cotton txt file into bms and place it over a music file of your choice in the <code>Seq.arc</code> described above.
 

Please note that all contributions to Pikmin Technical Knowledge Base are considered to be released under the Creative Commons Attribution-ShareAlike (see Pikmin Technical Knowledge Base:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)