So here is a little tutorial to
add music WITHOUT replacing the existing ones (works with Field/World BGM, didn't test yet with background music)You will need
Audacity, Memoria, Dnspy and Hades Workshop (Unity Asset Viewer precisely) for that but don't worry, it's very simple !
Sorry in advance if I make grammatical or spelling mistakes
I) Create/Prepare your soundtrackFirst of all, you need to prepare your music with Audacity (or another software if possible).
On this first step, we need to create two metadata on your file : "LoopStart" and "LoopEnd". Indeed, Memoria can convert .ogg in another format with an AKB header (the important part !).
This header will contain the loop region from your music : this step is essential to make an appropriate OST for FF9.
At the bottom of the screen, right click on numbers and select "samples."

Open your audio file with Audacity and create looping region, you can use labels (Tracks -> Add Label or Ctrl + B).
These labels are optional but are very useful to visualize the loop. Of course, these two points in the song MUST sound exactly the same !

Once your loop is in place, select the region between theses labels and note the number of frames of the loop start and the loop end.

On this example : Loop Start = 4095758 and LoopEnd = 9166785.
Export your file in .ogg format and the metadata window will pop up.
On this window, "Add" two lines and name them EXACTLY : LoopStart and LoopEnd, with their respective values (frames number)
Save as music123 (123 is the first ID available) and done !
II) Edit Dictionary MusicDiplayNames on MemoriaFor this part, DnSpy is needed. Open Assembly-CSharp (FINAL FANTASY IX\x64\FF9_Data\Managed) and search AudioResources on folder Memoria.Assets.
On this file, you will find this.
private static readonly Dictionary<string, string> MusicDisplayNames = new Dictionary<string, string>
{
{
"music000",
"Victory Fanfare"
},
{
"music001",
"Game Over"
},
{
"music002",
"Dali Village"
},
{
"music003",
"Evil Forest"
},
{
"music004",
"Passive Sorrow (Music that plays at the beginning of Disc 4)"
},
{
"music005",
"Amarant's Theme"
},
{
"music006",
"Battle Theme"
},
{
[...]
Edit Method and add your soundtrack, for example :
[...] {
"music121",
"Final Fantasy III Theme"
},
{
"music122",
"Assault of the white dragons"
},
{
"music123",
"FF9 Boss Theme Music Remake"
}
};
Save your(s) modification(s) and open HW.
III) Add an index for your soundtrackOpen Hades Workshop and Unity Asset Viewer, choose your game launcher.
Open ressources.assets and export musicmetadata.txt.
On this file, add theses lines :
{
"name": "Sounds01/BGM_/music123",
"soundIndex": "149",
"type": "Music"
}
By the way, i don't know if you can't choose randomly SoundIndex but that's how i did => To find out which number, use DnSpy and open FF9DBAll on {-} folder : search SNG_MUSIC list and you can see the associated index.
Example for SNG_MUSIC123 :
// FF9DBAll
// Token: 0x04001E9A RID: 7834
public const int SNG_MUSIC123 = 149;
Save your musicmetadata.txt and import it on UAV.
After that, you can edit "BtlEncountBGMMetaData.txt" (for battles on the field) and "WldBtlEncountBGMMetaData.txt" (for battles on the map) on ressources.assets to add your music.
/_!_\ Use the "soundtrack soundIndex" on this file ! For our previous example, the ID
will be 149 and
not 123 !
If you forget how to change ID music from battle =>
Changing the battle music of specific battles (Steam)IV) Activate Memoria import Open Memoria.ini and activate import function : change value 0 to 1 for Enabled and Audio.
[Import]
Enabled = 1
Path = %StreamingAssets%
Text = 0
Audio = 1
Graphics = 0
Field = 0
Save and now, you need to create a specific folder on the selected path : \Sounds\Sounds01\BGM_
By default, this will be : FINAL FANTASY IX\StreamingAssets\Sounds\Sounds01\BGM_
On your BGM_ folder, add your .ogg file.
And... that's all ! Congrats !

Hopefully, when you will launch a battle with your new soudntrack, Memoria will create two files : .ogg file correctly renamed (music123 - [Your title].ogg) and your soundtrack with .akb header.
If you encounter any difficulties, don't hesitate to consult the Memoria.log file to see what happens (don't forget to activate Debug on Memoria.ini)
Hope that's will be helpfull if you want to make various battle with differents soundtracks !
PS : Didn't test yet but i suppose you can make this same logic with SoundEffect (dictionnary SoundDisplayNames on Memoria and soundeffectmetadata.txt on ressources.assets)