Pikmin 2 custom music

From Pikmin Technical Knowledge Base
Revision as of 14:05, 24 August 2017 by Yoshi2 (talk | contribs) (Created page with "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...")
(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 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.

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

-- 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.

~~To be done: Write down which levels use which wave archives and which instruments can be used to play sounds in which levels~~

-- Convert MIDI to BMS --

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.

Example:

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