Ys IX: Monstrum Nox

Ys IX: Monstrum Nox

Not enough ratings
How to Swap IX Music for Custom Tracks
By Aura Enterpr//se
Feel like some songs are not enough and you want more? Want to bring other Falcom games' blazing tracks over? I got you mate!

And technically you can use this for replacing Cold Steel III music & possibly IV too.

All credits goes to Aragaki2009 [Reddit]
   
Award
Favorite
Favorited
Unfavorite
What you need
1. FFmpeg Builds
  • Used to convert any music file to [.wav] format + resampling
  • To download go here[www.gyan.dev], as in "ffmpeg-release-essentials.7z"

2. Opus Tools
  • Used to convert [.wav] format back to [.opus] with loop values that IX will play
  • Technically FFmpeg can do this too, but I don't want the risk of mismatch/missing something while encoding. In fact, I did try and it won't loop
  • To download, go here[opus-codec.org]. It should be in "Source code (stable release)" section, look for "Win32 binaries: opus-tools-0.2-opus-1.3.1.zip"

3. Audacity or similar
  • Used to find your loop values: loop_start and loop_end
  • There used to be concerns about Audacity containing spyware thus I won't place the link here, you should go with much older version if needed.
  • Or if you used alternative, make sure it has the ability to show song in samples instead of time hh:mm:ss (Adobe Audition for instance)

4. A way to check media info
  • People who installed K-lite Codec Pack + MPC-HC already got it
  • Just right-click on any media files > MediaInfo and you will see the details

5. A Pen and a Note (or Notepad)
  • The obvious, to write down the loop_start and loop_end values
Step 1 - Get the .Wav
1. Extract the FFmpeg zip content into a folder, then go to the Bin folder
2. Place any song you want to convert here.
    I will use y7_b001.ogg - Vacant Interference from Ys SEVEN as an example
3. Within the current explorer window, click on address/path bar, type in "cmd" to open Command Prompt, type in the following (use TAB to autofill to make it easier), then Enter:
ffmpeg.exe -i <your_music.ext> -ar 48000 <your_converted_music.wav>


4. Check MediaInfo of converted .wav file, it must be:
  • Format: PCM
  • Bit depth: 16 bits
  • Sampling rate: 48.0 kHz (if you don't get this right, your loop_end & loop_start in the next step will be mismatched => failed loop)

By default FFmpeg will use PCM-16 bit for .wav conversion, and "-ar 48000" from the command above is responsible for changing sampling rate.
Step 2 - Get the Loop
1. Open the converted .wav using Audacity, or you can open Audacity first and drag the file in
2. Before proceed, change the timing view at the bottom from time to samples

Note: Please make sure Project Rate (Hz) to the left is showing 48000 (Hz) accordingly to our track sampling rate, otherwise you will falsely get loop values => looping will not work correctly

3. Don't worry about two same blue lanes of the track as it is 2-channel. Here is the basic operations in Audacity:
  • Space -- Play/Stop
  • Shift + Space -- Loop Play only
  • Hold Shift + MWheel Scroll -- to scroll view left and right of the track
  • Hold Ctrl + MWheel Scroll -- zoom in/out at the part you hover on
  • If you click on any part of blue track, a black line will appear, if you press Play it will always play at that position.
  • If you click on the time ruler above it will automatically play at that, however, if press Play again track will start at the black line (if given already).
  • To select a loop, pan select a region of the track, then hold Shift + Left/Right Arrow to adjust loop_start and loop_end (note that you can only expand). To actually expand & cut back freely, hold Shift (or LCtrl) + Left-click and drag on either sides of the loop.
  • You can also select a loop by specifying Start and End samples like the image above.
  • While Loop Play, use Shift + Left-click on the time ruler to be able to skip to any point, mostly likely near the end of the loop, helpful for checking the loop repeat without hearing the whole track.
4. Now it is up to your ears and find/record loop_start & loop_end values. A tip is that they should be at the zeros - or where the amplitude is almost zero (as shown in the image below)

The loop_start for this track is 367,652, while loop_end is 9,240,777. But your finding doesn't have to be the same.



Extra. You should be done with 4., however, you may find a song being too loud or too little. If that is the case, while in Audacity > select the whole song (Ctrl+A) > Click on Effect from the menu bar > Amplify > increase/decrease the loudness with +/- decibel (dB) by a certain value

Once satisfied, go to File > Export > Export as Wav.
Step 3 - Get the .Opus and Done!
1. Similarly to FFmpeg, extract opus_tool zip content into a folder
2. Put the converted .wav into this folder, same as opusenc.exe
3. Type in "cmd" path bar to open Command Prompt again, use the following and Enter:
opusenc.exe <input.wav> <output.opus> --comment loops=<loop_start>-<loop_end>
With the values from Step 2 we should have:



Once done encoding you can check the MediaInfo again, a loop attribute along the values should be there. You can compare these to one of IX tracks too



THAT'S IT! You can now rename the file and replace converted .opus over any IX track in the bgm folder, inside IX game installation folder (make sure to backup first), boot up the game and enjoy!

In addition, to save the hassle of finding loop_start & loop_end, certain games already contained these values in their tracks, thus always check their MediaInfo first. A few examples are:
  • Ys IX - Monstrum Nox
  • Ys VIII - Lacrimosa of Dana (get the loop infos from this file here[drive.google.com] instead)
  • Ys Origin & Ys Oath in Felghana & Ark of Napishtim (which use LOOPSTART and LOOPLENGTH => sum them together to get loop_end)
  • Trails of Cold Steel III-IV (as similar to IX)
16 Comments
Kijame 25 Jul, 2024 @ 3:07am 
I don't think I'll personally ever use this but I absolutely love that there's folks like you letting people know that this kind of thing is both possible and doable!
Aura Enterpr//se  [author] 11 Mar, 2024 @ 3:32am 
@Darth Feio, I see, normally Audacity should automatically show track appriopriately in its Project Rate (Hz). When I first boot the program, it starts with 41KHz like yours, but when I drag the wav. after sampling rate conversion into, it switches to 48KHz. I will note this one in the step so that others can see then. Thank you for your feedback as well
Darth Feio 10 Mar, 2024 @ 5:41pm 
Okay, i finally got it solved. I was checking the wrong loops times. My version of audacity by default sets project to 41khz. So even if the media file was 48khz, i was using loops times based on 41khz. A friend of mine that told me this. Anyway, problem solved, music loops, its perfect now.
Thank you for your help and patience, appreciate all the replies and answers.
Aura Enterpr//se  [author] 10 Mar, 2024 @ 10:39am 
So I have done 2 custom tracks (1 from Trails Azure and Tokyo Xanadu), following steps from above without amplification stuff.

1. Convert youtube music video into .wav (with 48KHz sampling rate) using ffmpeg
2. Get the loop values using Audacity (in samples)
3. Using opusenc from OPUS tool "opus-tools-0.2-opus-1.3" to convert to .opus format with loop tag
4. Replace opus files with in-game ones (y9_b001.opus and y9_b003.opus for example), launch the game, play it... and they worked normally for me

Proof of testing
https://youtu.be/XWrxMefEHBE?si=zpDsgbsV4cwSWnXf

Ao no Kiseki OST - The Azure Arbitrator loop values:
1877977 - 12052574

Tokyo Xanadu OST - Beyond the Day-to-Day
8355 - 5614793
Darth Feio 10 Mar, 2024 @ 6:05am 
yeah, thats the one i am using
Aura Enterpr//se  [author] 10 Mar, 2024 @ 5:35am 
@Darth Feio what's the version of your Opus? Is it still the same opus-tools-0.2-opus-1.3.1.zip? Different version may change how it set the loops I think
Darth Feio 10 Mar, 2024 @ 5:19am 
Okay, i have not solved the issue but i discovered something. While trying to solve this issue, i tried different start/end loops. What i discovered is, not matter what loops i set in the opus converter, it actually ignores and sets another. This another is always the same. So even thought i clearly said different loops to the program, when you get in game, it plays this same "fixed" one. But if i check the metadata, it shows the loop i set.
It also hows audacity has nothing to do with it, since i tried this without it.
Aura Enterpr//se  [author] 9 Mar, 2024 @ 11:28pm 
@Darth Feio - ah I thin I made an error on that part, I forgot to take into account that Audacity when converting the wav might change part of the metadata - sampling rate, bit depth, etc. leading to looping won't match. Perhaps try skipping that step and see if you can get the looping properly?
Darth Feio 9 Mar, 2024 @ 7:09pm 
Yes, it is in 48.0 khz, one of the first things i verified.
I think i am doing something wrong in audacity. You mentioned "Once satisfied, go to File > Export > Export as Wav.". But like, apart from choosing the loop and writing them down. Do you do something else in the file? Why you need to export? Could you not simply use the wav you already have to convert to opus and set the loops in the converter?
When you select as loop, save as a project and open again, audacity does not save the loop. Thats why i think i am doing something wrong there, maybe.
Aura Enterpr//se  [author] 9 Mar, 2024 @ 1:24pm 
@Darth Feio - have you tried checking your track's sample rate? The in-game tracks are playing at 48.0 kHz, but if yours different then the loop point won't match, looping earlier.