Help:Sound modding: Difference between revisions

added a link to the foorbar2000 FAQ
imported>Kiddles
(Added notes for Switch modders, as much of this guide was made for Wii U/CEMU modders. - Kiddles)
(added a link to the foorbar2000 FAQ)
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
To see what can be done in music modding and have a reference point, there are examples such as [https://gamebanana.com/gamefiles/10178 Lylah's Complete Music Overhaul] which has modded over 210 music files in the game that function just how the base game's files do, employing the methods found here.
To see what can be done in music modding and have a reference point, there are examples such as [https://gamebanana.com/gamefiles/10178 Lylah's Complete Music Overhaul] which has modded over 210 music files in the game that function just how the base game's files do, employing the methods found here.


== The 4 main sound files ==
==The 4 main sound files==
There are 4 types of files you mostly need to concern yourself with in music modding:
There are 4 types of files you mostly need to concern yourself with in music modding:


* '''BFSTM''' (.bfstm) "Binary Cafe Stream" files
*'''BFSTM''' (.bfstm) "Binary Cafe Stream" files
* '''BFSTP''' (.bfstp) "Binary Cafe Stream Prefetch" files
*'''BFSTP''' (.bfstp) "Binary Cafe Stream Prefetch" files
* '''BFWAV''' (.bfwav) "Binary Cafe Wave" files
*'''BFWAV''' (.bfwav) "Binary Cafe Wave" files
* '''Bars''' (.bars) files
*'''Bars''' (.bars) files


BFSTMs are the main music files in this game, which you can find under content/Sound/Resource/Stream in the unpacked base game folder and DLC music in the Update Data folder. When making a mod, always treat it as an 'update' so anything you make goes in one 'content' file structure.
BFSTMs are the main music files in this game, which you can find under content/Sound/Resource/Stream in the unpacked base game folder and DLC music in the Update Data folder. When making a mod, always treat it as an 'update' so anything you make goes in one 'content' file structure.
Line 26: Line 26:
This guide will go through how to replace the Temple of Time music as an example, and then the Guardian BGM later as it needs more steps. To mod only the former, only the 1st and 2nd resources listed below are required, but it is recommended to obtain everything in the list to make modding simpler in the future.
This guide will go through how to replace the Temple of Time music as an example, and then the Guardian BGM later as it needs more steps. To mod only the former, only the 1st and 2nd resources listed below are required, but it is recommended to obtain everything in the list to make modding simpler in the future.


== Prerequisites ==
==Prerequisites==


# A music editing software of your choice, e.g: Wavepad Sound Editor or Audacity
#A music editing software of your choice, e.g: Wavepad Sound Editor or Audacity
# [https://github.com/libertyernie/LoopingAudioConverter/releases Looping Audio Converter]
#[https://github.com/libertyernie/LoopingAudioConverter/releases Looping Audio Converter]
# [https://github.com/NanobotZ/bfstp-fixer bfstp fixer]
#[https://github.com/NanobotZ/bfstp-fixer bfstp fixer]
# [https://github.com/aboood40091/BCFSTM-BCFWAV-Converter BCFSTM-BCFWAV Converter]
#[https://github.com/aboood40091/BCFSTM-BCFWAV-Converter BCFSTM-BCFWAV Converter]
# Python 3.7
#Python 3.7
# [https://github.com/NanobotZ/BarsTool/releases Bars Tool]
#[https://github.com/NanobotZ/BarsTool/releases Bars Tool]
# VLC Media player for previewing BFSTM files (not necessary but highly recommended)
#VLC Media player for previewing BFSTM files (not necessary but highly recommended)
# [https://github.com/ziggyhacks/MK8-Voice-Tools NW4F Wave converter] for converting Wav files to BFWAV
#NW4F Wave converter for converting Wav files to BFWAV
# [https://www.foobar2000.org/ Foobar2000 Media Player] and [https://www.foobar2000.org/components/view/foo_input_vgmstream vgmStream plugin] for previewing/converting BFWAV files
#[https://www.foobar2000.org/ Foobar2000 Media Player] and [https://github.com/vgmstream/vgmstream vgmStream plugin] for previewing/converting BFWAV and BFSTM files. Foobar2000's [https://www.foobar2000.org/FAQ FAQ] page has instructions for installing the plugin.


== Creating a new sound ==
==Creating a new sound==
Using the Temple of Time as an example, the fundamentals of this guide apply to any future tracks you make in terms of looping.
Using the Temple of Time as an example, the fundamentals of this guide apply to any future tracks you make in terms of looping.


First, preview the actual original game file you're replacing so that you are aware of how long it is and what constraints you should roughly keep your new file in (there's nothing wrong with making a loop a minute or so longer than normal for BGM_Spots, but it is not recommended for other tracks as it may function abnormaly).
First, preview the actual original game file you're replacing so that you are aware of how long it is and what constraints you should roughly keep your new file in (there's nothing wrong with making a loop a minute or so longer than normal for BGM_Spots, but it is not recommended for other tracks as it may function abnormaly).


=== Creating a loop ===
===Creating a loop===
Assuming you have a file or sample you want to use, open it up in a sound editor or software of your choice. This guide uses Wavepad, as it is perfect for this type of editing.  
Assuming you have a file or sample you want to use, open it up in a sound editor or software of your choice. This guide uses Wavepad, as it is perfect for this type of editing.  
[[File:Wavepad_Demo_1.png|thumb|A file open in Wavepad, the sample rate is 41000Hz, which must be converted to 32000Hz before edits are made.]]
[[File:Wavepad_Demo_1.png|thumb|A file open in Wavepad, the sample rate is 41000Hz, which must be converted to 32000Hz before edits are made.]]


==== Editing the sound ====
====Editing the sound====
Make the edits as you wish to your file, such as volume adjustment (ideally near the original file's), reverb, fades, equalising, mixing, etc. If the file is very 'droney' (like a choir) with little percussion or fades out, you can do an easy trick as shown below.
Make the edits as you wish to your file, such as volume adjustment (ideally near the original file's), reverb, fades, equalising, mixing, etc. If the file is very 'droney' (like a choir) with little percussion or fades out, you can do an easy trick as shown below.
[[File:Wavepad_Demo_2,_Selecting_Intro.png|thumb|A zoomed in image of the selection process in Wavepad to create a seamless loop from the outro back into the main song.]]
[[File:Wavepad_Demo_2,_Selecting_Intro.png|thumb|A zoomed in image of the selection process in Wavepad to create a seamless loop from the outro back into the main song.]]
Line 57: Line 57:
Save your file as a .wav and then open it up in '''Looping Audio Converter'''.
Save your file as a .wav and then open it up in '''Looping Audio Converter'''.


==== Entering loop data ====
====Entering loop data====
When opening Looping Audio Converter, the setup should remain relatively untouched apart from 3 areas:
When opening Looping Audio Converter, the setup should remain relatively untouched apart from 3 areas:


* Save directory (can be anywhere you want that's the easiest to access)
*Save directory (can be anywhere you want that's the easiest to access)
* Output Format (should be BFSTM)
*Output Format (should be BFSTM)
* Loop Information option (should be set to 'Ask for all files')
*Loop Information option (should be set to 'Ask for all files')


[[File:File_open_in_Looping_Audio_Converter.png|thumb|The parameters highlighted should be the only ones changed to what is seen. The directory can be set to the quickest place to grab the outputted file from (e.g: Desktop)]]
[[File:File_open_in_Looping_Audio_Converter.png|thumb|The parameters highlighted should be the only ones changed to what is seen. The directory can be set to the quickest place to grab the outputted file from (e.g: Desktop)]]
Click 'Start' and then a prompt should appear allowing you to enter your loop data in samples, which will be simple since you made a note of the points earlier. Ensure the 'Enable' and 'Loop' boxes are checked, and click 'Okay'. This should output your wav as a BFSTM with the loop data written onto it. Rename your new track to the original name of the track you wanted to replace. It is now ready to be used in your mod. BFSTMs are stored under content/Sound/Resource/Stream.
Click 'Start' and then a prompt should appear allowing you to enter your loop data in samples, which will be simple since you made a note of the points earlier. Ensure the 'Enable' and 'Loop' boxes are checked, and click 'Okay'. This should output your wav as a BFSTM with the loop data written onto it. Rename your new track to the original name of the track you wanted to replace. It is now ready to be used in your mod. BFSTMs are stored under content/Sound/Resource/Stream.


==== Tracks that require a prefetch (.bfstp) ====
====Tracks that require a prefetch (.bfstp)====
Some tracks need to be loaded in by a one-second prefetch that contains compressed data of the BFSTM, and you can find these by analysing the list of .bars file to see if your track has one. All sound effects and battle themes have a bfstp stored inside a respective .bars file, e.g: ''GuardianBGM.bars'' contains the prefetches for the main Guardian theme and outro. Assuming you followed the same looping steps as mentioned above, you should have a Guardian_Main theme that loops, and a Guardian_Outro that does not loop (select 'Keep as non-looping' in Looping Audio Converter). Once the new BFSTMs have been made, you should follow the [https://gamebanana.com/tuts/12856 bfstp fixer] method, where you place bfstpfixer.py, BCFSTM-BCFWAV-Converter, your BFSTMs, and a .bat file with the following code:
Some tracks need to be loaded in by a one-second prefetch that contains compressed data of the BFSTM, and you can find these by analysing the list of .bars file to see if your track has one. All sound effects and battle themes have a bfstp stored inside a respective .bars file, e.g: ''GuardianBGM.bars'' contains the prefetches for the main Guardian theme and outro. Assuming you followed the same looping steps as mentioned above, you should have a Guardian_Main theme that loops, and a Guardian_Outro that does not loop (select 'Keep as non-looping' in Looping Audio Converter). Once the new BFSTMs have been made, you should follow the [https://gamebanana.com/tuts/12856 bfstp fixer] method, where you place bfstpfixer.py, BCFSTM-BCFWAV-Converter, your BFSTMs, and a .bat file with the following code:


Line 75: Line 75:


'''For Switch'''<br>
'''For Switch'''<br>
*'''Important:''' ''The first line is used to also convert your current BFSTM(s) to use a little endian, since Looping Audio Converter converts using a big endian. Be sure to copy the new BFSTMs into your working folder after they've been converted, otherwise your audio won't play ingame.''<br>
*'''Important:''' ''The first line is used to also convert your current BFSTM(s) to use a little endian, since Looping Audio Converter converts using a big endian. Be sure to copy the new BFSTMs into your working folder after they've been converted, otherwise your audio won't play ingame.''<br>
<nowiki>for /r %%i in (*.bfstm) do python main.py -format FSTM -bom 1 "%%i"</nowiki><br>
<nowiki>for /r %%i in (*.bfstm) do python main.py -format FSTM -bom 1 "%%i"</nowiki><br>
<nowiki>for /r %%i in (*.bfstm) do python main.py -format FSTP -bom 1 "%%i"</nowiki><br>
<nowiki>for /r %%i in (*.bfstm) do python main.py -format FSTP -bom 1 "%%i"</nowiki><br>
Line 86: Line 88:
A backup .bars file will be generated once you do so that contains the bars data before you made any edits, and the original file is now updated with your new data. Place the modified bars file into content/Sound/Resource of your mod folder, and your BFSTMs in content/Sound/Resource/Stream, and you should now have a working music mod without any glitches or abnormalities.
A backup .bars file will be generated once you do so that contains the bars data before you made any edits, and the original file is now updated with your new data. Place the modified bars file into content/Sound/Resource of your mod folder, and your BFSTMs in content/Sound/Resource/Stream, and you should now have a working music mod without any glitches or abnormalities.


==== Sound effects (SFX) and BFWAVs ====
====Sound effects (SFX) and BFWAVs====
Almost every sound effect in the game is in .bfwav format, and are also stored in .bars files. Any replacement BFWAV you make has to be the shorter than or the exact same length as the original file you are modding, which you can check by opening it in Foobar2000. Assuming you have made your new sound effect in .wav format comply with this, you can simply drag it over the NW4FWaveConverter.exe and it should output a new bfwav of your file. Then, using the Bars tool as previously mentioned, replace the old bfwav with your new one and implement the new .bars file into your mod.
Almost every sound effect in the game is in .bfwav format, and are also stored in .bars files. Any replacement BFWAV you make has to be the shorter than or the exact same length as the original file you are modding, which you can check by opening it in Foobar2000. Assuming you have made your new sound effect in .wav format comply with this, you can simply drag it over the NW4FWaveConverter.exe and it should output a new bfwav of your file. Then, using the Bars tool as previously mentioned, replace the old bfwav with your new one and implement the new .bars file into your mod.


[[Category:Guides]]
[[Category:Guides]]
15

edits