Pikmin 2 custom music

From Pikmin Technical Knowledge Base
Revision as of 20:00, 28 June 2018 by Yoshi2 (talk | contribs) (Better formatting)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

About BMS

The BMS files are located inside /AudioRes/Seqs/Seq.arc. Seq.arc is a 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 wScene files (wave archives) that are loaded. Use Dolphin's log with file monitoring enabled to figure out which wScene is loaded in a level.

Check here for which instruments from which instrument banks can be played if a given wScene file is loaded:

Convert MIDI to BMS

Download this flaaffy fork which has some changes added to help the user with creating a working bms file.

You can use the provided .bat files using drag&drop or you can use these commands in the command line:

mareep -errand jolt -input your_midi.midi -output your_cotton.txt -loop
mareep -errand cotton -input your_cotton.txt -output your_bms.bms

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 Seq.arc described above.