Author Topic: EoSD MIDI Mod  (Read 5940 times)


« on: March 22, 2018, 07:32:39 AM »

This is a simple mod to use Romantique Tp's excellent recordings of the game's original MIDI soundtrack as a replacement for the game's standard background music. It adjusts the games defined looping offsets and optionally the sound effect volume. This mod does nothing else and should not interfere with any other mods you've installed, given that those mods to not touch the games MD.DAT, or optionally IN.DAT. Tested and fully working with vpatch and the English Patch. See below for information on the Retexture patch, but please don't use it!


Using this mod will require you to have Romantique Tp's recordings already downloaded, as I will not be providing them. Specifically, you need the 16-bit lossless FLAC version of the recordings. The 24-bit recordings will not work nor will the transcoded ones. You can find the recordings in Romantique Tp's thread here.

You will need to decompress the tracks back into PCM WAV files once you download them. You can do this with a converter of your choice. If you don't already have one in mind, I'd suggest using the official FLAC command line tools for Windows. You can download the binaries here. Be sure to select the appropriate file which should be named

In the zip there will be binaries for both 32 and 64-bit systems. Choose the one appropriate for your system. If you're unsure, choose the 32-bit version. Place the flac.exe in the directory with Romantique Tp's EoSD recordings. In the folder containing the recordings and the flac.exe, hold shift and right click in the whitespace. Select Open command window here from the menu. In the Command Prompt
window type or paste: for %F in (*.flac) do flac -d "%F" then press enter. FLAC will quickly decode all the files in the directory to WAV files.

You should now take the time to backup the original game music. The game music is stored in the game's bgm directory ~/kouma/bgm. I've moved my original music into a new folder titled original ~/kouma/bgm/original. This makes it easy to uninstall or revert in the future. Once you've moved or backed up the original tracks however you want, you should copy the 17 WAVs you decompressed earlier into the game's bgm folder. If you used flac they should already be named correctly. You can now delete Romantique Tp's recordings if you do not want them for separate listening.

Now all you need to do is copy my MD.DAT into your game folder and rename it to 紅魔郷MD.DAT. Make sure you've kept a copy of the original. To keep things simple I renamed my original game MD from 紅魔郷MD.DAT to 紅魔郷MD.DAT.original

Optional Steps

This step is optional, but recommended. If you use the MIDI recordings when playing the game, you may notice that the sound effects are really loud! I've included an additional file, IN.DAT, in which I've modified the game's sound effect volume back to the original balance for use with the new music. You may want the extremely loud sound effects in certain circumstances; for example, should you be scoring.

To install the IN.DAT follow the same steps as you did above for MD.DAT. Backup the original or simply rename it from 紅魔郷IN.DAT to 紅魔郷IN.DAT.original and copy the modified one into the game directory with the appropriate name.

If you are using the English patch, you will need to repatch the game for use with the modified IN.DAT. If you only intend to use the MD.DAT you do not need to repatch the game. The patcher should read "unknown version" for both MD.DAT and IN.DAT and that it has not been tested with your version of IN.DAT. Choose yes, try to patch anyway when prompted and it should complete without error.


To uninstall the mod, simply return the original background music to its home, delete the patched MD.DAT (and IN.DAT if you're using that) and rename the backups back to their original filenames. You will again need to repatch the game with the English patch if you're using that with the modified IN.DAT.


If you choose to use the included IN.DAT to adjust the sound effect balance, you will encounter a collision with the Retexture patch. If you want to use the Retexture patch with my IN.DAT you will need to merge the two modifications. This can be quickly done using a tool of your choice to decompress the games data files. I'd suggest using the excellent Touhou Toolkit.


Huge thanks to Romantique Tp for providing us with the recordings on his hardware. Without him, none of this would have been possible. I'd also like to give a shout-out to kana0603 who reminded me that this was something people expected to be able to do with the recordings but could not without adjusted looping offsets.

Tools Used: WaveLab, Hex Editor, Programmer's Calculator, Touhou Toolkit


Google Drive  |  Mega


« Reply #1 on: March 22, 2018, 07:40:02 AM »
« Last Edit: March 22, 2018, 08:37:34 AM by SWZ »