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

Creating custom .hps files

ShockSlayer

Smash Cadet
Joined
Feb 19, 2011
Messages
58
http://forums.sonicretro.org/index.php?showtopic=30302

Anyone seen this?

I managed to actually get some working .hps files, what's interesting to me though is that you can change the block size, meaning easier loop points. I haven't exactly figured everything out but I played around with it a bit and got some interesting results.

It'd be awesome if we could find a way to straight up tell it what loop points to use and it automatically adjusts the block sizes, that seems to be how the official .hps files are done.

SS
 

ShockSlayer

Smash Cadet
Joined
Feb 19, 2011
Messages
58
Using that guide, you use hps_insert to put your music into preexisting .hps files. The problem with doing that it you have to use loop points based on how that .hps already has it's blocks broken down:

From garden.hps:
offset:000b01e0 length:00008000 secs:1.792 total secs:19.707
offset:000c0200 length:00008000 secs:1.792 total secs:21.499
offset:000d0220 length:00008000 secs:1.792 total secs:23.290
offset:000e0240 length:00007f00 secs:1.778 total secs:25.082
offset:000f0060 length:00007f00 secs:1.778 total secs:26.859
offset:000ffe80 length:00007f00 secs:1.778 total secs:28.637
offset:0010fca0 length:00007f00 secs:1.778 total secs:30.415

Let's say my audio needs to loop from the end exactly at 29.243 seconds going back to 20.346 seconds, I'd only have:
offset:000ffe80 length:00007f00 secs:1.778 total secs:28.637
offset:0010fca0 length:00007f00 secs:1.778 total secs:30.415
to choose from for the ending.

While I can easily add an exact amount of silence at the beginning of the song to match up the starting loop point with an offset, I'd have to stretch the audio to get the ending offset, and that can become noticeable if you aren't lucky and the points don't line up.

The way the official nintendo .hps's accomplish looping is they break everything into blocks, each block being about 1.792 seconds and pointing to the next block, whilst the last block points to an earlier block so it loops. As the song nears it's end the blocks become smaller, so the loop points line up perfectly with the audio.

You can see this above, offset 000d0220 has a length of 00008000 when the next block at offset 000e0240 only has a length of 00007f00.

What makes this program interesting is it can create the .hps files from scratch from the .dsp's, you don't use the preexisting ones and you set your own block size and block amount. I don't quite know all the in's and out's of the program, but so far I've been able to get working .hps files from it, with block size down to 00002000:

So, making one from scratch I now have this:
offset:000b0600 length:00002000 secs:0.448 total secs:19.707
offset:000b4620 length:00002000 secs:0.448 total secs:20.155
offset:000b8640 length:00002000 secs:0.448 total secs:20.603
offset:000bc660 length:00002000 secs:0.448 total secs:21.051
offset:000c0680 length:00002000 secs:0.448 total secs:21.499
offset:000c46a0 length:00002000 secs:0.448 total secs:21.947
offset:000c86c0 length:00002000 secs:0.448 total secs:22.395
offset:000cc6e0 length:00002000 secs:0.448 total secs:22.842
offset:000d0700 length:00002000 secs:0.448 total secs:23.290
offset:000d4720 length:00002000 secs:0.448 total secs:23.738
offset:000d8740 length:00002000 secs:0.448 total secs:24.186
offset:000dc760 length:00002000 secs:0.448 total secs:24.634
offset:000e0780 length:00002000 secs:0.448 total secs:25.082
offset:000e47a0 length:00002000 secs:0.448 total secs:25.530
offset:000e87c0 length:00002000 secs:0.448 total secs:25.978
offset:000ec7e0 length:00002000 secs:0.448 total secs:26.426
offset:000f0800 length:00002000 secs:0.448 total secs:26.873
offset:000f4820 length:00002000 secs:0.448 total secs:27.321
offset:000f8840 length:00002000 secs:0.448 total secs:27.769
offset:000fc860 length:00002000 secs:0.448 total secs:28.217
offset:00100880 length:00002000 secs:0.448 total secs:28.665
offset:001048a0 length:00002000 secs:0.448 total secs:29.113
offset:001088c0 length:00002000 secs:0.448 total secs:29.561
offset:0010c8e0 length:00002000 secs:0.448 total secs:30.009
offset:00110900 length:00002000 secs:0.448 total secs:30.457

Same time frame, except now instead of 7 possible loop points I now have 25. Pretty neat, right?

Normally I follow GSUB's guide for making .hps files, and upon investigation I've found that the "samples to read" values seem to do nothing(I've tried changing the values to all FF or 00's and nothing changes,) so it's all basically been up to the offsets. I'm pretty sure the samples to read bytes are just carried over from the .dsp's and serve no real purpose.

What I'd like to do is find out if I can set, say, the first 10 blocks to be 2000 and then the next 10 to be 1000, etc.

SS
 

ShockSlayer

Smash Cadet
Joined
Feb 19, 2011
Messages
58
Alright so I experimented a bit more with the block sizes. Melee uses streaming audio, and it streams based on the block size. The smallest block size I've tried is 0500 (in comparison to the normal 8000) and it mostly works.

I say mostly because of the different factors that can attribute to it working or not. The sound was choppy in dolphin, but on my Gamecube(loading from SD card) it ran fine. One time it didn't load and I had no music at all. I'm not sure how well a block size of 0500 would work with a regular disc drive, or on a Wii, but it'd probably be similar to dolphin, or maybe even worse. I ought to break out my Qoob pro and test that sometime.

SS
 

Shade_666

Smash Apprentice
Joined
Oct 24, 2005
Messages
93
Location
Walker, MI
I think I need some help with this... I used this program to make my own hps and it works in game but when the song ends the game freezes I dont know what to do, when i decode the hps I made with vgmstream it sounds fine and seems to loop; just the end to the beginning tho. So I'm not sure whats going wrong here do I still need to hex in some loop points or what? some info would be nice.
 

ShockSlayer

Smash Cadet
Joined
Feb 19, 2011
Messages
58
There's something odd about the way it creates the block for the last second or something. With the songs I've made with it I've just ignored that and set the loop points manually following GSUB's guide. To get the offsets you can run your output.hps through hps_insert, just use whatever .wav's you want and ignore the .dsp's and temp.hps that it spits out.

SS
 
Top Bottom