How to replace a music file - ratikalXIV/scdTutorials GitHub Wiki

[PREREQUISITES]

BASIC

  • FFXIVQuickLauncher to access the plugins below:
    • Penumbra for in-game modding. See link for installation instructions.
    • Orchestrion Plugin for quickly playing in-game music. Installable via /xlplugins
    • Sound Filter for easily identifying .scd files to be replaced. Installable via /xlplugins
  • A .ogg file of your choice. You can use this from this repository. as an example.
  • FFXIVVoicePackCreator For the OGG to SCD converter.
  • Audacity to figure out how many samples our ogg file has.

ADVANCED

[BASIC]

Preparing the mod

  1. After you have installed everything in the BASIC section, type in "/penumbra" in the chat window and hit enter to open up the Penumbra settings menu.

image 2. Click the "Mods" tab, go to the "+" symbol at the bottom left to create a new mod. Let's name it "chrono". Hit enter to create it.

image 3. Click on our newly created "chrono" mod in the list and then select the "Edit Mod" tab. Within this tab, click the "Open Mod Directory" button. This will open your file explorer at that directory where you should see two files: default_mod.json and meta.json. No need to worry about these for now.

image image 4. Next, right click on an empty space in the folder, go down to "New" then select "Folder". You can name this folder whatever, but for this example, name it "music"

image 5. Double-click on this folder to open it, and keep it open for now. Our next step will be to convert the ogg file to a file that FFXIV can recognize, an scd.

Figuring out the sample size

  1. Before we make the conversion, we need to know how big our .ogg is so we can tell the converter. To do this, we need to open the file up in Audacity.
  2. In Audacity, at the bottom, you should see "Selection Start". Right click on the drop-down menu and select samples.

image

  1. Now, you can hit Ctrl+A to select your entire ogg file, and you should get length down below. Copy this number down.

image

Converting the ogg to SCD

  1. Download and install FFXIVVoicePackCreator. Once you've extracted it, click on FFXIVVoicePackCreator.exe
  2. Go to Tools > Create Standalone SCD

image 3. For "mediaSelection", click Select and browse to the .ogg file. 4. For "outputSelection", click Select and browse to where you want to save the scd. To make this easier, save it to the same folder we created in the step above. Let's call it "song.scd" 5. For File Type, click the dropdown and select "OGG (Used Strictly For Background Music)" 6. Input Loop Start (Samples) at 1 7. Put in the number of samples we got in "Loop End (Samples)" 8. Put in the number of samples we got in "Number of Samples"

image 7. The app should now be converting your .ogg file to an .scd file to your mod directory. If all goes well, you should see "song.scd" in your "Penumbra\chrono\music" folder. 8. Now, we will go back to the game and configure our mod to use this .scd file.

Configuring our mod

  1. First things first, MAKE SURE THE MOD IS ENABLED.

image 2. Now, click on the Advanced Editing tab, a new window will pop up. You should see our "music\song.scd" in orange text.

image 3. We are now going to use both Sound Filter and Orchestrion Plugin to figure out which scd we are going to be replacing.

Essentially what Penumbra is doing is "redirecting" files in FFXIV. When FFXIV plays a song, it looks toward a certain directory in it's code to load that specific scd file. However, when this mod is properly setup, Penumbra will instead redirect FFXIV to play our file instead.

  1. Since this is a battle theme, let's replace some battle music! Open up both Orchestrion (type "/porch" in game) and Sound Filter (type "/soundfilter" in game) and bring them side to side.

image 5. Let's focus on the Endwalker area. Let's replace the battle theme in Thavnair. Search for "Unbowed" and look for the one that states it plays in Thavnair.

image 6. Before we play it, go to the Sound Filter window and check the box Show sound log window. This will bring a Sound log window.

image 7. When you click Enable logging, it will log every .scd being played currently. It would help to be in a more "quiet" place like Amh Araeng or even your house. But, we can also just search through the log as well. Go ahead and click Enable logging. 8. On the Orchestrion plugin, Play "866 - Unbowed". Wait until you actually start hearing it, and then you can unclick Enable logging. In this case, you want to look for music/ex4/bgm_ex4_field_thav_battle.scd/0. This is the scd file we will have be redirected. Copy this down somewhere by clicking the papers looking button next to the path.

image 9. On the Orchestrion plugin, Stop "866 - Unbowed". For later testing purposes, play two random songs to get Unbowed out of the game's memory.

Making the redirection

  1. Back on the Advanced Editing window, paste the path that we got from the previous section into the box that says "Add New Path...". Remove the /0 from the end.

image 2. Hit enter. Afterwards, the "music\song.scd" text should turn green. Hit Apply Changes

  • NOTE: You may need to temporarily rename this file to get it accept the changes first, and then change it back to the original. This bit can be a little finnicky.

image 3. I don't know if this step is necessary but I always do it anyways for good measure. Go back to Penumbra and click "Reload Mod"

image

Testing the change!

  1. Finally, we can see if our hard work will pay off. MAKE SURE THE MOD IS ENABLED. There's two ways we can about doing this.
  2. Making FFXIV play the sound naturally by going into battle in Thavnair
  3. Replaying the same song we did in the steps above in Orchestrion.
  4. You should now hear "Battle 1" by Yasunori Mitsuda!

# [ADVANCED] WIP. But you'll notice the song doesn't loop properly. You can review this guide for understanding how to loop files. https://rpgmaker.net/tutorials/1341/ You can use goooats fork of FFXIVExplorer and use the SCD converter there. But the loop samples are off by about 1.5% on either side so there is a lot of troubleshooting, testing, and bullshit you would have to go through just to make a properly looping file. My mod took me 3 minutes to get the file injected, and then another hour fighting with the converter to get it to loop right.

The converter present in FFXIVVoicePackCreator is just a straight port, so it has the same flaws. It's really a lot of unnecessary trial and error unfortunately.

[TIPS AND TRICKS]