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