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

Reusing HPS Files

Steelia

Smash Champion
Joined
Sep 23, 2007
Messages
2,523
Location
Home.
Pardon the late reply... HPS files are very easy to use and replace, but only if you have something called GCRev. With GCRev, it compiles the Melee .GCM from the ground up, so your music files can be almost any size you want (so long as the .GCM doesn't exceed 1.47GB, the original size). I'm sure you've heard of this?

GC-Tool's still good, too, but the new HPS you make cannot be larger than the HPS you're trying to replace... whereas with GCRev, it can be larger than the original that's being replaced.
 

woonkill

Smash Rookie
Joined
Oct 23, 2011
Messages
10
Steelia I think you meant GCR (Gamecube Rebuilder), but yeah, it isn't as quick to use as GC-Tool, but it's necessary to replace files with a larger file. And with it you can recycle stage hps files that have a block structure that fits your needs (i.e. you'd really like a loop point somewhere before 23 seconds on Fountain of Dreams instead of about 23.25 seconds in, but you can use the Venom hps file which has a loop point at 22.975 seconds in). I'm gonna guess that you wanted to duplicate stage music you made for another stage, but GCR is also useful for swapping stage music easily (so you can get that awesome Fire Emblem music on one of your favorite stages)

However, if you were trying to re-use stage files for their block structure, then you can also re-write the length of the final block read in a file (as long as the length is divisible by 0x10) and custom tailor the loop points instead of being restricted to intervals of ~1.7 seconds for a loop point. It takes a bit of technical finesse and intuition to figure it out on your own though
 

Steelia

Smash Champion
Joined
Sep 23, 2007
Messages
2,523
Location
Home.
Steelia I think you meant GCR (Gamecube Rebuilder) . . .

However, if you were trying to re-use stage files for their block structure, then you can also re-write the length of the final block read in a file (as long as the length is divisible by 0x10) and custom tailor the loop points instead of being restricted to intervals of ~1.7 seconds for a loop point. It takes a bit of technical finesse and intuition to figure it out on your own though
Oops you're right, GCRebuilder. V:

As far as adding more blocks to the music file... all I did was take the 15 minute music file for the 15 minute video and erase blocks off of that, and create 7-min or 9-min long looping music files. Saves a bit more time than adding my own blocks, imo. Takes a little bit of math to figure out the new header(s), but that's really about it. :p
 

woonkill

Smash Rookie
Joined
Oct 23, 2011
Messages
10
Oops you're right, GCRebuilder. V:

As far as adding more blocks to the music file... all I did was take the 15 minute music file for the 15 minute video and erase blocks off of that, and create 7-min or 9-min long looping music files. Saves a bit more time than adding my own blocks, imo. Takes a little bit of math to figure out the new header(s), but that's really about it. :p
Yeah, this will work also, you can loop a song 2-3 times and see if you get better loop points a 2nd or 3rd time around (but you won't even need clean loop points, games usually dont last longer than 7 minutes). This way is pretty straightforward, but it also uses up a little more space per file which shouldnt be a problem unless you using a large modded opening video file too. If you do use a 7 minute file, just make sure that the file actually does go back to your loop point in dolphin or on your wii, because if the numbers are off your game might crash. Though I mentioned a game shouldnt last longer than 7 minutes, there is the chance someone will pause your game and then your game freezes 7 minutes in (remember the song plays in the background while paused)
 

iffy525

Smash Apprentice
Joined
Aug 30, 2011
Messages
135
If I am using the 14-minute hps file to create a song like in GSUB's tutorial, is there a way I can trim the file (say if the hps I created is only 3 or 4 minutes)? I noticed that all the files are the exact same size. I'm trying to build my iso from the ground up instead of using the iso suggested in GSUB's tutorial (hssbm.rar).
 

woonkill

Smash Rookie
Joined
Oct 23, 2011
Messages
10
If you have already set your loop point, then all you have to do is go to the offset where you changed the next block to read, go to the end of that block, and delete the rest of the file. So if your loop is after offset 0x007E1040 (meaning your audio has so far played 225.737 seconds), then I would guess you put your loop back offset/location at 0x007E1048. Take the first four bytes in 0x007E1040 (0x00100000), add 0x20 to it (you're accounting for the block length), and add the offset 0x7E1040 itself, which would be 0x7F1060. Remember that all values are in hex. Then go to the sum of the above and delete everything at and after that offset
 

iffy525

Smash Apprentice
Joined
Aug 30, 2011
Messages
135
Thanks for the quick response! Unfortunately I don't really understand hex editing. This is what I have:

What does adding 0x20 mean? Where do I add the offset? (00a0f60f?)
Thanks for the help.
 

woonkill

Smash Rookie
Joined
Oct 23, 2011
Messages
10
Ok, I'll break down the logic for you step by step. What you currently want is to know exactly where to cut data in your hps file to save space. What you currently know are the block header length, block length, and start of the block index you're working with.



Boxed in red is the block header you are currently at. It has exactly 32 bytes in it, which in hex is 0x20. The first 4 bytes in a block header (underlined in green) indicate how long the rest of the block under the header (squigglied in blue) will be. In this case, it's 0x00010000. This value is also given in GodFed's hps_insert code, but it's for the length of one channel of audio I believe, so it's halved (it says "offset:00a01480 length:00008000 secs:1.792 total secs:286.650," length is 0x00008000, multiply that by two and you get 0x00010000). Now that you know exactly how long the block header is, how long the block is, and where the header starts, just get the value of the start of the block (0x00A114A0), add the block header length (0x20) and add the block length (0x00010000). You should get 0xA214C0, so go there and delete everything after that point.

I've also realized that you can just look at the next offset in GodFed's hps insert and cut from there, but I realized that halfway through writing this post so I didn't feel like stopping myself. I think it's good to know how the blocks work anyways, and you can use what I told you above to shorten blocks to a custom value and have perfect loop points without stretching audio. If you or someone else wants to try it, just try adding only one block into your file at first to get the hang of it, and make sure the value between the block length and loop point is exactly one less than the block length (0x100000 - 0x1 = 0xFFFF). Oh and your custom block length will need to be divisible by 0x10)
 
Top Bottom