• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

How to Create Custom HPS Music Files Using MeleeHPS (Includes BRSTM File Conversion Guide!)

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
MeleeHPS is an amazing little program created a few years back by GenesisFan64. See the original post here. It gives the ability to create completely custom HPS music files. No one really used it in the past and GenesisFan64's instruction were also a little vague on how to use the program. I fiddled around with it a whole bunch and managed to learn how to use MeleeHPS to create normal and custom looped HPS files.

Requirements:
1) Files from this download.
  • Includes everything needed to run MeleeHPS and an Excel document, titled "HPS Helper", created by me to assist in using the program.
2) Any ol' hex editor. I use Hex Editor Neo.
2) Audacity
3) BrawlBox v0.70 if you plan on converting a BRSTM into an HPS file.
4) A sound file that is open in Audacity in which you already know the desired loop point timing (in samples or seconds, out to three decimal places). This loop point is *from the end of the file* to the loop location.
  • If converting from a BRSTM, BrawlBox can get you this, which is covered in the guide below.

DISCLAIMER
This guide does NOT go over how to find good loop points for a song. That is a task for yourself before you start with this. This guide covers how to take your finished/edited music in Audacity and output it into an HPS file.



Definitions:
Normal Loop
- Loop from the end of the song back to the very beginning.

Custom Loop
- Loop from the end of the song back to a location that is not the beginning.



Guide:
NOTE: At first glance this seems like a lot of steps, but its really not complicated at all and very easy to memorize. Once you've done a couple songs and have the flow down of how to do everything, you can convert a BRSTM to HPS in 5-10 mins easily.

Note: brawlcustommusic.com has TONS of video game music already in BRSTM format. Check there before trying to modify a file to create loop points yourself, because the hard work might already be done for you.

1) Open the BRSTM file in BrawlBox.
2) Listen to the song and make sure it sounds good and that the loop point sounds right.
- If the loop point sucks, then redo it yourself. Don't settle for crap.

If the song and loop is acceptable,

3) At the top, hit "Edit" --> "Export", and make sure your "Save as type" is the .wav.
4) Open that file up in Audacity. We will get back to it in a bit.

Now we need to get loop point info about the BRSTM file.

5) In BrawlBox, copy the SampleRate, LoopStartSample, and NumSamples and put them in the "BRSTM Conversion Calc" section of the HPS Helper file. This will give you the loop point in seconds for the file you exported.
- NumSamples (total length of the song) isn't necessary, but I like to add it anyway.

Picture 4.PNG


Now you've got all the information you need to continue with the rest of this guide.

-----------------------------------------------------------------------

With your music file open in Audacity...(start here if you are not converting a BRSTM)

NOTE: At this point, please read the comment on this thread from @ Myougi Myougi about normalizing and amplifying music in Audacity so that the sound levels come out nicely in-game. Do this if you want your HPS files to be top notch.


Choose loop type:
No intermediate steps required. Jump to the "Final Audacity Steps" section.
So you have a .wav file with a specific loop point that does not occur at the very beginning. Before you continue, you need to know the exact millisecond that this loop point occurs on.

Goal: Find the block # for the HPS to loop on.
In HPS Helper, there is a table on the left that lists block numbers to loop on and their associated (total) time values. Pick the block # that lines up with your loop point and place it in the green highlighted "block # to loop on" cell.

If your loop point does not exactly line up with one of the blocks (highly likely), you need to modify the .wav file in one of two ways.

Example:

My loop point: 9.700 seconds


Block # 22: 9.406 s
Block # 23: 9.854 s
(closest blocks to my desired loop point from the HPS Helper spreadsheet)

Dang...my desired loop point doesn't line up exactly with a block...


1)
First and foremost, always check the beginning of the sound file. If there is silence before the audio starts, see if you can just remove some silence to shift the loop point [down in time] onto a block.

9.700 - 9.406 = 0.294 seconds.

If there is at least 0.294 seconds of silence at the beginning, then delete it. Now your loop point sits directly on block 22, so input 22 into the "Block # to loop on" cell.

If the above step does not apply and there is no silence at the beginning of the sound file, or the beginning is important and we want to hear every bit of it:

2)
This time, we need to just add in a little bit of silence before the song begins. So we need to move the loop point UP to the next closest block.

9.854 - 9.700 = 0.154 seconds.

So add in 0.154 seconds of silence to the beginning of the file. And remember, this is ADDING, not OVERWRITING. Now you would input 23 as the "block # to loop on" in the spreadsheet.

1) Ctrl+A, to highlight the entire song. Ctrl+C, Copy it. Keep everything highlighted.
2) In the "Selection Start" box at the bottom, change it to the total time of silence you want to add.
3) Using the above example values, I would now have 0.154 to song end highlighted. Delete it.
4) Ctrl+A to highlight the small bit of song you have left. Go to "Edit", "Remove Special", and then click on "Silence Audio".
5) Click at the end of this little bit of silence song to place your cursor there and then CTRL+V to paste (the entire original song).

Now that the loop point perfectly lines up with an HPS block, proceed to "Final Audacity Steps".

1) In the bottom left, there is a box for "Project Rate (Hz)". Make this value 32000 (Melee default). I guess you could make it higher quality, but your file size will also grow. I've personally never done anything but 32000.

2) Click the black menu arrow on the left side of the working window for your music file. Highlight "Set Sample Format" then click "16-bit PCM".
3) Go back to that same drop down menu and select "Split Stereo to Mono".
- you basically now have two separate sound files within Audacity.

Picture 1.png


4) Double click the top sound file to highlight the entire thing.
5) Go to "File" --> "Export Select Audio". Name it "LEFT" and put it in your arbitrary, designated folder for this song conversion.

6) Double click the bottom sound file to highlight the entire thing.
7) Go to "File" --> "Export Select Audio". Name it "RIGHT" and put it in your arbitrary, designated folder for this song conversion.

8) Now go to your project folder and copy LEFT.wav and RIGHT.wav that you just created.

9) In the "MeleeHPS" folder from the downloaded files, navigate into the "dsp" folder and paste both .wav files there.

Now continue to the "MeleeHPS - Outputting the HPS File" section.

-----------------------------------------------------------------------

1) In the "dsp" folder, open the file titled "run.bat" and a command line window will open. Wait until it says "Press any button to exit" for it to finish doing it's thing.

It created some other files in this folder titled LEFT and RIGHT.

2) Open LEFT.dsp in your hex editor. Go to the end of the file and pad it with zeroes. I just add in one full line of zeroes to be safe. Save. Close.

3) Open RIGHT.dsp in your hex editor. Go to the end of the file and pad it with zeroes. I just add in one full line of zeroes to be safe. Save. Close.

These two steps are the only thing you need the hex editor for.

Picture 2 - Pad zeroes.PNG




4) Open LEFT.txt or RIGHT.txt. Doesn't matter which one. One of the lines at the top gives the length of the file in samples. Copy this value.

5) In HPS Helper, paste this value in the "NumSamples" cell at the top, in the "Final Song Info for MeleeHPS" area.
- This will adjust the "Blocks Needed" cell.

Now we're done with the "dsp" folder. Go back to root MeleeHPS folder (with the number of samples still copied to your clipboard).

6) Open up the "main.asm" file in Notepad. This is your configuration file that sets the guidelines for how to create the HPS file.

- I included a main.asm that should be used for normal loop points, and another that should be used for custom loop points.
- Use whichever is appropriate. Just duplicate the file and then rename it to main.asm.


With main.asm open,

7) Paste your song length in samples that I told you to copy from LEFT.txt on the "Samples" line.
8) Copy the "Blocks Needed" from HPS Helper and paste it as the value to use for "Blocks".



IF YOUR ARE DOING A NORMAL LOOP, JUST SAVE AND EXIT OUT OF MAIN.ASM AT THIS POINT AND GO DOWN TO STEP 11.


Custom Loops:
Go to the bottom of main.asm.

In HPS Helper, you should have already set your "Block # to loop on" earlier. This value and the "NumSamples" that you already pasted in Step 5 will set the "BlockStart" and "BlockLoop" output cells accordingly.


9) Paste these two values into their respective locations at the end of the main.asm file.



10) Save main.asm and close the file.


The Finale!!!

11) In the "MeleeHPS" folder, run the file "build.bat". A command prompt window will open and it will be building your HPS file. Wait for it to say "Press any button to exit".

12) output.hps is your new Melee music file.

13) Test your file and then share it in
The Complete Music (and Sound) Compendium

-----------------------------------------------------------------------
Troubleshooting
I have experienced a few cases where following the above steps exactly resulted in the HPS file not looping correctly and freezing the game.

MeleeHPS automatically adjusts the size of the last song data block to perform the loop back at the right moment. If this block gets too small, then the game will freeze. (I'm not exactly sure on the limitations of block sizes, etc.)

Before reading further though, DOUBLE CHECK, that every one of the above steps was completed. Especially padding the LEFT.dsp and RIGHT.dsp files with zeroes, because not doing so will certainly make your HPS file freeze the game when it tries to loop.

Only do the next steps if you are 100% sure that you've done the above steps correctly.

For Custom Loops:
1) Open the main.asm file you are using and scroll to the bottom.


2) Divide the BlockLoop number by 4 and round down to the nearest integer.

3) Change the BlockData (only for the BlockLoop section) from 0x2000 to 0x8000.

Example:

From this
Code:
BlockStart:
        rept 19
        BlockData 0x2000,0
        endr
BlockLoop:
        rept 67
        BlockData 0x2000,0
        endr

        BlockData 0x2000,BlockLoop
        even
To this
Code:
BlockStart:
        rept 19
        BlockData 0x2000,0
        endr
BlockLoop:
        rept 16
        BlockData 0x8000,0
        endr

        BlockData 0x8000,BlockLoop
        even
Save. Then rerun build.dat.
Make sure to change those BlockData sizes back to 0x2000 before making your next HPS.
[/SPOILER]
 
Last edited:

Myougi

My posts are gluten free.
Joined
Mar 14, 2014
Messages
484
Location
WEST COAST BEST COAST
@ Myougi Myougi when you get a moment, can you say a word or two about good practice for normalizing/amplifying song volumes?
Okie.
Amplifying and Normalizing. These are two things you'll get a feel for if you've ever messed with audio files.
It's pretty simple, so...

LETS GO:
Pick out the audio file you want to use. Anything will do.
Download Audacity if you don't have it already: http://web.audacityteam.org/

Once you've got both of those, install and open Audacity and drag and drop your music file into the program. It can be a variety of formats, WAV, MP3, FLAC, it doesn't matter as long as Audacity can open it. Some audio files are way to loud to be used in Melee. If these audio files are to loud, they can make the music sound trashy and have static blips, along with drowning out the sfx. You can fix these problems by normalizing your audio files/amplifying them so they are at the right volume in the game at all times.


NORMALIZING AUDIO (do this first):
First off, all normalizing does is set the correct DC offset (Usually setting it to 0.0 is fine. Removing it defaults to this in Audacity. The maximum amplitude should be -1.) and adjust multiple audio channels to the same peak level, removing any level disparity between them. This is good because it makes quieter parts in a file louder, and louder parts quieter. That way songs don't suddenly 'boom' on you.

Highlight the wavelength of your entire audio file. The entire thing.
Go to the 'effect' tab.
Click on 'normalize'. It's about halfway down the list.
Make sure the first two check boxes are checked. The last one doesn't have to be checked.
You're done normalizing your audio. :3


AMPLIFYING AUDIO (do this second):
Amplifying audio allows you to change the level of one or more tracks or channels by the same amount, preserving the balance between them. You can amplify up or down depending on your track's wavelength. DO NOT LET THE AUDIO CLIP. MAKE SURE ALLOW CLIPPING IS NOT CHECKED. Make sure none of the peaks of the audio cross the top or bottom of the spectrum.

Highlight the wavelength of your entire audio file. Again, the entire thing.
Go to the 'effect' tab.
Click on 'amplify'. You can't miss it.
Make sure the 'allow clipping' box is unchecked.
Adjust the amplification slider slightly left or right depending on how loud your audio needs to be (left = softer, right = louder). This is something you'll need to get a feel for. You don't want the audio to be to loud or to quiet ingame. Here's around what your audio's wavelength should look like:

(Don't make it too loud or too quiet!)
After you're all done fixing your audio file, your audio is... almost ready to go! Follow the steps listed in the main post for more stuff.


OTHER STUFF:
When you export your audio, don't be alarmed if your WAV file is like 50mb. That's fine.

I would additionally like to recommend the program WinAmp and the plugin in_cube that allows you to test your HPS files without having to inject them into the game. It can help sometimes :p
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Okie.
Amplifying and Normalizing. These are two things you'll get a feel for if you've ever messed with audio files.
It's pretty simple, so...

LETS GO:
Pick out the audio file you want to use. Anything will do.
Download Audacity if you don't have it already: http://web.audacityteam.org/

Once you've got both of those, install and open Audacity and drag and drop your music file into the program. It can be a variety of formats, WAV, MP3, FLAC, it doesn't matter as long as Audacity can open it. Some audio files are way to loud to be used in Melee. If these audio files are to loud, they can make the music sound trashy and have static blips, along with drowning out the sfx. You can fix these problems by normalizing your audio files/amplifying them so they are at the right volume in the game at all times.


NORMALIZING AUDIO (do this first):
First off, all normalizing does is set the correct DC offset (Usually setting it to 0.0 is fine. Removing it defaults to this in Audacity. The maximum amplitude should be -1.) and adjust multiple audio channels to the same peak level, removing any level disparity between them. This is good because it makes quieter parts in a file louder, and louder parts quieter. That way songs don't suddenly 'boom' on you.

Highlight the wavelength of your entire audio file. The entire thing.
Go to the 'effect' tab.
Click on 'normalize'. It's about halfway down the list.
Make sure the first two check boxes are checked. The last one doesn't have to be checked.
You're done normalizing your audio. :3


AMPLIFYING AUDIO (do this second):
Amplifying audio allows you to change the level of one or more tracks or channels by the same amount, preserving the balance between them. You can amplify up or down depending on your track's wavelength. DO NOT LET THE AUDIO CLIP. MAKE SURE ALLOW CLIPPING IS NOT CHECKED. Make sure none of the peaks of the audio cross the top or bottom of the spectrum.

Highlight the wavelength of your entire audio file. Again, the entire thing.
Go to the 'effect' tab.
Click on 'amplify'. You can't miss it.
Make sure the 'allow clipping' box is unchecked.
Adjust the amplification slider slightly left or right depending on how loud your audio needs to be (left = softer, right = louder). This is something you'll need to get a feel for. You don't want the audio to be to loud or to quiet ingame. Here's around what your audio's wavelength should look like:

(Don't make it too loud or too quiet!)
After you're all done fixing your audio file, your audio is... almost ready to go! Follow the steps listed in the main post for more stuff.


OTHER STUFF:
When you export your audio, don't be alarmed if your WAV file is like 50mb. That's fine.

I would additionally like to recommend the program WinAmp and the plugin in_cube that allows you to test your HPS files without having to inject them into the game. It can help sometimes :p
Wow. This is way more than I was expecting. Very nice and in-depth, Myougi. Thanks a lot! I added a "step" to check out this comment in the guide.

EDIT: And that song made me lol hard.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Where do I put the Output.hps file on my melee iso????
Don’t mind the hexadecimal offset values I have listed with each file.


Code:
DOL (RAM)


All-Star Heal - 1p_qk.hps - 003b8ddc (003bbddc)

Fire Emblem - akaneia.hps - 003b8de8 (003bbde8)

Balloon Fighter - baloon.hps - 003b8df4 (003bbdf4)

Big Blue - bigblue.hps - 003b8e00 (003bbe00)

Princess Peachs Castle - castle.hps - 003b8e0c (003bbe0c)

Corneria - corneria.hps - 003b8e28 (003bbe28)

Dr. Mario - docmari.hps - 003b8e38 (003bbe38)

Flat Zone - flatzone.hps - 003b8f70 (003bbf70)

Earthbound - fourside.hps - 003b8f80 (003bbf80)

Kongo Jungle - garden.hps - 003bbfa0 (003b8fa0)

Great Bay - greatbay.hps - 003b8fac (003bbfac)

Green Greens - greens.hps - 003b8fbc (003bbfbc)

Multi-Man Melee (BF Alt)- hyaku.hps - 003b8fe0 (003bbfe0)

Multi-Man Melee 2 (FD Alt) - hyaku2.hps - 003b8fec (003bbfec)

Icicle Mountain - icemt.hps - 003b8ff8 (003bbff8)

Mushroom Kingdom - inis1_01.hps - 003b9004 (003bc004)

Mushroom Kingdom Finale - inis1_02.hps - 003b9014 (003bc014)

Mushroom Kingdom 2 - inis2_01.hps - 003b9024 (003bc024)

Mushroom Kingdom 2 Finale - inis2_02.hps - 003b9034 (003bc034)

Fountain of Dreams - izumi.hps - 003b907c (003bc07c)

Jungle Japes - kongo.hps - 003b9088 (003bc088)

Brinstar Depths - kraid.hps - 003b9094 (003bc094)

Menu 1 - menu01.hps - 003b90a0 (003bc0a0)

Trophy - menu02.hps - 003b90ac (003bc0ac)

Menu 2 - menu3.hps - 003b90b8 (003bc0b8)

Mach Rider - mrider.hps - 003b90c4 (003bc0c4)

Mute City - mutecity.hps - 003b90d0 (003bc0d0)

Kongo Jungle 64 - old_dk.hps - 003b90e0 (003bc0e0)

Dream Land 64 - old_kb.hps - 003b90ec (003bc0ec)

Yoshi's Island 64 - old_ys.hps - 003b90f8 (003bc0f8)

Mother - onetto.hps - 003b9104 (003bc104)

Mother 2 - onetto2.hps - 003b9110 (003bc110)

Pokemon Battle Theme - pokesta.hps - 003b9128 (003bc128)

Pokemon Stadium - pstadium.hps - 003b9134 (003bc134)

Poke Floats - pura.hps - 003b9144 (003bc144)

Rainbow Cruise - rcruise.hps - 003b9150 (003bc150)

Saria's Song - saria.hps - 003b91b8 (003bc1b8)

Hyrule Temple - shrine.hps - 003b91c4 (003bc1c4)

Super Mario Bros. 3 - smari3.hps - 003b91dc (003bc1dc)

Final Destination - sp_end.hps - 003b91e8 (003bc1e8)

Final Destination (Giga Bowser) - sp_giga.hps - 003b91f4 (003bc1f4)

Metal Battle - sp_metal.hps - 003b9200 (003bc200)

Battlefield - sp_zako.hps - 003b9210 (003bc210)

Targets - target.hps - 003b922c (003bc22c)

Venom - venom.hps - 003b9238 (003bc238)

Yoshis Island - yorster.hps - 003b92e4 (003bc2e4)

Yoshis Story - ystory.hps - 003b92f0 (003bc2f0)

Brinstar - zebes.hps - 003b92fc (003bc2fc)


15 Minute Song - swm_15min.hps - 003b921c (003bc21c)
Rebuild your ISO with GCR after replacing files.
 

hotdogturtle

Smash Master
Joined
Feb 15, 2007
Messages
3,503
(Includes BRSTM File Conversion Guide!)

Oh wow, is this finally happening? (Semi)automatic conversion and easier HPS creation? And no more stupid guides telling you to adjust the tempo of the song to fit the loop points? And no more manual hexing to set the start loop and end loop and all that other stuff?

Will test this tomorrow. I skimmed the guide and it seems reasonable. So if you just follow all the math (and use a perfect loop from a BRSTM), this thing takes care of both loop points in the file and makes a flawless sounding loop in the HPS?
 
D

Deleted member 269706

Guest
(Includes BRSTM File Conversion Guide!)

Oh wow, is this finally happening? (Semi)automatic conversion and easier HPS creation? And no more stupid guides telling you to adjust the tempo of the song to fit the loop points? And no more manual hexing to set the start loop and end loop and all that other stuff?

Will test this tomorrow. I skimmed the guide and it seems reasonable. So if you just follow all the math (and use a perfect loop from a BRSTM), this thing takes care of both loop points in the file and makes a flawless sounding loop in the HPS?
Yeah this is extremely easy to follow and the results are always spot on. Achilles included an excel file which does the math for you, which is super helpful. If you don't have excel I'd be happy to send you the mathematical functions which will aid you in creating the files.

Though you should also know that brawlcustommusic.com has the option for you to download HPS files directly from the site, which is even easier than converting the files yourself. I haven't done a lot of testing but everything on the site seems to work perfectly thus far. I would still recommend working with this guide though, it teaches you a lot about the sound design and process for creating music.
 

hotdogturtle

Smash Master
Joined
Feb 15, 2007
Messages
3,503
Yeah I noticed the BCM update while reading the other music thread last night as well. Insane, this is what we've always wanted. I'll keep this guide in mind in case I ever need it for any reason, but I think if I find a song I want that's not on BCM, I'll make it a BRSTM first (since I already know how to do that), upload it there, and then download the HPS conversion. That way it's available for both the Melee and Brawl communities.

Edit: I think this method will also be good for BRSTMs that you download that are on the loud side. You can export the wav, lower the volume, and rebuild it as a HPS (and while you're at it you can change the sample rate to reduce the file size).
 
Last edited:

hotdogturtle

Smash Master
Joined
Feb 15, 2007
Messages
3,503
Ok, I had a question two weeks ago but I didn't want it to get lost in my edits if I didn't bump the thread, so I ended up forgetting to post it until now.

After my previous post, I followed the guide and made a song. The guide was simple to follow and the song came out perfectly. I added it to my ISO and put it on my main menu, along with a few songs from BrawlCustomMusic on a couple stages. I tested them all out ingame and in the sound test to check for volume and loop points, and they were all perfect, so it was definitely a success.

However, there was a weird thing with my custom song. Sometimes, when returning to the main menu from another screen , it would play maybe half a second of the song and then go silent. The game still worked and the menu sound effects still played, just with no BGM. I would have to go to another screen that played different music and return to the menu to make the song start again. I want to say that this happened maybe... 10-20% of the time? When this didn't happen, the song worked totally fine, including looping.

This was the only song that I changed on the main menu, and also the only one that wasn't downloaded from BCM, so I don't know the exact cause of it. Is this an issue that you've encountered before, possibly something that's caused by this conversion process? I didn't want to post a download in the music compendium either if the problem was in the file itself.
 

Le Golden Magikarp

Smash Rookie
Joined
Jul 3, 2015
Messages
9
Location
Colorado
MeleeHPS is an amazing little program created a few years back by GenesisFan64. See the original post here. It gives the ability to create completely custom HPS music files. No one really used it in the past and GenesisFan64's instruction were also a little vague on how to use the program. I fiddled around with it a whole bunch and managed to learn how to use MeleeHPS to create normal and custom looped HPS files.

Requirements:
1) Files from this download.
  • Includes everything needed to run MeleeHPS and an Excel document, titled "HPS Helper", created by me to assist in using the program.
2) Any ol' hex editor. I use Hex Editor Neo.
2) Audacity
3) BrawlBox v0.70 if you plan on converting a BRSTM into an HPS file.
4) A sound file that is open in Audacity in which you already know the desired loop point timing (in samples or seconds, out to three decimal places). This loop point is *from the end of the file* to the loop location.
  • If converting from a BRSTM, BrawlBox can get you this, which is covered in the guide below.

DISCLAIMER
This guide does NOT go over how to find good loop points for a song. That is a task for yourself before you start with this. This guide covers how to take your finished/edited music in Audacity and output it into an HPS file.



Definitions:
Normal Loop
- Loop from the end of the song back to the very beginning.

Custom Loop
- Loop from the end of the song back to a location that is not the beginning.



Guide:
NOTE: At first glance this seems like a lot of steps, but its really not complicated at all and very easy to memorize. Once you've done a couple songs and have the flow down of how to do everything, you can convert a BRSTM to HPS in 5-10 mins easily.

[COLLAPSE="BRSTM (Brawl) to HPS (Melee) conversion - Initial Steps"]
Note: brawlcustommusic.com has TONS of video game music already in BRSTM format. Check there before trying to modify a file to create loop points yourself, because the hard work might already be done for you.

1) Open the BRSTM file in BrawlBox.
2) Listen to the song and make sure it sounds good and that the loop point sounds right.
- If the loop point sucks, then redo it yourself. Don't settle for crap.

If the song and loop is acceptable,

3) At the top, hit "Edit" --> "Export", and make sure your "Save as type" is the .wav.
4) Open that file up in Audacity. We will get back to it in a bit.

Now we need to get loop point info about the BRSTM file.

5) In BrawlBox, copy the SampleRate, LoopStartSample, and NumSamples and put them in the "BRSTM Conversion Calc" section of the HPS Helper file. This will give you the loop point in seconds for the file you exported.
- NumSamples (total length of the song) isn't necessary, but I like to add it anyway.

View attachment 49723

Now you've got all the information you need to continue with the rest of this guide.
[/COLLAPSE]

-----------------------------------------------------------------------

With your music file open in Audacity...(start here if you are not converting a BRSTM)
NOTE: At this point, please read the comment on this thread from @ Myougi Myougi about normalizing and amplifying music in Audacity so that the sound levels come out nicely in-game. Do this if you want your HPS files to be top notch.

Choose loop type:
[COLLAPSE="Normal Loops"]
No intermediate steps required. Jump to the "Final Audacity Steps" section.
[/COLLAPSE]
[COLLAPSE="Custom Loops"]
So you have a .wav file with a specific loop point that does not occur at the very beginning. Before you continue, you need to know the exact millisecond that this loop point occurs on.

Goal: Find the block # for the HPS to loop on.
In HPS Helper, there is a table on the left that lists block numbers to loop on and their associated (total) time values. Pick the block # that lines up with your loop point and place it in the green highlighted "block # to loop on" cell.

If your loop point does not exactly line up with one of the blocks (highly likely), you need to modify the .wav file in one of two ways.

Example:

My loop point: 9.700 seconds


Block # 22: 9.406 s
Block # 23: 9.854 s
(closest blocks to my desired loop point from the HPS Helper spreadsheet)

Dang...my desired loop point doesn't line up exactly with a block...


1)
First and foremost, always check the beginning of the sound file. If there is silence before the audio starts, see if you can just remove some silence to shift the loop point [down in time] onto a block.

9.700 - 9.406 = 0.294 seconds.

If there is at least 0.294 seconds of silence at the beginning, then delete it. Now your loop point sits directly on block 22, so input 22 into the "Block # to loop on" cell.

If the above step does not apply and there is no silence at the beginning of the sound file, or the beginning is important and we want to hear every bit of it:

2)
This time, we need to just add in a little bit of silence before the song begins. So we need to move the loop point UP to the next closest block.

9.854 - 9.700 = 0.154 seconds.

So add in 0.154 seconds of silence to the beginning of the file. And remember, this is ADDING, not OVERWRITING. Now you would input 23 as the "block # to loop on" in the spreadsheet.

[COLLAPSE="How I add silence with Audacity"]
1) Ctrl+A, to highlight the entire song. Ctrl+C, Copy it. Keep everything highlighted.
2) In the "Selection Start" box at the bottom, change it to the total time of silence you want to add.
3) Using the above example values, I would now have 0.154 to song end highlighted. Delete it.
4) Ctrl+A to highlight the small bit of song you have left. Go to "Edit", "Remove Special", and then click on "Silence Audio".
5) Click at the end of this little bit of silence song to place your cursor there and then CTRL+V to paste (the entire original song).
[/COLLAPSE]

Now that the loop point perfectly lines up with an HPS block, proceed to "Final Audacity Steps".
[/COLLAPSE]

[COLLAPSE="Final Audacity Steps"]
1) In the bottom left, there is a box for "Project Rate (Hz)". Make this value 32000 (Melee default). I guess you could make it higher quality, but your file size will also grow. I've personally never done anything but 32000.

2) Click the black menu arrow on the left side of the working window for your music file. Highlight "Set Sample Format" then click "16-bit PCM".
3) Go back to that same drop down menu and select "Split Stereo to Mono".
- you basically now have two separate sound files within Audacity.

View attachment 49725

4) Double click the top sound file to highlight the entire thing.
5) Go to "File" --> "Export Select Audio". Name it "LEFT" and put it in your arbitrary, designated folder for this song conversion.

6) Double click the bottom sound file to highlight the entire thing.
7) Go to "File" --> "Export Select Audio". Name it "RIGHT" and put it in your arbitrary, designated folder for this song conversion.

8) Now go to your project folder and copy LEFT.wav and RIGHT.wav that you just created.

9) In the "MeleeHPS" folder from the downloaded files, navigate into the "dsp" folder and paste both .wav files there.

Now continue to the "MeleeHPS - Outputting the HPS File" section.

[/COLLAPSE]

-----------------------------------------------------------------------

[COLLAPSE="MeleeHPS - Outputting the HPS file"]
1) In the "dsp" folder, open the file titled "run.bat" and a command line window will open. Wait until it says "Press any button to exit" for it to finish doing it's thing.

It created some other files in this folder titled LEFT and RIGHT.

2) Open LEFT.dsp in your hex editor. Go to the end of the file and pad it with zeroes. I just add in one full line of zeroes to be safe. Save. Close.

3) Open RIGHT.dsp in your hex editor. Go to the end of the file and pad it with zeroes. I just add in one full line of zeroes to be safe. Save. Close.

These two steps are the only thing you need the hex editor for.

View attachment 49726



4) Open LEFT.txt or RIGHT.txt. Doesn't matter which one. One of the lines at the top gives the length of the file in samples. Copy this value.

5) In HPS Helper, paste this value in the "NumSamples" cell at the top, in the "Final Song Info for MeleeHPS" area.
- This will adjust the "Blocks Needed" cell.

Now we're done with the "dsp" folder. Go back to root MeleeHPS folder (with the number of samples still copied to your clipboard).

6) Open up the "main.asm" file in Notepad. This is your configuration file that sets the guidelines for how to create the HPS file.

- I included a main.asm that should be used for normal loop points, and another that should be used for custom loop points.
- Use whichever is appropriate. Just duplicate the file and then rename it to main.asm.


With main.asm open,

7) Paste your song length in samples that I told you to copy from LEFT.txt on the "Samples" line.
8) Copy the "Blocks Needed" from HPS Helper and paste it as the value to use for "Blocks".



IF YOUR ARE DOING A NORMAL LOOP, JUST SAVE AND EXIT OUT OF MAIN.ASM AT THIS POINT AND GO DOWN TO STEP 11.


Custom Loops:
Go to the bottom of main.asm.

In HPS Helper, you should have already set your "Block # to loop on" earlier. This value and the "NumSamples" that you already pasted in Step 5 will set the "BlockStart" and "BlockLoop" output cells accordingly.


9) Paste these two values into their respective locations at the end of the main.asm file.



10) Save main.asm and close the file.


The Finale!!!

11) In the "MeleeHPS" folder, run the file "build.bat". A command prompt window will open and it will be building your HPS file. Wait for it to say "Press any button to exit".

12) output.hps is your new Melee music file.

13) Test your file and then share it in
The Complete Music (and Sound) Compendium

[/COLLAPSE]

-----------------------------------------------------------------------
Troubleshooting
[COLLAPSE="Troubleshooting"]
I have experienced a few cases where following the above steps exactly resulted in the HPS file not looping correctly and freezing the game.

MeleeHPS automatically adjusts the size of the last song data block to perform the loop back at the right moment. If this block gets too small, then the game will freeze. (I'm not exactly sure on the limitations of block sizes, etc.)

Before reading further though, DOUBLE CHECK, that every one of the above steps was completed. Especially padding the LEFT.dsp and RIGHT.dsp files with zeroes, because not doing so will certainly make your HPS file freeze the game when it tries to loop.

Only do the next steps if you are 100% sure that you've done the above steps correctly.

For Custom Loops:
1) Open the main.asm file you are using and scroll to the bottom.


2) Divide the BlockLoop number by 4 and round down to the nearest integer.

3) Change the BlockData (only for the BlockLoop section) from 0x2000 to 0x8000.

Example:

From this
Code:
BlockStart:
        rept 19
        BlockData 0x2000,0
        endr
BlockLoop:
        rept 67
        BlockData 0x2000,0
        endr

        BlockData 0x2000,BlockLoop
        even
To this
Code:
BlockStart:
        rept 19
        BlockData 0x2000,0
        endr
BlockLoop:
        rept 16
        BlockData 0x8000,0
        endr

        BlockData 0x8000,BlockLoop
        even
Save. Then rerun build.dat.
Make sure to change those BlockData sizes back to 0x2000 before making your next HPS.[/COLLAPSE]
i'm actually having a problem where i'm trying to use the chillin dis rap and it cuts off about half way though, is there a way to fix this
 

Dandy_here

Smash Journeyman
Joined
Oct 8, 2014
Messages
332
Location
Cheektowaga NY
Yeah this is extremely easy to follow and the results are always spot on. Achilles included an excel file which does the math for you, which is super helpful. If you don't have excel I'd be happy to send you the mathematical functions which will aid you in creating the files.

Though you should also know that brawlcustommusic.com has the option for you to download HPS files directly from the site, which is even easier than converting the files yourself. I haven't done a lot of testing but everything on the site seems to work perfectly thus far. I would still recommend working with this guide though, it teaches you a lot about the sound design and process for creating music.
I need those mathematical functions
 

felipe_9595

Smash Lord
Joined
Apr 9, 2010
Messages
1,431
Location
Chile
Hey achilles!! I have a couple of questions.

I was writing a Python tool to automatically edit the .txt files and add/remove silence from the .wav file, my question is, since this guide doesnt use EndLoop points, i assume that one uses the NumSamples (The end of the song) to loop??? We would need to cut out the end of the song??

Thanks!!
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Hey achilles!! I have a couple of questions.

I was writing a Python tool to automatically edit the .txt files and add/remove silence from the .wav file, my question is, since this guide doesnt use EndLoop points, i assume that one uses the NumSamples (The end of the song) to loop??? We would need to cut out the end of the song??

Thanks!!
Yes, the end of the song is when it loops. The beauty of using MeleeHPS is that it automatically adjusts the size of your last block to fit the remaining length of the song. That means all you need to do is chop the beginning of the song or add a bit of silence to move your custom loop point directly onto the start time of a block.

So the end of the WAV is just where you want the song to "end" and start looping. I'm not sure if you could have a longer WAV that what you specify with the NumSamples. My guess is probably but I've never tried and I didn't write the program so I couldn't tell you for sure. But I guess someone could open a full WAV in your program and then they specify the end and you chop it for them.
 
Last edited:

felipe_9595

Smash Lord
Joined
Apr 9, 2010
Messages
1,431
Location
Chile
Okay, thanks, but i am having little of problem using a different sample rate. I tried with a 44100Hz song and it loops wrongly, from the beginning and failing to reach the end.

EDIT: okay it seems like chaging the sample rate doesn't do anything in the main.asm, both times i ended with files with the same size despite the fact that one was using 32Khz and the other 44.1Khz files. If i am not wrong that has to do with the block size right? What would be the block size for 44.1Khz files

I might be a quality ***** but using 32Khz wavs hurts my hears badly (For example, it really killed one of the remixes i made). Thanks for the help!

@ Achilles1515 Achilles1515 This is what i am making into an Hps. If you check the Jps and the video, you will notice inmediately the sound difference.

 
Last edited:

Colten

Smash Cadet
Joined
Jan 21, 2007
Messages
72
Location
Canada
I followed all the steps but my song repeats at around 40 seconds. I have songs that are about 2 1/2 minutes to as big as almost 8 minutes. Is it possible for these full songs to be played all the way through and then looped? Do I need to follow the custom loop steps to go past 40 seconds? I used normal loop
 
Last edited:

Treefish

Smash Rookie
Joined
Feb 1, 2015
Messages
1
First post on smashboards! Seems appropriate that it's because I'm stumped.

I'm having a problem where is seems to be trying to play two songs at once, only on certain stages. You can hear bits of music but it is mostly just loud static.

This only occurs on the Wii, and only in-game; Dolphin runs fine. I am clueless as to what could be doing this...
 

Gehis514

Smash Apprentice
Joined
Jul 25, 2015
Messages
119
Switch FC
SW 4004 9260 8249
So I've been using this method lately and it really works quite well, but I've come across a situation where the block # to loop on for the brstm file is higher than what the excel document provides (my song loops at 118.654 seconds, the document only goes up to 85.099). Is there any way of figuring out the block number if possible?
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
So I've been using this method lately and it really works quite well, but I've come across a situation where the block # to loop on for the brstm file is higher than what the excel document provides (my song loops at 118.654 seconds, the document only goes up to 85.099). Is there any way of figuring out the block number if possible?
Code:
264 = offset:0041e160  length:00002000  secs:0.448  total secs:117.795
265 = offset:00422180  length:00002000  secs:0.448  total secs:118.243
266 = offset:004261a0  length:00002000  secs:0.448  total secs:118.691
 

Gehis514

Smash Apprentice
Joined
Jul 25, 2015
Messages
119
Switch FC
SW 4004 9260 8249
Hey, thanks for that! How would i be able to find those numbers on my own?
 

GenesisFan64

Smash Rookie
Joined
Dec 7, 2013
Messages
3
Hey guys its me again...

So now i got the oportunity to port my code to Python (yay, linux... except that you still need the encoder)
http://1drv.ms/1Jd5pa1 <-- put dspadpcm.exe and its dlls at /dsp/tools

this time it automaticly checks the sample rate, number of blocks and adds padding at the end of the data (normal loops only, if you wanted to do custom loops you will need to modify the script)

how-to use it:
- Place your LEFT.wav and RIGHT.wav files at /dsp/, convert them to LEFT.dsp and RIGHT.dsp respectively
- On command line: python MakeHps.py
- Done.
 

VVB

SD Champ
Joined
Nov 30, 2006
Messages
136
Location
Lafayette, Louisiana
Has anyone been able to nail down the issue where the .hps file has popping/cracking in the audio? Everything is perfect other than that issue.
 

Myougi

My posts are gluten free.
Joined
Mar 14, 2014
Messages
484
Location
WEST COAST BEST COAST
Has anyone been able to nail down the issue where the .hps file has popping/cracking in the audio? Everything is perfect other than that issue.
I believe those popping sounds come from when the audio is too loud (when it clips in audacity) or if there's excess zeros at the end of the file. I know the guide says to add a line of extra zeros for safety, but I actually think that might also contribute to the popping. I made a few HPS files recently without adding ANY zeros and I stopped having problems with it.
 

JNuts

Smash Cadet
Joined
Oct 5, 2011
Messages
27
I followed all the steps but my song repeats at around 40 seconds. I have songs that are about 2 1/2 minutes to as big as almost 8 minutes. Is it possible for these full songs to be played all the way through and then looped? Do I need to follow the custom loop steps to go past 40 seconds? I used normal loop
Was this issue ever resolved? I'm having the exact same problem with non-custom loop songs looping at about 40 seconds. Is there something I need to do at the audacity stage to get it to loop?
 

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
Was this issue ever resolved? I'm having the exact same problem with non-custom loop songs looping at about 40 seconds. Is there something I need to do at the audacity stage to get it to loop?
I dont really know much about this method, but achilles might be able to fix your issue. Worst case scenario you just use the old method with hps insert.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Was this issue ever resolved? I'm having the exact same problem with non-custom loop songs looping at about 40 seconds. Is there something I need to do at the audacity stage to get it to loop?
No, you don't need to do anything specifically in audacity to make it loop. That is 100% controlled by the main.asm file. Are you trying to do a custom loop or normal loop? Are you sure you are using the main.asm file specific to each loop type? For whichever one you are using, is the actual file titled "main.asm", in the MeleeHPS folder, the one you modified?
 

zankyou

Smash Lord
Joined
Sep 12, 2014
Messages
1,055
No, you don't need to do anything specifically in audacity to make it loop. That is 100% controlled by the main.asm file. Are you trying to do a custom loop or normal loop? Are you sure you are using the main.asm file specific to each loop type? For whichever one you are using, is the actual file titled "main.asm", in the MeleeHPS folder, the one you modified?
achilles do you know if meleehps also creates block lengths for the appropriate starting loop point. Right now Im creating my own hps file.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
achilles do you know if meleehps also creates block lengths for the appropriate starting loop point. Right now Im creating my own hps file.
You tell it:

My song is X samples long at V kHz.
I want my block size to be Y.
I want it to loop back to block Z.

Then you run the .bat and it creates the HPS file from scratch.

But you can also customize it to be something like "blocks 1-13 have a size of 0x2000 and blocks 14-89 have a size of 0x8000".

I highly suggest you use it. It's the best custom HPS program that exists.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Just looked at the main post... I don't get why they didn't run a script on the entire site to convert COLLAPSE boxes to SPOILER boxes once they removed the collapse functionality.
 

JNuts

Smash Cadet
Joined
Oct 5, 2011
Messages
27
No, you don't need to do anything specifically in audacity to make it loop. That is 100% controlled by the main.asm file. Are you trying to do a custom loop or normal loop? Are you sure you are using the main.asm file specific to each loop type? For whichever one you are using, is the actual file titled "main.asm", in the MeleeHPS folder, the one you modified?
Hey man thanks so much for the quick reply. I was just using the regular main.asm file, but I was supposed to use the custom normal loop one and rename it to main.asm. That fixed the 40 second loop issue, however I'm now encountering the same problem I had when I used the old HPSAuto method, where the song would make the game freeze (with the sound buzzing like it usually does when it freezes) after a certain time. This time would be different depending on which stage I put the song on, for example it would freeze after about a minute on Corneria, but after about 2 minutes on Big Blue. Given that both HPS programs ended with the same result, could it be a problem with the initial .wav file?
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Hey man thanks so much for the quick reply. I was just using the regular main.asm file, but I was supposed to use the custom normal loop one and rename it to main.asm. That fixed the 40 second loop issue, however I'm now encountering the same problem I had when I used the old HPSAuto method, where the song would make the game freeze (with the sound buzzing like it usually does when it freezes) after a certain time. This time would be different depending on which stage I put the song on, for example it would freeze after about a minute on Corneria, but after about 2 minutes on Big Blue. Given that both HPS programs ended with the same result, could it be a problem with the initial .wav file?
Did you add 0's to the end of the left and right DSP files?
 

JNuts

Smash Cadet
Joined
Oct 5, 2011
Messages
27
So I tried those steps and the issue wasn't resolved. I also tried using one of the .hps files from the game itself onto another stage, eg by replacing sp_end.hps with a duplicate of bigblue.hps and renaming it sp_end.hps, but I still encountered the same problem, so I'm quite sure now it's not a problem with the song creation, but something else entirely. I also tried using another usb so it's not that. Don't know what else it could be, but thanks for taking the time to help me out.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
So I tried those steps and the issue wasn't resolved. I also tried using one of the .hps files from the game itself onto another stage, eg by replacing sp_end.hps with a duplicate of bigblue.hps and renaming it sp_end.hps, but I still encountered the same problem, so I'm quite sure now it's not a problem with the song creation, but something else entirely. I also tried using another usb so it's not that. Don't know what else it could be, but thanks for taking the time to help me out.
How are you putting them into your ISO? You should be rebuilding it with GCR.
 

JNuts

Smash Cadet
Joined
Oct 5, 2011
Messages
27
How are you putting them into your ISO? You should be rebuilding it with GCR.
I'm using 20XX, so I can't rebuild it with GCR because it uses the sys folder instead of the &&systemdata folder.
Is this not supposed to work for 20XX?
 
Top Bottom