Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

P4G Music Manager - A Modding Tool for Persona 4 Golden (PC)

Updates

Post Overhaul by Rudiger 5mo
  • Overhaul Rudiger remade the post and added full step-by-step guide. Bless the tea drinker :pray:
BGME: Aemulus Update Files 5mo BugFix Amendment BGME: Aemulus Temp Update 8mo Adjustment2 Release 1.0.0 8mo Feature2 Addition2 Overhaul Optimization Tweak4 BugFix2 Removal Amendment2 Beta 0.5.3 9mo Feature Addition BugFix2

Custom music management made easy!



1. Introduction

P4G Music Manager is a simple tool for replacing Persona 4 Golden's music tracks with custom additions.

This application simplifies the conversion process, setting of loop points, preset management and more!



2. Features

  • Simplified music replacement for multiple tracks at a time
  • Direct output to the appropriate mods directory
  • Automatic loading and saving of your custom loop points, in-app
  • Easy creation and loading of "Song Packs" for sharing with the community
  • One-click extraction of music from the game (BGM.xwb)
  • Simple playback and comparison of music tracks
  • Enabling/disabling of custom tracks for easy testing



3. Installation

3.1. Disclaimer

The installation steps described here assume you have used mods with Persona 4 Golden before and have a working installation of Reloaded-II with p4gpc.modloader

If you have not used mods before and do not have these tools installed, please read MadMax1960's "Beginner's Guide to Modding Persona 4 Golden" before you try using P4G Music Manager.

3.2. Pre-requisites

Whether you have any of these pre-requisites installed already or not, please reinstall them/run a repair to be certain they are working correctly. This fixes a lot of issues.

3.3. Recommended

  • An application for playing audio files (foobar2000 with the vgmstream library recommended if you want to be able to play .raw/.raw.txth)

3.4. Setup

  1. Before we begin, verify the integrity of your game files in Steam.

    Right-click on the game in your library -> Properties -> Local Files tab -> "Verify integrity of game files...". It's amazing how many potential issues this prevents.

  2. Install  .NET 3.1 Desktop Runtime - Windows x64 Installer (windowsdesktop-runtime-3.1.xx-win-x64.exe) AND .NET 3.1 Desktop Runtime - Windows x86 Installer (windowsdesktop-runtime-3.1.xx-win-x86.exe).

  3. Install Microsoft Visual C++ 2010 Redistributable Package (x86) (vcredist_x86.exe). If you have it installed already, run a quick repair on it anyway just to be sure.

  4. Install 7-zip.

  5. With 7-zip, extract the contents of p4g_music_manager_100.7z to a folder of your choice.

    For this tutorial, I will create a folder named P4G Music Manager in my Documents directory (e.g. C:\Users\rudiger\Documents\P4G Modding).

    I recommend that you do not create your P4G Music Manager folder in a directory that requires administrator-level permissions like C:\Program Files.

    When extracted correctly, your new folder should like this:



  6. With 7-zip, extract the contents of p4gmm_update_files.7z to P4G Music Manager\settings, overwriting the existing files of the same name when prompted:



  7. Within P4G Music Manager\tools, create a new folder named xacttool_0.1.
    The folder must be named exactly this, so please double-check the spelling before moving on to the next step.

  8. With 7-zip, extract the contents of xacttool_0.1.7z to the P4G Music Manager\tools\xacttool_0.1 folder you created. When extracted correctly, it should look like this:



  9. Browse to the SND folder in your Persona 4 Golden installation directory (e.g. C:\Program Files (x86)\Steam\steamapps\common\Persona 4 Golden\SND). There you will find two files we need:

    - BGM.xsb
    - BGM.xwb

    Paste a copy of these files into your P4G Music Manager\tools\xacttool_0.1 folder. 



  10. We're now ready to open the P4G Music Manager application for the first time.

    In the root of your P4G Music Manager folder, you will find P4G Music Manager.exe. Open this file to run the program.

  11. On first launch, the application will look something like this:



    As you can see, the application is mostly made up of three elements:

    - A column for "Original Tracks"
    - A column for "Replacement Tracks"
    - A console with details of the last performed action.

  12. Now that the application is open, we need to start by extracting the original music for playback in-app.

    To the right of "Original Tracks", you will see an orange and white download button:



    Click this button to begin the extraction. After a couple of seconds you should see the console update and the grey icons in the "Original Tracks" column will change into orange playback buttons, letting you know that they are ready to be played:



    Clicking the play button here will prompt P4G Music Manager to open the selected track (.wav) in your default audio application (e.g. foobar2000, VLC, Windows Media Player).

    Troubleshooting:
    If you cannot playback the files / the buttons do not change / the extraction doesn't complete, double-check that you have completed step 7 properly.

  13. Finally, we need to configure our output directory.

    Note:
    You will notice that the title bar is turqouise in the next screenshot. Don't worry about this for now. Your title bar will probably be orange and that's fine. Please continue following the steps. I will explain the meaning of this colour change in time.

  14. At the top-left of the application window, you will see a "File" option. Click this, then from the drop-down menu, select "Open Config".



  15. A new, small window will pop-up. In this window, click the orange "SELECT" button (with the folder icon).



  16. In an Explorer window, you will be prompted to find and open your P4G.exe. This is Persona 4 Golden's executable and can most commonly be found in C:\Program Files (x86)\Steam\steamapps\common\Persona 4 Golden. Select P4G.exe here and click "Open".



  17. You will be returned to the previous window. Now, confirm the path named is correct and (when happy) tick the checkbox with the label, "Output to Persona 4 Golden Folder".



  18. Close this window. Done!

3.5. Xacttool vs. Phos Song Converter

At the top-right of the application window, you may have noticed this toggle:



Clicking this toggle will switch between the application's two modes. Before you begin using P4G Music Manager, you need to decide which mode is right for you.

When in the Xacttool mode, the title bar will be orange.
When in the Phos Song Converter mode, the title bar will be turqouise.

  • Phos Song Converter is the recommended configuration and will convert custom music to .raw/.raw.txth format, which p4gpc.modloader can then use to replace music in-game dynamically. 

    Like Xacttool's repacking, Phos' conversion can still take a little while to complete, but the converted custom files are cached in P4G Music Manager. This means that unless the source files are modified, future builds of your music mods will be much quicker to complete since the tracks can be copied directly from the cache without having to reconvert.

    Managing the music files generated by Phos Song Converter will be very familiar to anyone who has installed other Persona 4 Golden mods, since they're ultimately loaded from the same directory.

    If you have Reloaded-II/p4gpc.modloader installed or plan on installing any other type of mod in future (music or otherwise), this is the configuration for you.

  • Xacttool (named after the primary tool used) is the original, default configuration but is not recommended for most users.

    When using this mode, a new, full BGM.xwb is built to replace the original in your game's SND folder. This is achieved by repacking a clean copy with your custom files inserted. This repacking process takes ~1-2 minutes per custom track, meaning it can take a long time to complete when working with more than a few songs. 

    However, unlike Phos Song Converter, it does not require Reloaded-II or p4gpc.modloader.




4. Usage

4.1. How to replace a track / add a custom song

The first step in adding in adding a custom track is to select your source file. P4G Music Manager can handle two file types:

  • WAV
    A typical audio file type playable by most audio applications. Files of this type will be converted by P4G Music Manager into a format the game can understand: .raw/raw.txth
  • RAW/RAW.TXTH
    The file type used by the game. This is actually made up of two parts: a .raw which contains the actual audio, and the .raw.txth which contains additional data including loop point information. One cannot be used without the other. When converting a .wav into this file type, the audio is split into these two files.

Most people will have MP3, FLAC or M4A audio files. These will need to first be converted to one of the two file types named above. Whatever audio source file you use, I recommend working with the best quality version you can possibly get your hands on. In most cases this will be a FLAC.

4.1.1. Converting your music to WAV

There are countless tools out there for converting audio file types, but the best for our purposes is Audacity. P4G can be very particular about format and Audacity has the best compatibility in this regard.

In this example, I will be using a FLAC rip of "Darkness" from the Persona 3 FES soundtrack.

  1. First, open Audacity. From "File", select "Open..." and open the file you want to use.



  2. When your file is open, you will see the full waveform displayed on-screen. To export this file as a WAV, select "File" again, then "Export" -> "Export as WAV".



  3. In the next window, make sure your format options are set as pictured then save.



  4. We now have a file that can be used in P4G Music Manager.

4.1.2. Importing a replacement track

  1. Once you have a WAV (or RAW/RAW.TXTH) audio file, we can replace a track in P4G Music Manager.

    For this example we will use the WAV version of "Darkness" we created, and we will replace "A Corner of Memories" which is the piano track that plays on the main menu.

  2. In P4G Music Manager, find the track you want to replace in the left "Original Tracks" column.



    You will notice an orange paper clip icon in the right column. Click this to open a file prompt. From here, you can select your custom music file.

  3. Select your WAV file in this window, and click "Open".



    You will notice that the P4G Music Manager window has updated with a few changes:

    - The previously grey playback icon has become orange, indicating that the file is available for playback.

    - A file path has been added, showing you the location of the file selected and the name.

    - A turquoise "Off"/"On" toggle has become available and is set in the "On" position. Setting this to "Off" will disable the track without removing it. This is useful for testing purposes. For this guide, we will leave it "On".

    - An "X" button has appeared beside the paperclip icon. Clicking this will clear the track.

    And most notably:
    - The "Start Loop" and "End Loop" fields have become available to edit.

4.1.3. Configuring loop points

As noted above, when adding a custom WAV track to P4G Music Manager, the loop fields become available to edit. When configured, these fields tell the game at which points the track should be looped to allow it to be played-back seamlessly, infinitely.

It is advisable to set loop points. If you choose not to, the track will still loop, but it will play in full and end before doing so.

Luckily for me, swindlesmccoop has already made a guide on finding loop point values for custom tracks. You can find a video on this here:



4.1.4. Saving and exporting your custom tracks for use in-game

After adding your custom tracks, enabling and setting your loop points for each, you are now ready to save and export your custom tracks for use in-game.

  1. First, scroll to the top of the application window. You will notice that the save icon on the right is now pulsating.



  2. Click this save icon. You will see the console update, indicating that your current configuration has been saved. The message will read something like this:

    LOG - Electron: Saved file: C:\Users\rudiger\Documents\P4G Music Manager\settings\replacement-data.json

  3. Now that your configuration has been saved, the export button is available to click. This icon appears as a pencil icon at the top-right of the application window.



  4. Click this button to output your custom music. You will see the console update when this has completed:



    - If Phos Song Converter is used, the music will be output to mods\SND\BGM.

    - If using Xacttool mode, the music will be output to SND\BGM.xwb.

    If you navigate to this folder, you will see your custom files as .raw/raw.txth files like this:



  5. Assuming you are using the recommended method (Phos Song Converter), your files will successfully play in-game when you load the game with mods enabled as normal via Reloaded-II.

    If you are using the old Xacttool method, you do not need to load the game via Reloaded-II.

4.2. How to use "Song Packs"

A "Song Pack" in the context of P4G Music Manager is a collection of pre-configured, custom music tracks for use with the application. You can load pack presets other people have made and create your own for sharing with others.

4.2.1. Loading Song Packs

As an example, let's take one of the song packs available here on GameBanana: SDNova's "Persona Music Pack". To use this music pack in-game we will need to do the following:

  1. Download the pack. In this example, the pack is contained within a .zip file.

  2. First, let's inspect the .zip. Here, I've opened the file with 7-zip:



    The folder we're most interested in is this one, because it contains three important elements we will need:

    - The WAV files
    - A songs folder
    - A preset.p4g file (in the same folder as the WAV files)

  3. Next, we will need to decide where to extract the song pack. So long as the three elements mentioned are together and structured as pictured, it doesn't really matter where they are.

    For this example, I will create a new folder called SDNova Pack in my P4G Music Manager directory and extract the contents here:



  4. Now, let's open P4G Music Manager. From here, click "File" (top-left) -> "Load Preset...".



  5. This will open a small file selection window prompting you for a Preset (*.p4g) file. Navigate to the folder we created and select the preset.p4g file within. Click "Open".



  6. After clicking "Open" you will be returned to the main P4G Music Manager window. After a moment, you should see the application update and all of the tracks configured by the song pack will be populated.



  7. Now that the track slots are populated, you will notice the save icon has begun pulsating:



    Now click this icon to save your current config. This will in-turn enable the export icon.

  8. Now that your configuration has been saved, the export button is available to click. This icon appears as a pencil icon at the top-right of the application window.



  9. As described in section 4.1.4 of this guide, clicking this button will finally output your custom music for use in-game.

4.2.2. Making Song Packs

Creating song packs to share with others is simple. After adding your custom songs according to the instructions in section 4.1 of this guide, you are ready to export.

  1. Click "Tools" (top-left) -> "Export as Song Pack Preset..."



  2. In a pop-up window, you will be prompted to select a folder to export your song pack to. For this example, I have created a folder in my P4G Music Manager directory called Test Song Pack.



    Click "Select Folder".

  3. To perform a full export for sharing with others, select "Export as .raw and .txth (Recommended)" in the next pop-up window.



  4. This will start the song pack export process. Depending on how many tracks you are exporting, this could take a little while to complete. When finished, you will see the following message in the console:

    INFO - Electron: ------------------------
    INFO - Electron: Converter output success!


  5. You are now ready to share your own Test Song Pack folder for others to enjoy!

4.3. How to use "Batch Convert Songs"

This option provides a simple interface for setting loop points and converting a large number of WAV files to RAW/RAW.TXTH without assigning them to any specific track.

  1. Click "Tools" (top-left) -> "Batch Convert Songs..."



  2. Immediately you will be prompted to select the folder containing your WAV files.



    For this example, I've created a folder containing two WAV files called Test WAV. Once highlighted, click the "Select Folder" button.

  3. You will then be presented with a new window, listing all of the compatible tracks in your selected folder:



  4. After making your changes, click the orange pencil icon to export your files.

  5. When complete, the console in the main P4G Music Manager window will show the following message:

    INFO - Electron: ------------------------
    INFO - Electron: Converter output success!

  6. If you now check the folder containing your WAV files, you will find new .raw, .raw.txth and .p4g files for each.



5. Troubleshooting

  • "My files aren't playing correctly in-game/are silent."

    Run your source files through Audacity as described in step 4.1.1., (even if they're already in WAV format) and try again. As mentioned a few times in this guide, P4G can be very particular about the type of WAV you use. Audacity has the best compatibility in this regard and simply running your files through it can fix so many issues.

  • "I'm getting an error in the P4G Music Manager console."

    Reinstall ALL of the pre-requisites as listed at the top of the guide, reboot your PC and try performing the action again. If you're still experiencing the issue, let us know with as much detail as possible in the comments below and we'll try to help.

  • "I'm seeing weird messages like this in the Reloaded-II console when I use my new music files in-game: [modloader:XactRedirector] W [mods\SND\BGM\886.raw.txth Duration is not aligned properly, it may not play correctly in game!"

    This isn't necessarily an error. Check the files yourself in-game to see if they play/loop correctly. If they work as you expect, you can safely ignore this message. If they don't, try the two troubleshooting steps above.

  • Xacttool Only: "Could not find file 'C:\Path\To\Your\Music'"

    If a song has a path with any spaces, Music Manager won't be able to find the file. I recommend switching to Phos or moving your song to a location with no spaces, such as the Desktop.

    Working: "C:\Users\***\Desktop\Music\Song.wav"
    Broken: "C:\Users\***\Desktop\Persona Music\Song.wav" You will get the error: "Could not find file 'C:\Users\***\Desktop\Persona'". Notice it missing everything after the space.



6. Other useful music apps

Todos

Misc. Bug Fixes Aemulus Support GUI and Support for BGME:A Features Reduce Requirements Refactor Code 65% access_time Aug 31 2020
1-10 of 77
1
Pages
Go to page:
  • Isaacku avatar
    Isaacku Joined 11mo ago
    Offline
    23d
    it says that the BGM.xwb creation was a success, but i can't find it anywhere, where is it?
    Bananite
    URL to post:
  • arisato_2009 avatar
    arisato_2009 Joined 11mo ago
    Offline
    297 points Ranked 55,597th
    1mo
    So i had a common problem where the music won't play. I referred to what the troubleshooter said but any method i try won't work

    I'm trying to replace the "The Almighty" track from a Yakuza Kiwami track

    I did some methods
    - Export the WAV then Export the Export and the loop goes on
    - I tried decreasing the quality
    - I replaced the BGM.xwb from the xactool folder with an already modified one fresh from the Mod Manager
    - Export the WAV into a MP3 then back into a WAV (both Audacity and some online converter)

    None didn't solve the thing :|

    Bananite
    URL to post:
  • So whenever I try to export dungeon-specific battle themes, it exports, but when the game is supposed to load them, it plays the general battle theme for that situation. (eg. Margaret's theme is changed to my normal custom boss theme)
    the game runs like normal, it just doesn't play those in particular. is there a fix for this?
    Bananite
    URL to post:
  • I've got a very bizarre issue. I kinda doubt there's a solution here, but it's worth a shot.

    To preface, I discovered this tool months ago (the 'final' version had already been released, so not that far back). Used it, and it worked like a charm. No complaints.

    Put the game down for a bit. Came back recently. Now, songs that worked previously are now muted. The three in particular I spotted were Specialist, Backside of the TV, and Time to Make History. Most other tracks work just fine. So far, it's just these three that seem to be borked. I hadn't touched the game or its files for months prior to realizing this.

    Some ways I've attempted to mitigate this:

    • Tested different replacements for the same broken songs. Replacements that I KNOW work, as they had been playing in different places during the gameplay session that brought this issue to my attention. Still muted. The issue persists no matter what .wav is used.
    • Re-Inserted the original replacement tracks via Phos. Lots of times.
    • Turned the replacements off/reverted to vanilla. This works as intended, and the original tracks are back.
    • I installed a couple new mods the same day I noticed this problem. None of them seem to affect music, but I tried turning them all off anyway. Didn't matter.
    • Re-exported the replacements through Audacity. I had already done this when I added them to my game the first time. Didn't make a difference this time.
    • Played around with loops. None of the tracks in question had loops assigned, so I tried giving them some using Audacity. I'd done this with some other, currently functional tracks so I doubt I did it incorrectly.
    • Verified the game's files. I wasn't missing a single one.
    • Tried using Xacttool instead. It keeps trying to locate a P4G file on my desktop. I had the Reloaded-II shortcut there, and renamed it appropriately. Even put the original .exe there. Xacttool still can't find it. Not sure why it's even trying to. I have a feeling that this'll be the band-aid if I figure it out.
    • Copied and pasted all of my tracks to different folders in different directories, and used the copies as the replacements instead. This didn't make a difference.
    • Switched the game's directory.
    • Uninstalled and reinstalled Music Manager + update files.
    • Uninstalled and reinstalled the game, technically. I did leave all mod-related folders intact so it wasn't truly scorched-earth. I'm leaving that as an absolute last resort, and I doubt it would work anyway.
    • Scrolled through this comments section for other unfortunate souls having the same issue. No dice.
    • I HAVE NOT attempted starting a new save file. I'm not far into the game at all, but all of the broken songs don't play until a certain point and I didn't want to waste time on a solution I'm positive would be fruitless anyway.


    The three original tracks I listed earlier (Specialist, Backside of the TV, and Time to Make History, probably more I haven't noticed) seem to be completely irreplaceable now, no matter the .wav or loop assigned. Either I use defaults, or I'm left with no music whatsoever. Like I said previously, this wasn't the case a couple months ago. Everything was functional. E-dust? I dunno.
    Bananite
    URL to post:
  • YaboiHedge avatar
    YaboiHedge Joined 6mo ago
    Offline
    115 points Ranked 74,398th
    3mo
    So how do you get this to work with Encount/BGM Enhanced? I'm kinda confused about how to do that.
    Bananite
    URL to post:
  • Thank you for this tool. My only problem is  that the dungeon's theme will restart after every encounters . Is it possible to make a mod that allow the theme continue to play from where it left off like in persona 5 ? 
    Bananite
    URL to post:
  • For sbd who is having this error: Encoded file missing! Re-encoding required!
    You need to run p4g music manager as administrators , turn of the loop button if you don's set the loop time. It works for me
    Bananite
    URL to post:
  • Hello, I have been trying to troubleshoot this for quite a few hours, and I can't seem to figure out the cause, and it's the weirdest thing.

    Issue: Music won't play when replaced... kinda.
    If I replace the direct audio file from the game's directory it's perfectly fine and I can hear the audio but for some reason if I try to use it through the mod loader It simply does not play. I think it's an issue with the txth file, maybe the sample size became wrong during conversion? I'm not quite sure but I am very confused. 

    What my txth file says: 
    num_samples = 52
    codec = MSADPCM
    channels = 2
    sample_rate = 44100
    interleave = 140
    #samples_per_block = 128
    loop_start_sample = 0
    loop_end_sample = 0
    
    Bananite
    URL to post:
  • I'm trying to replace The Genesis, but the song I'm replacing it with always comes out really quiet. I've tried amplifying it in Audacity a few times, but no matter I do it doesn't get any louder. I've loaded the new song into the music manager with a new filename each time and also tried deleting the cache files, but nothing ever changes. Please help.
    Bananite
    URL to post:
  • quixpy avatar
    quixpy Joined 5mo ago
    Offline
    5mo
    I'm getting an issue where the Music Manager application says the .wav files are missing after trying to download as shown on step 12 of the guide.
    ERROR - Electron: Unhandled exception.
    ERROR - Electron: System.UnauthorizedAccessException: Access to the path 'C:\Users\[user name]\Documents\P4G Modding\P4G Music Manager\tools\xacttool_0.1\BGM\2mix_lastboss_111215.wav' is denied.

    I know the folder is called "xacttool_0.1" exactly so I don't think that is the issue.

    Although I do have my Steam folder outside of Program Files (x86) because I needed to put it directly under the C: Drive to mod another game. Would this be an issue with the Music Manager not being able to find the wav. files?
    Bananite
    URL to post: