Achilles1515
Smash Master
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.
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.
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.
-----------------------------------------------------------------------
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 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:
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Troubleshooting
[/SPOILER]
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) 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.
Now you've got all the information you need to continue with the rest of this guide.
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.
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 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.
Now that the loop point perfectly lines up with an HPS block, proceed to "Final Audacity Steps".
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).
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.
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.
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.
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.
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
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.
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
To this
Save. Then rerun build.dat.
Make sure to change those BlockData sizes back to 0x2000 before making your next HPS.
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
Code:
BlockStart:
rept 19
BlockData 0x2000,0
endr
BlockLoop:
rept 16
BlockData 0x8000,0
endr
BlockData 0x8000,BlockLoop
even
Make sure to change those BlockData sizes back to 0x2000 before making your next HPS.
Last edited: