Xenoblade X replace music

  • Thread starter Thread starter pwnsweet
  • Start date Start date
  • Views Views 18,408
  • Replies Replies 130
  • Likes Likes 2
Here's my custom BGM :P, basically all in-game lyrics themes were replaced by the instrumental counterparts, except Wir fliegen. Cutscenes song themes are untouched.

Also:
NLA Day replaced by The Way 2:35 (no lyrics)
NLA Night
replaced by Mono X 3:13 (Title Theme)
Black Tar (all)
replaced by Ganglion Battle!

Details about themes ID included in music_id.txt

https://mega.nz/file/tE5GkZwQ#ONY-HC6KzTJ7uPwx-gxPMwgj4CDa28gq_AqJccH_g3U
The package is all original music done by you, or does it include original XBX songs from the game itself? As ther might be some issues with sharing game content in here...
 
Here's my custom BGM :P, basically all in-game lyrics themes were replaced by the instrumental counterparts, except Wir fliegen. Cutscenes song themes are untouched.

Also:
NLA Day replaced by The Way 2:35 (no lyrics)
NLA Night
replaced by Mono X 3:13 (Title Theme)
Black Tar (all)
replaced by Ganglion Battle!
Thank you very, very, very much! AT LAST since 2015 I can play the game without puking around with hell of a vomit due to Black Tar's rapping.
 
The package is all original music done by you, or does it include original XBX songs from the game itself? As ther might be some issues with sharing game content in here...
You're right, post removed for caution
 
  • Like
Reactions: lwiz
I haven't figured out how to properly do this without WWise yet, sorry folks! I've gotten it as far as loading the sounds okay, but they don't actually play in game properly, they loop at such inconsistent times it's too distracting lol

I suspect it's due to needing to figure out how to open up and configure the .bnk files, as I feared, all of the loop data is stored in there, and that means no matter what song you swap with, it's going to have the old song's loop data, so there'll either be a sudden cut where the song restarts, or long periods of silence.

In the mean time, I've uploaded my own music swap mod (not external imports yet) that I'm using when I'm playing on my Steam Deck rather than PC. These are to my own tastes but maybe one of you will enjoy the songs I've swapped.

To use it: Go to your device/emulator path. Easiest way to do so is on an emulator is to right click your game and open the mod folder. It's different depending on your environment. In my case on Citron:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000

Then create a folder path that matches the expected path, like so:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000\MusicMod\romfs\sound

Finally, drop Music.pck in the sound folder. After that, simply make sure you actually load it like you would a cheat, and you're good to go.


*modsnip*

NLA DAY (34A380BD) replaced by Theme X (09E7B59D) NLA NIGHT (385CB3EB) replaced by So Nah, So Fern (Instrumental) (2765C5CE) Z37 Battle (Aggro Theme) (2EAA99CF) replaced by Ganglion Attack! (Ground) 1D6308EB Black Tar (Ground Battle) (10692B95 and 01546BBB) replaced by No.EX 1 (short) 3217F4DE Black Tar (Skell Battle) (046C954F and 07D2FBE2) replaced by New Area Battle Theme(?) 3D040CC4 Uncontrollable (Tyrant Theme) (04CDD66F, 1F430BF5 and 2F4B7A3E) replaced by In The Forest (Instrumental) (25A29F38)

EDIT: As per the rules, the link was removed, désolé!
 
Last edited by Arpeggiate,
  • Like
Reactions: tet666 and cucholix
You're right, post removed for caution
Sorry being uptight about it, but Nintys on rampage nowadays :/

Even if the mod can be trivial for technically savvy, some means of distributing it without copyright infringement would be great. Maybe a windows batch file and shell script for linux with unpack/pack tools in the archive?

//EDIT Of course the keys should be separately supplied byt enyone using the script.
 
I haven't figured out how to properly do this without WWise yet, sorry folks! I've gotten it as far as loading the sounds okay, but they don't actually play in game properly, they loop at such inconsistent times it's too distracting lol

I suspect it's due to needing to figure out how to open up and configure the .bnk files, as I feared, all of the loop data is stored in there, and that means no matter what song you swap with, it's going to have the old song's loop data, so there'll either be a sudden cut where the song restarts, or long periods of silence.

In the mean time, I've uploaded my own music swap mod (not external imports yet) that I'm using when I'm playing on my Steam Deck rather than PC. These are to my own tastes but maybe one of you will enjoy the songs I've swapped.

To use it: Go to your device/emulator path. Easiest way to do so is on an emulator is to right click your game and open the mod folder. It's different depending on your environment. In my case on Citron:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000

Then create a folder path that matches the expected path, like so:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000\MusicMod\romfs\sound

Finally, drop Music.pck in the sound folder. After that, simply make sure you actually load it like you would a cheat, and you're good to go.


*modsnip*

NLA DAY (34A380BD) replaced by Theme X (09E7B59D) NLA NIGHT (385CB3EB) replaced by So Nah, So Fern (Instrumental) (2765C5CE) Z37 Battle (Aggro Theme) (2EAA99CF) replaced by Ganglion Attack! (Ground) 1D6308EB Black Tar (Ground Battle) (10692B95 and 01546BBB) replaced by No.EX 1 (short) 3217F4DE Black Tar (Skell Battle) (046C954F and 07D2FBE2) replaced by New Area Battle Theme(?) 3D040CC4 Uncontrollable (Tyrant Theme) (04CDD66F, 1F430BF5 and 2F4B7A3E) replaced by In The Forest (Instrumental) (25A29F38)
so what are next steps to look for?
dreaming of colony9
 
Last edited by DinohScene,
I haven't figured out how to properly do this without WWise yet, sorry folks! I've gotten it as far as loading the sounds okay, but they don't actually play in game properly, they loop at such inconsistent times it's too distracting lol

I suspect it's due to needing to figure out how to open up and configure the .bnk files, as I feared, all of the loop data is stored in there, and that means no matter what song you swap with, it's going to have the old song's loop data, so there'll either be a sudden cut where the song restarts, or long periods of silence.

In the mean time, I've uploaded my own music swap mod (not external imports yet) that I'm using when I'm playing on my Steam Deck rather than PC. These are to my own tastes but maybe one of you will enjoy the songs I've swapped.

To use it: Go to your device/emulator path. Easiest way to do so is on an emulator is to right click your game and open the mod folder. It's different depending on your environment. In my case on Citron:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000

Then create a folder path that matches the expected path, like so:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000\MusicMod\romfs\sound

Finally, drop Music.pck in the sound folder. After that, simply make sure you actually load it like you would a cheat, and you're good to go.


*modsnip*

NLA DAY (34A380BD) replaced by Theme X (09E7B59D) NLA NIGHT (385CB3EB) replaced by So Nah, So Fern (Instrumental) (2765C5CE) Z37 Battle (Aggro Theme) (2EAA99CF) replaced by Ganglion Attack! (Ground) 1D6308EB Black Tar (Ground Battle) (10692B95 and 01546BBB) replaced by No.EX 1 (short) 3217F4DE Black Tar (Skell Battle) (046C954F and 07D2FBE2) replaced by New Area Battle Theme(?) 3D040CC4 Uncontrollable (Tyrant Theme) (04CDD66F, 1F430BF5 and 2F4B7A3E) replaced by In The Forest (Instrumental) (25A29F38)
Not working exactly like you describled. Same old music.
EDIT: Nvm it worked. My folder was Sound not sound, now working. Ty
 
Last edited by DinohScene,
I haven't figured out how to properly do this without WWise yet, sorry folks! I've gotten it as far as loading the sounds okay, but they don't actually play in game properly, they loop at such inconsistent times it's too distracting lol

I suspect it's due to needing to figure out how to open up and configure the .bnk files, as I feared, all of the loop data is stored in there, and that means no matter what song you swap with, it's going to have the old song's loop data, so there'll either be a sudden cut where the song restarts, or long periods of silence.

In the mean time, I've uploaded my own music swap mod (not external imports yet) that I'm using when I'm playing on my Steam Deck rather than PC. These are to my own tastes but maybe one of you will enjoy the songs I've swapped.

To use it: Go to your device/emulator path. Easiest way to do so is on an emulator is to right click your game and open the mod folder. It's different depending on your environment. In my case on Citron:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000

Then create a folder path that matches the expected path, like so:

E:\Documents\Emulator\Citron\user\load\0100453019AA8000\MusicMod\romfs\sound

Finally, drop Music.pck in the sound folder. After that, simply make sure you actually load it like you would a cheat, and you're good to go.


*modsnip*

NLA DAY (34A380BD) replaced by Theme X (09E7B59D) NLA NIGHT (385CB3EB) replaced by So Nah, So Fern (Instrumental) (2765C5CE) Z37 Battle (Aggro Theme) (2EAA99CF) replaced by Ganglion Attack! (Ground) 1D6308EB Black Tar (Ground Battle) (10692B95 and 01546BBB) replaced by No.EX 1 (short) 3217F4DE Black Tar (Skell Battle) (046C954F and 07D2FBE2) replaced by New Area Battle Theme(?) 3D040CC4 Uncontrollable (Tyrant Theme) (04CDD66F, 1F430BF5 and 2F4B7A3E) replaced by In The Forest (Instrumental) (25A29F38)

EDIT: As per the rules, the link was removed, désolé!

Would it be a lot of trouble for you to make a pack where NLA day and night is replaced with colony 9 day and night, black tar is replaced by black tar instrumental, and the Skell flight music is replaced by Theme X?
 
Would it be a lot of trouble for you to make a pack where NLA day and night is replaced with colony 9 day and night, black tar is replaced by black tar instrumental, and the Skell flight music is replaced by Theme X?

I'm not allowed to post links to made mods anymore, so unfortunately you'll have to do it yourself. Aside from adding Colony 9 (it's impossible to add custom tracks right now without Wwise), it really isn't difficult though.
 
I'm not allowed to post links to made mods anymore, so unfortunately you'll have to do it yourself. Aside from adding Colony 9 (it's impossible to add custom tracks right now without Wwise), it really isn't difficult though.
Did you figure out how properly loop a track?
 
Did you figure out how properly loop a track?
I tried to do it similar to the WiiU version: VGAudioCli can make track loop by specifying frame duration: VGAudioCli -i SOUND_replacement/x63_00.wav -o STREAM/34A380BD.wav -l 0-7074480 # NLA day
but on the switch they use wwise instead of loose cri adx files, and looping info is sotred in wwise soundbanks as it seems like from #66:
I suspect it's due to needing to figure out how to open up and configure the .bnk files, as I feared, all of the loop data is stored in there, and that means no matter what song you swap with, it's going to have the old song's loop data, so there'll either be a sudden cut where the song restarts, or long periods of silence.

So I went ahead and pulled Wwise, got it working, setup a project.
Bulk-converted the wem files in Music/STREAM*.wav into playable wav files, replaced the terrible ones (NLA Day / Night) by custom ones, and imported them into Wwise.
Setup the default audio conversion ShareSets/Conversion Settings/DefaultWork Unit/Default to Format "WEM Opus". Save project.
Then Project/Convert All Audio Files. The .wem failes get generated into <ProjectDir>/.cache
Using vgmstream-cli -m .cache/.../*.wem on the generated wem files shows that they are libopus Opus encoded and have metadata in the Audiokinectic Wwise RIFF header.

Replacing the old files in STREAM/ with these (naming STREAM/34A380BD.wav in my case) won't work however (game plays silence), I assume because they have wrong hashes.

So I added all wav files to my project, and built a wwise soundbank (.bnk).
I set one track to loop inifinity and made it streamable, then applied this setting to the 200 other tracks using Paste properties.
The generated bank contains no wem files(like the original), and is around 20 kB in size.
I repacked the generated wem files under the old names together with the new bnk, but the game will still just play silence, perhaps someone knows a soundbank definition file that matches the format expected by the game ?
Or do I need to compute new hashes for the wem file names in STREAM/ ?
 
Last edited by NumaNuma,
Oh, I see. This complicates things. So Music.pak contains the two banks:
Code:
0x1899AC8D: "bgm"
0xDD4B5BF7: "CS_music"

WWise will assign a newly created bank named "bgm" the correct id 0x1899AC8D, yet the generated bgm.bnk is much shorter than the extracted 1899AC8D.bnk. (12kB vs 98kB)
Additionally, WWise assigns new ids to all imported wav files - stored in Actor-Mixer Hierarchy/Default Work Unit.wwu, that could be fixed using regex...

Edit: It is correct for Banks names. For Streams it seems to use something else as it doesn't go above 30 bits.
Or I could try to work out the hashing algorithm for stream files and then search for the original track names. But this still leaves the generated sondbank incomplete/too short.

So I was wondering:
I haven't figured out how to properly do this without WWise yet, sorry folks!
@Arpeggiate, how did you get this to work in WWise ?
I get all silence in-game for tracks that were converted to "WEM Opus" by wwise, both with- and without changing the soundbanks.
 
Or I could try to work out the hashing algorithm for stream files and then search for the original track names.
You don't need to figure this out because it's public.
https://www.audiokinetic.com/en/library/edge/?source=SDK&id=_ak_f_n_v_hash_8h_source.html
"Hash30"

Which is basically Hash32 (that is used for banks) with little twist
C:
#include <stdio.h>
#include <string.h>

int main() {
    char str[] = "cmn_201_001_Play";
    unsigned int FNV1_INIT = 0x811C9DC5;
    unsigned int FNV1_PRIME = 0x1000193;
    for (size_t x = 0; x < strlen(str); x++) {
        if (str[x] >= 'A' && str[x] <= 'Z')
            str[x] += 0x20;
        FNV1_INIT = (FNV1_PRIME * FNV1_INIT) ^ str[x];
    }
    FNV1_INIT = (FNV1_INIT >> 30) ^ (FNV1_INIT & ((1 << 30) - 1)); //Hash30 Twist
    printf("0x%08X", FNV1_INIT);
    return 0;
}
Post automatically merged:

Updated python scripts for unpacking/packing pck.
Now pck_unpack has most of bank names covered so it will use it instead of hash whenever possible.
pck_nonvoice_pack for bnk files now uses hash stored inside them instead of file name.
Post automatically merged:

Ok, I have made all tools and scripts necessary to create new audio files + edit length of audio in bgm.bnk so loop is adjusted properly. I will share everything somewhere at the end of this week because this is slightly complicated and I want to make it slightly simpler than it is now.

As a tease:
Put those files inside zip to unpacked Music.pck and pack Music folder. You will get new song in Title Menu with properly adjusted loop (without it there is a very long delay between loops)

 

Attachments

Last edited by masagrator,
Ok, I guess I got time anyway. :P

So first of all requirements:
- Windows
- native Python 3.10 or newer installed

Remember that audio file cannot be too loud otherwise sound is artifacting, if you hear artifacts while song is playing try to lower its volume with tools or site like this:
https://mp3cut.net/change-volume

Here is package that can convert standard WAV s16le 48000 Hz file to WEM/WAV used by XCX.
https://downgit.github.io/#/home?ur...ain/XenobladeChroniclesX/ConvertWavToRIFFOpus

Unpack it and drag&drop standard WAV file on "DROP_HERE.cmd", it will create new file in the same directory where is "DROP_HERE.cmd" with the same name, but ".wem" type instead of ".wav"

1744864306203.png


You will get also info how long that file is in milliseconds, you need to save this info somewhere.

1744864343791.png

Now you need to rename wem file to what it was originally. So in case of main menu theme it's "3BF547BA.wav" and replace file in STREAMS folder.

1744864374841.png


---

Download those scripts and put them into Music/BANKS folder
https://github.com/masagrator/NXGameScripts/blob/main/XenobladeChroniclesX/bnk_extract.py
https://github.com/masagrator/NXGameScripts/blob/main/XenobladeChroniclesX/bnk_packer.py

From cmd opened in Music/BANKS directory
Code:
python bnk_extract.py bgm.bnk

This will create new folder "bgm" with "HIRC.json" in it.

1744864418235.png


Open it with text editor (I recommend Notepad++ or Visual Studio Code for syntax highlighting), now try to find hash of your wav file (in main menu theme case it's "3BF547BA"). You can get more than one result, all of them needs to be tweaked.

1744864615760.png

Just below found hash you have "SrcDuration", you must replace value with milliseconds that our converter printed before.
Below that you have "MusicSegmentID", we are searching for that value that is usually just in the next entry.

In that next entry we need to replace "Duration" value also with milliseconds that we saved before.
Now just below that we have Markers which are responsible for start and end of loop.
If we just want it to loop from start to the very end, in second Marker entry change "Position" value to milliseconds we saved before.
1744864564042.png


Save HIRC.json file and now in Music/BANKS use
Code:
python bnk_packer.py bgm
This will create new "bgm.bnk" in PACKED folder.
 
Last edited by masagrator,
Thank you for these tools, masagrator! I've been following your steps for bgm replacement, I tried to use bnk_extract.py in cmd, and it would not create the bgm folder. I would have to create the folder manually and then the script works.

Another thing, in HIRC.json, some hashes for songs like 00D5ED49 (Wir fliegen) aren't in the file. Would that mean it's unreplaceable with custom bgm?
 

Site & Scene News

Popular threads in this forum