Decipio-Carmen
Smash Apprentice
- Joined
- Apr 2, 2010
- Messages
- 88
Intro:
Sometimes when using Nintendont, the game's BGM gets messed up when it tries to load a new HPS file. What happens is you'll get a split second of audio at the very beginning of a soundtrack and then the audio that SHOULD be playing from the HPS file immediately goes silent, while other sound effects will play just fine, and the game will run just fine. It seems to happen randomly when you try to start a match. For me, the bug would NEVER occur when I test an ISO in dolphin, but when I put the same ISO on my Wii, it would often occur usually within 30 minutes of playing friendlies. This ONLY started happening to me when I added custom .HPS files (non-original).
This is a problem that has been bugging me for a long time, and from what I have seen in various forums and from discussing it with friends, it seems to be a common problem with Nintendont. It's not a big deal, you can just restart a match however many times until the music is back, but it's annoying. In my attempts to fix this, I tried many things unsuccessfully. I tried different SD Cards, loading from a USB, updating Nintendont, using uncompressed ISOs,I even tried writing a program that fixes the left/right decoder states in every block header given an input HPS file, which ended up not fixing the said issue RIP
Eventually though, I found a pretty simple fix. With the new versions of 20XX including playlists and the ability to add many songs, which can potentially mess up Nintendont if the files aren't created properly, I thought I'd share it.
Here's the tl;dr of the guide: Original Melee .HPS files mostly (but not all the time) use a block size of 0x010000. This is what they should be so that Nintendont doesn't mess up.
A lot of the files created by audio hacking tutorials on here use a much smaller block size of 0x04000. I assume that this is done to allow higher precision when creating audio loops. To elaborate: each block holds some #seconds of audio. For example, Block 1 holds the 1st second of data, Block 2 holds the 2nd second of data, Block 3 holds the 3rd second of data, etc. To loop from the end, you loop to any of the previous blocks. So with 1 second blocks, you can only loop to the 1st second, 2nd second, etc. You can't jump to for example, 1.5 seconds into the track.. unless you develop your own audio hacking tools, as most of the tools we use to make custom .HPS files assume a constant block size. The advantage of higher control is why I'm guessing smaller block sizes are used. By going to a larger block size, we have less control over where we can loop, and it makes editing .wav files slightly more difficult, but it's what needs to be done to fix this issue.
Guide:
1.) Follow this guide:
http://smashboards.com/threads/how-...-includes-brstm-file-conversion-guide.401142/
and STOP when you get to the part when you open up LEFT.txt or RIGHT.txt to copy the number of samples. (this is step 4 in "outputting the HPS file"
2.) Download and open up this spreadsheet:
http://www.mediafire.com/download/az2azo9gdwxga5s/HPS_Helper.ods
I have changed the list of offsets and changed block size "Block Size" number to 32768 to reflect the new block size.
Aside: In my spreadsheet, I've changed the "Block Size" field to "Block Size (1 Channel)" to be a bit more precise. 32768 in hex is 0x8000, which is half of the target block size. There are actually 2 channels, left and right in our application. In one block there is 0x8000 bytes (or 0x8000 * 2 samples, since 1 sample is actually a nibble) of data for the left channel which is followed by 0x8000 bytes of data for the right channel.
3.) Paste the number of samples that you copied into the "NumSamples" field in the spreadsheet.
4.) Open up main.asm and copy NumSamples into "Samples" and Blocks Needed into "Blocks"
5.) If you want a custom loop, use the Block Info in the spreadsheet to figure out which block to loop to. Take your desired block number and put it into the "Block # to loop on:" field in the spreadsheet. If you are doing a basic loop, just put '1' for this field.
Scroll down to the bottom on main.asm and copy BlockStart and BlockLoop to their respective locations at the end of main.asm.
6.) You see the values underlined in green in the picture above? Make sure all those values are 0x8000 like in the picture.
Aside: You might be thinking, wait a second, didn't you say the block sizes should be 0x10000? Yes they should be. If you've read the first 'aside' you know that the channels are set to 0x8000 bytes of data per block. The values underlined in green only control the size of data for one channel. What we're doing is creating blocks with 0x8000 bytes worth of left-channel data and 0x8000 worth of right-channel data for a total block size of 0x8000 + 0x8000 = 0x10000 (not counting the block header).
7.) Save main.asm and run "build.bat". A command prompt should open. Wait for it to tell you to hit any button to exit and then press anything you want.
8.) output.hps is your new HPS file
Note that if you are running into the issue with Nintendont described here, you will probably have to re-do every non-original .HPS file for the issue to be fixed (don't forget the menu music). I've redone all my .HPS files and haven't run into the issue since then.
Using larger block sizes might also fix this issue if you run into it when trying to play other games on Nintendont. I'm not sure though, I haven't looked at the audio files for other games.
Sometimes when using Nintendont, the game's BGM gets messed up when it tries to load a new HPS file. What happens is you'll get a split second of audio at the very beginning of a soundtrack and then the audio that SHOULD be playing from the HPS file immediately goes silent, while other sound effects will play just fine, and the game will run just fine. It seems to happen randomly when you try to start a match. For me, the bug would NEVER occur when I test an ISO in dolphin, but when I put the same ISO on my Wii, it would often occur usually within 30 minutes of playing friendlies. This ONLY started happening to me when I added custom .HPS files (non-original).
This is a problem that has been bugging me for a long time, and from what I have seen in various forums and from discussing it with friends, it seems to be a common problem with Nintendont. It's not a big deal, you can just restart a match however many times until the music is back, but it's annoying. In my attempts to fix this, I tried many things unsuccessfully. I tried different SD Cards, loading from a USB, updating Nintendont, using uncompressed ISOs,
Eventually though, I found a pretty simple fix. With the new versions of 20XX including playlists and the ability to add many songs, which can potentially mess up Nintendont if the files aren't created properly, I thought I'd share it.
Here's the tl;dr of the guide: Original Melee .HPS files mostly (but not all the time) use a block size of 0x010000. This is what they should be so that Nintendont doesn't mess up.
A lot of the files created by audio hacking tutorials on here use a much smaller block size of 0x04000. I assume that this is done to allow higher precision when creating audio loops. To elaborate: each block holds some #seconds of audio. For example, Block 1 holds the 1st second of data, Block 2 holds the 2nd second of data, Block 3 holds the 3rd second of data, etc. To loop from the end, you loop to any of the previous blocks. So with 1 second blocks, you can only loop to the 1st second, 2nd second, etc. You can't jump to for example, 1.5 seconds into the track.. unless you develop your own audio hacking tools, as most of the tools we use to make custom .HPS files assume a constant block size. The advantage of higher control is why I'm guessing smaller block sizes are used. By going to a larger block size, we have less control over where we can loop, and it makes editing .wav files slightly more difficult, but it's what needs to be done to fix this issue.
Guide:
1.) Follow this guide:
http://smashboards.com/threads/how-...-includes-brstm-file-conversion-guide.401142/
and STOP when you get to the part when you open up LEFT.txt or RIGHT.txt to copy the number of samples. (this is step 4 in "outputting the HPS file"
2.) Download and open up this spreadsheet:
http://www.mediafire.com/download/az2azo9gdwxga5s/HPS_Helper.ods
I have changed the list of offsets and changed block size "Block Size" number to 32768 to reflect the new block size.
Aside: In my spreadsheet, I've changed the "Block Size" field to "Block Size (1 Channel)" to be a bit more precise. 32768 in hex is 0x8000, which is half of the target block size. There are actually 2 channels, left and right in our application. In one block there is 0x8000 bytes (or 0x8000 * 2 samples, since 1 sample is actually a nibble) of data for the left channel which is followed by 0x8000 bytes of data for the right channel.
3.) Paste the number of samples that you copied into the "NumSamples" field in the spreadsheet.
4.) Open up main.asm and copy NumSamples into "Samples" and Blocks Needed into "Blocks"
5.) If you want a custom loop, use the Block Info in the spreadsheet to figure out which block to loop to. Take your desired block number and put it into the "Block # to loop on:" field in the spreadsheet. If you are doing a basic loop, just put '1' for this field.
Scroll down to the bottom on main.asm and copy BlockStart and BlockLoop to their respective locations at the end of main.asm.
6.) You see the values underlined in green in the picture above? Make sure all those values are 0x8000 like in the picture.
Aside: You might be thinking, wait a second, didn't you say the block sizes should be 0x10000? Yes they should be. If you've read the first 'aside' you know that the channels are set to 0x8000 bytes of data per block. The values underlined in green only control the size of data for one channel. What we're doing is creating blocks with 0x8000 bytes worth of left-channel data and 0x8000 worth of right-channel data for a total block size of 0x8000 + 0x8000 = 0x10000 (not counting the block header).
7.) Save main.asm and run "build.bat". A command prompt should open. Wait for it to tell you to hit any button to exit and then press anything you want.
8.) output.hps is your new HPS file
Note that if you are running into the issue with Nintendont described here, you will probably have to re-do every non-original .HPS file for the issue to be fixed (don't forget the menu music). I've redone all my .HPS files and haven't run into the issue since then.
Using larger block sizes might also fix this issue if you run into it when trying to play other games on Nintendont. I'm not sure though, I haven't looked at the audio files for other games.
Last edited: