User Tools


This is an old revision of the document!


You'll need two tools to replace music in Paper Mario: The Thousand-Year Door.
Winamp and vgmstream are optional but they can help verify that stm files are correct. The stm files should be renamed to .dsp format so that vgmstream can decode them. The stm format derives from .dsp, so there is just only a difference in file-format name.

jackoalan's Audacity-fork (link)
GCRebuilder (link)
Winamp and vgmstream (link and link)

▬▬▬▬▬▬▬▬▬▬▬
The .stm Format
▬▬▬▬▬▬▬▬▬▬▬
References to the stm files are stored in a file named pmario_sound_bgm_txt.db, which is in the root/sound/proj directory. It can be opened using notepad, notepad++, etc. Each stm has an internal name assigned to it, such as BGM_TITLE1. Two lines below that is a path that tells the game where to look for it, an example which is: sound/stream/sys_tit1_32k.

Here is an almost-complete list of default BGM files and what they actually are in-game. A small note, sys_titl_32k appears to share a large portion of it's track with sys_dig1_32k.

▬▬▬▬▬▬▬▬▬▬▬
Obtaining your .stm files
▬▬▬▬▬▬▬▬▬▬▬
Open up an iso of the game using GCRebuilder and just export the stm you want and reimport it once you're done, but the modified stm must be the same as the original stm's size or smaller, as GCRebuilder will not allow you to export a stm bigger than the original. You can also extract the root from the game and build/modify from there instead of directly from the image.

▬▬▬▬▬▬▬▬▬
Sound Editing
▬▬▬▬▬▬▬▬▬
Open up jackoalan's version of Audacity, and open whatever music you want. This part is pretty simple, as the stm encoding will take care of the rest. If the music selected is too particularly quiet, you may amplify it as well. You can skip the looping step below if you're replacing music that doesn't loop, such as game over music.

▬▬▬▬▬▬▬▬▬
Setting a Loop
▬▬▬▬▬▬▬▬▬
Go to Tracks>Add New>Label Track. Then select a part of the label near the beginning, and then Tracks>Add Label At Selection. Click either end of the new label loop to begin to stretch it.
(it's a bit small, so you may have to be precise)

For the textbox inside of the label, type in just “LOOP” in all caps and without the quotation marks. To make the loop label editing easier, you may use Tracks>Edit Labels to have the loop start and/or end at correct positions. Don't worry if the track-end point for the loop label ends up going over the loop-end when you export it to test with vgmstream, though you want to make sure it doesn't, just to be safe.

▬▬▬▬▬▬▬▬▬
Saving
▬▬▬▬▬▬▬▬▬
When you're satisfied with your custom music, go to File>Export Audio. Select Nintendo Gamecube DSPADPCM (.stm) as the file type and name it the same as the default stm that you're replacing. Keep mind the stm must have the same filename or it will not work.

Take a handful of precautions to ensure your stm files loop properly without causing the game to lockup. Always use a fresh copy of default stms and delete the default stm, always use same or smaller size stms as replacements and then copy-paste the modified one instead of saving over the original.

▬▬▬▬▬▬▬▬▬
Rebuilding the ISO
▬▬▬▬▬▬▬▬▬
Save over the default stm with your modified one in the ripped root directory, specifically root/sound/stream. In GCRebuilder, open up the ripped root directory with Root, and then save it as an iso somewhere, such as in your roms folder for Dolphin.

Finally, select Rebuild and let it finish rebuilding. Once it gives you the success popup, congrats! Feel free to test your custom iso to make sure you did it correctly and if it plays and/or loops just fine.