Importing Custom Music: Difference between revisions

From Zenith
Jump to navigation Jump to search
Content added Content deleted
m (Fixed audio format casing)
m (Add internal wave version and other minor changes)
Line 3: Line 3:
==Prerequisites==
==Prerequisites==


*[[Citric Composer]] installed
*[[Citric Composer]]
*[https://www.audacityteam.org/download/ Audacity] installed
*[https://www.audacityteam.org/download/ Audacity]


==Preparing our audio file==
==Preparing our audio file==
Line 15: Line 15:
[[File:normalizeeffect.png|510x510px]]
[[File:normalizeeffect.png|510x510px]]


In the window that opens, you can leave the settings as default and press '''OK'''.
If a window opens, you can leave the settings as default and press '''OK'''.
==Getting loop points==
==Getting loop points==
In this section we will be finding the loop points so that our music will be able to repeat while playing. (You can skip this section if the track you are importing doesn't require a loop)
In this section we will be finding the loop points so that our music will be able to repeat while playing. (You can skip this section if the track you are importing doesn't require a loop)


First, set the playback rate to measure in samples. This will be helpful later.
First, set the playback rate to measure in samples.


[[File:Audacity Y2vnQWH9HP.png]]
[[File:Audacity Y2vnQWH9HP.png]]


Now we are going to find two similar groups that we can use in our audio file.
Now we are going to find two similar groups of audio that we can use.


[[File:Audacity_ribmeJnQ6d.png|774x774px]]
[[File:Audacity_ribmeJnQ6d.png|774x774px]]
Line 31: Line 31:
[[File:Audacity_XncifpnsBP.png]]
[[File:Audacity_XncifpnsBP.png]]


Now you can drag on the timeline to create loop points.
Now drag on the timeline to create loop points.


When you find your loop points, you can press play to preview them. To get a perfect loop you should not be able to tell that the song looped, and it should sound as if the song just continued playing.
When you find your loop points, you can press play to preview them. To get a perfect loop you should not be able to tell that the song looped, and it should sound as if the song just continued playing.


Now, we are going to select our looping area in our audio.
Now, select the looping area in your audio.


To prevent clicks in the audio after selecting the looping area, be sure to select at zero crossings with '''Select''' -> '''At Zero Crossings''' or by pressing '''Z'''.
To prevent clicks in the audio after selecting the looping area, be sure to select at zero crossings with '''Select''' -> '''At Zero Crossings''' or by pressing '''Z'''.


After you have done that, keep note of the selection sample size. We will be needing this later when we import our audio.
After you have done that, keep note of the selection sample size. We will need this later when we import our audio into Citric.


[[File:audacity loop points.png|773x773px]]
[[File:audacity loop points.png|773x773px]]


== Exporting our file ==
== Exporting our file ==
You will need to export as a WAV file.
Export as a WAV file.


[[File:exportwav.png]]
[[File:exportwav.png]]


== Importing into Citric ==
== Importing into Citric ==
First we will open our game's bfsar. This file is located in [[Filesystem/content/CAFE/sound/cafe redpro stream|/content/CAFE/sound/cafe_redpro_sound.bfsar]] and holds all audio used in the game. You can open it with '''File''' -> '''Open'''
First, open the game's bfsar. This file is located in [[Filesystem/content/CAFE/sound/cafe redpro stream|/content/CAFE/sound/cafe_redpro_sound.bfsar]] and holds all audio used in the game. You can open it with '''File''' -> '''Open'''.


[[File:openbfsar.png|770x770px]]
[[File:openbfsar.png|770x770px]]
Line 55: Line 55:
=== Important notes before starting ===
=== Important notes before starting ===


* Citric Composer is very buggy software as it has been abandoned by it's developer. There will be frequent crashes.
* Citric Composer is very buggy software as it is unmaintained software. There will be frequent crashes.
* Your entire BFSAR cannot go above 243205816 bytes, the original file size. Since the game loads this entire file into memory, it allocates a specific size for it. The file can always go below it, but if it goes above it will cause issues. If you need to free up space, replace the Yoshi and Baby Yoshi tracks that correspond with whatever track is being replaced or any unused tracks with this [https://static.miraheze.org/zenithwiki/9/9c/Empty.wav empty wav] (courtesy of Baron).
* The entire BFSAR cannot go above 243205816 bytes, the original file size. Since the game loads this entire file into memory, it allocates a specific size for it. The file can always go below it, but if it goes above it will cause issues. If you need to free up space, replace the Yoshi and Baby Yoshi tracks that correspond with whatever track is being replaced or any unused tracks with this [https://static.miraheze.org/zenithwiki/9/9c/Empty.wav empty wav] (courtesy of Baron).




In this tutorial we are going to be replacing the desert music.


In this tutorial we are going to be replacing the desert music.


All music tracks are found inside Wave Archives. You can open the dropdown menu to reveal them.
All music tracks are found inside Wave Archives. You can open the dropdown menu to reveal them.


The desert theme is '''WARC_13_GUESS_GROUP_BGM_SABAKU''', so we will be opening that Wave Archive. You can do this by double clicking on it.
The desert theme is '''WARC_13_GUESS_GROUP_BGM_SABAKU''', so we will be opening that Wave Archive. You can do this by double clicking on it.




Once you are in the war browser, we suggest you do not use the sound player on the side. It can cause a likely crash.
Once you are in the war browser, we suggest you do not use the sound player on the side. It can cause a likely crash.
Line 75: Line 71:
[[File:warbrowser.png|767x767px]]
[[File:warbrowser.png|767x767px]]


Double click the first wave in the list. This will usually hold the base track of the music we are trying to replace.
Double click the first wave in the list. This will usually hold the base track of the music we are trying to replace.


Now you can import your wav file that we exported from Audacity in the last section with '''Edit''' -> '''Import file''' or the shortcut '''Ctrl+Shift+I'''.
Now you can import your wav file that we exported from Audacity in the last section with '''Edit''' -> '''Import file'''.


[[File:importfile.png|768x768px]]
[[File:importfile.png|768x768px]]
Line 95: Line 91:
You can see what the loop will sound like by checking '''Loop Playback''' on the right side of the window and then playing the audio, skipping to a spot in the track before the red bar. If the track loops without noticeable issues, you're now ready to save! Press '''Ctrl+S''' or '''File''' -> '''Save''' to save the file.
You can see what the loop will sound like by checking '''Loop Playback''' on the right side of the window and then playing the audio, skipping to a spot in the track before the red bar. If the track loops without noticeable issues, you're now ready to save! Press '''Ctrl+S''' or '''File''' -> '''Save''' to save the file.


If there is an issue, then it is likely due to the loop points shifting too much after selecting Eliminate Loop Static. If this happens, go back to Audacity and find a slightly different looping area, then try again with the new loop info.
If there is an issue, then it is likely due to the loop points shifting too much after selecting Eliminate Loop Static. If this happens, go back to Audacity and find a slightly different looping area, then try again with the new loop info.

Once you have saved, go back to the War Browser.

Set the internal wave version to 1 1 0, then click '''Force Internal Wave Version'''.


[[File:war version.png]]
Once you have saved, make sure to go back into the war browser, save, then save the file in Citric.


Now save the file in War Browser, and save it in Citric Composer.


You are now done! You can now preview the file in-game.
You are now done! You can now preview the file in-game.

Revision as of 18:33, 21 December 2022

This guide will teach you everything you may need for importing custom music for your mod.

Prerequisites

Preparing our audio file

First, open your audio file in Audacity. It is preferred to use a FLAC, MP3, or WAV file.

Set the Project rate to 32000 Hz (This can be found in the bottom left corner of the window)

Now we are going to apply the normalize effect. This will make the audio as loud as possible (To match the game's audio) without causing distortions to the music.

If a window opens, you can leave the settings as default and press OK.

Getting loop points

In this section we will be finding the loop points so that our music will be able to repeat while playing. (You can skip this section if the track you are importing doesn't require a loop)

First, set the playback rate to measure in samples.

Now we are going to find two similar groups of audio that we can use.

To create a loop, right click the timeline and select "Loop On/Off". When you do this you'll note the looping region in the timeline.

Now drag on the timeline to create loop points.

When you find your loop points, you can press play to preview them. To get a perfect loop you should not be able to tell that the song looped, and it should sound as if the song just continued playing.

Now, select the looping area in your audio.

To prevent clicks in the audio after selecting the looping area, be sure to select at zero crossings with Select -> At Zero Crossings or by pressing Z.

After you have done that, keep note of the selection sample size. We will need this later when we import our audio into Citric.

Exporting our file

Export as a WAV file.

Importing into Citric

First, open the game's bfsar. This file is located in /content/CAFE/sound/cafe_redpro_sound.bfsar and holds all audio used in the game. You can open it with File -> Open.

Important notes before starting

  • Citric Composer is very buggy software as it is unmaintained software. There will be frequent crashes.
  • The entire BFSAR cannot go above 243205816 bytes, the original file size. Since the game loads this entire file into memory, it allocates a specific size for it. The file can always go below it, but if it goes above it will cause issues. If you need to free up space, replace the Yoshi and Baby Yoshi tracks that correspond with whatever track is being replaced or any unused tracks with this empty wav (courtesy of Baron).


In this tutorial we are going to be replacing the desert music.

All music tracks are found inside Wave Archives. You can open the dropdown menu to reveal them.

The desert theme is WARC_13_GUESS_GROUP_BGM_SABAKU, so we will be opening that Wave Archive. You can do this by double clicking on it.

Once you are in the war browser, we suggest you do not use the sound player on the side. It can cause a likely crash.

You can click to expand the waves inside the archive.

Double click the first wave in the list. This will usually hold the base track of the music we are trying to replace.

Now you can import your wav file that we exported from Audacity in the last section with Edit -> Import file.

Once you have imported your file, select Project Info.

First, make sure the checkbox for Loop is checked, as this will allow the track to loop in-game. Also be sure that the three numbers for Version near the bottom of the left side of the window are 1 1 0 (in this order from left to right).

Now you can enter the loop info you found before. Once you have entered it you can hit Update Project Info then you can listen to it to make sure it sounds good.

You may need to expand the Citric window if you cannot see the Update Project Info button.

After clicking on Update Project Info, also be sure to select Eliminate Loop Static and then Update Project Info once again. This will slightly change the loop points so that they function correctly in-game without the loop resulting in loud, distorted audio.

You can see what the loop will sound like by checking Loop Playback on the right side of the window and then playing the audio, skipping to a spot in the track before the red bar. If the track loops without noticeable issues, you're now ready to save! Press Ctrl+S or File -> Save to save the file.

If there is an issue, then it is likely due to the loop points shifting too much after selecting Eliminate Loop Static. If this happens, go back to Audacity and find a slightly different looping area, then try again with the new loop info.

Once you have saved, go back to the War Browser.

Set the internal wave version to 1 1 0, then click Force Internal Wave Version.

Now save the file in War Browser, and save it in Citric Composer.

You are now done! You can now preview the file in-game.