• 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!)

gamerfreak5665

Smash Rookie
Joined
Dec 19, 2014
Messages
11
As of 2016/04/13, the latest version and information about dsp2hps is available at https://github.com/jmlee337/dsp2hps

I heavily reworked MeleeHps to be way more user friendly and produce slightly better results
seriously, it now literally takes 5 seconds to go from audiofile.anyformat to audiofile.hps

Download

changelog v3 (2016/04/13):
  • rewrote the conversion from DSP to HPS in C++
  • since this is sufficiently removed from what MeleeHps was, I'm calling my tool 'dsp2hps'
  • calculates all block header values correctly to remove all pops from the final audio. to my knowledge, this is the only tool to write the correct P/S, hist1, and hist2 values in the HPS block headers
  • I've uploaded my code to github: https://github.com/jmlee337/dsp2hps
changelog v2 (2016/04/01):
  • you can convert files in batch! Just drag them all onto run.bat
  • here's a vid
changelog v1 (2016/03/31):
  • no more opening with audacity and clicking and saving to format the file correctly
  • no more fiddling with hex editors
  • no more copy pasting samples-this and blocks-that
  • drag-and-drop or invoke from the command line
  • more accurate block headers mean fewer/smaller pops during playback
  • parameterized output file names let you do a bunch in a row without overwriting your output
How do I use this?
how to use (video form):
how to use (text form):
  1. move your audio file (in any format) to the MeleeHps folder
  2. drag it onto 'run.bat'
  3. that's it.
  4. you can also invoke from the command line: run.bat myaudiofile.ogg
That's so easy! What's the catch??
  • you still have to make sure your source audio file loops correctly
  • this only works for 'normal' loops, not 'custom' loops
How'd you do it??? (technical details)
  • audacity
    i included ffmpeg, which can convert from any format to 16bit WAV 32000 kHz from the command line

  • hex editors
    i configured main.asm to automatically add the correct padding. I discovered that DSP data must be 32-byte aligned! 16-byte alignment also seemed to work for me, but all the stock HSPs are 32-byte aligned. This must be why achilles sometimes found that adding a pad in a hex editor didn't always work the first time.

  • samples/blocks
    well simply, that data is all calculable from the DSP files themselves. I had to do a horrendous hack to make it work though (the batch file replaces the first line of main.asm, that's why SampleLength is defined there)

  • drag and drop
    since you don't have to edit the DSPs or main.asm before running the assembler, the whole conversion process can be done in one batch script

  • more accurate block headers
    the original main.asm used the first block header in the file for every single block. I made it use the correct block header, but there's two values (hist1 and hist2) that actually require decoding the DSP block to set correctly. This makes any audible pops fewer and smaller, but does not solve the problem completely. I included the most complete documentation I could assemble for the format of HSP audio files in main.asm

  • output file names
    just a small quality of life edit. the output file now has the format [inputfilename].hps, so songname.mp3 would produce songname.mp3.hps as the output. This means you can run a bunch in a row and move out all your hps files once you're done
what are you working on next?
  • rewriting all the main.asm + assembler business in an actual programming language to make the world a little more sane
  • further parameterizing so you'll be able to drag all the files onto run.bat and convert all of them in one go
  • writing hist1 and hist2 in the HSP headers correctly to remove popping all together
  • Adding support for custom loops (loop points at any arbitrary sample, not just block boundaries)
Hey jmlee337, I have a question regarding the output gain of hps files.
I did everything to my custom music in Audacity, including normalizing and amplifying, but the output hps when I put it in the game is still too low compared to the default music. And I amplified it up to 0 dB, so I don't know what's going on.

Is there some kind of preset volume Melee uses for it's stage music that I can adjust individually in the hps files?
 

jmlee337

Smash Journeyman
Joined
May 8, 2008
Messages
303
Slippi.gg
LEE#337
Hey jmlee337, I have a question regarding the output gain of hps files.
I did everything to my custom music in Audacity, including normalizing and amplifying, but the output hps when I put it in the game is still too low compared to the default music. And I amplified it up to 0 dB, so I don't know what's going on.

Is there some kind of preset volume Melee uses for it's stage music that I can adjust individually in the hps files?
your problem is with the 'loudness' of your tracks. This is different from level (up to 0 dB). Most commercial music that you'd put into Melee is already 'mastered' (an audio engineering term), including adjustments to loudness. A major exception to this would be classical music.

If you are using music that isn't already mastered for loudness (like classical) or music that you've recorded yourself, you'll have to adjust the loudness of your tracks to your preferred level (when compared to the stock Melee music). You can Google terms like "mastering loudness", "limiter", "compression" to find resources on how to do this.
 

gamerfreak5665

Smash Rookie
Joined
Dec 19, 2014
Messages
11
your problem is with the 'loudness' of your tracks. This is different from level (up to 0 dB). Most commercial music that you'd put into Melee is already 'mastered' (an audio engineering term), including adjustments to loudness. A major exception to this would be classical music.

If you are using music that isn't already mastered for loudness (like classical) or music that you've recorded yourself, you'll have to adjust the loudness of your tracks to your preferred level (when compared to the stock Melee music). You can Google terms like "mastering loudness", "limiter", "compression" to find resources on how to do this.
Ok, thanks for the info! It's interesting because the music I am using is already from another game. I guess they didn't increase the loudness as much as Melee music.
 

RAT!

Smash Rookie
Joined
Jan 23, 2016
Messages
14
Same. All the audio I turn into hps and put in game is way too quiet. Is there any fix less ambiguous then googling terms for resources?

your problem is with the 'loudness' of your tracks. This is different from level (up to 0 dB). Most commercial music that you'd put into Melee is already 'mastered' (an audio engineering term), including adjustments to loudness. A major exception to this would be classical music.

If you are using music that isn't already mastered for loudness (like classical) or music that you've recorded yourself, you'll have to adjust the loudness of your tracks to your preferred level (when compared to the stock Melee music). You can Google terms like "mastering loudness", "limiter", "compression" to find resources on how to do this.
If a track is already mastered, can you still raise the volume level to put it in-game? I'm using audacity and yeah, I have the same problem as the last guy.
 
Last edited by a moderator:

jmlee337

Smash Journeyman
Joined
May 8, 2008
Messages
303
Slippi.gg
LEE#337
Same. All the audio I turn into hps and put in game is way too quiet. Is there any fix less ambiguous then googling terms for resources?
isn't that what all fixes are though? ;) jk

If a track is already mastered, can you still raise the volume level to put it in-game? I'm using audacity and yeah, I have the same problem as the last guy.
you can do this too and I don't know why I didn't mention it my original post. It's called 'normalization'. If you're using Audacity, it's built in! Effects -> Normalize
 

NinTOONdo

Smash Rookie
Joined
Apr 9, 2017
Messages
20
Thanks for the guide! I don't agree that it's so simple (it actually took me a whole day to fully resolve it), but hopefully it's just about set & done for me.
 
Last edited:
Top Bottom