There is already a tutorial on how to mod music in Master Duel by codex28: https://www.nexusmods.com/yugiohmasterduel/videos/17
And there is already an article by RndUser on how to mod: https://www.nexusmods.com/yugiohmasterduel/articles/3
However, the purpose of this article is on how to make the music loop correctly, which is not covered in codex28's tutorial.
Some music has a loopable part in the middle, however, it may have fade-ins and fade-outs at either end, so simply repeating the music over and over (which is how it would be played in-game) won't make the music loop correctly, and it will just play those fades every time.
In this article you will see how to define loop points in a WAV file so that once the game reaches the end point of the loop, it restarts at the start point we defined (instead of beginning/ending at the start/end of the file).
Once you have defined those points, you can use codex28's tutorial to mod the music in as usual, and you're done.
(All the information presented here is taken from this article by AmobiusV and Heidegger)
What you need:
For this, you will need 2 programs:
-Audacity: This will convert our music file to WAV, as well as help us find the loop points. [Download link]
-Wavosaur: This will insert loop points into our WAV file, which Unity games understand and will loop for us. [Download link]
Download and install these two.
Audacity steps:
Drag and drop your music file into Audacity, then go to "File" > "Export Audio..." (or just press Ctrl + Shift + E). Then Choose the location/filename, and make the format WAV, and the encoding Signed 16-bit PCM, then export:

Now you need to find the loop points. Listen to your music and look at its waveform to determine roughly where you want it to loop. Then click and drag on the timeline to select that region (doesn't have to be exact yet).
You can press the loop button in the top strip (or press L) to make the region you selected loop, then click inside the region you selected in the time to have it start playing.
You can hover your mouse over the beginning/end of the region in the waveform, then press and hold Ctrl and use the mouse wheel and scroll up so that you can zoom in at those end points. Personally, I think it's best to zoom it at the closest peak, and zoom as much as you can, then select that peak as your point, and do the same thing for the other point, making sure you choose the corresponding point. Then play the music to make sure it's looping correctly.
For each point, once you have it, you want to go to the bottom panel where it says "Selection", then click on the drop-down menu, and choose "samples".
Each of your points, if you have it selected in the timeline, will have its value for the number of samples displayed (below in the picture is the one for my starting point, for both left and right speakers). Note down the values for both end points, then close Audacity. (For this mod, the sample points were at 862617 and 3281719)

Wavosaur steps:
Open your new WAV file that you exported into Wavosaur by dragging and dropping. Go to "Tools" > "Loop" > "Create Loop Points" (or press L).
Next go to "Tools" > "Loop" > "Properties", enter the values you noted down earlier, click "OK", and you should see the loop region as in Audacity.

You need to do something after saving, so don't rush and close Wavosaur.
Go to "File" > "Save as" and save your file as WAV. Then go to "File" > "Export" > "Export all regions", and overwrite the file you saved.
You are done, and now you can close Wavosaur.

Modding in:
After you've saved and exported your WAV file with the regions, you can proceed with codex28's tutorial to mod that WAV file in.
Enjoy your music mod!
0 comments