Looping USFs and channel muting (hex editor?) by TheUltimateKoopa at 6:49 PM EDT on April 27, 2012
Is there any way of finding the loop points of a USF? For example, where does it tell the USF to loop a song from a point that is not the beginning, e.g. from 0:06 to 1:12 for example? Can this be found in a hex editor? Either in terms of seconds (e.g. 6), or maybe in terms of the measure and/or beat number, e.g. 3rd beat of the 5th measure or something?
If this can be found in a hex editor, where would I look? If not, where is the loop data held? There must be something that tells the USF to loop from some point. I'm assuming when the tracks were made, they were made with 1 loop, then given some 'instructions' to tell them to loop from a certain point. It's not like they recorded a non-stop rendition of Inside the Castle Walls, otherwise, the game wouldn't be released, since the recording would never end, so they obviously didn't simply make 1 billion year long sequences. There must be some loop information somewhere. Does anyone know where it is exactly?
Also, if I wanted to mute the channels in a USF in a hex editor, is this possible? If so, how do I do it? (Which address do I go to, and which values do I edit)?
USF is like SPC and NSF, not like MIDI. There is not a fixed format that the music sequence is stored in. The player is emulating the general purpose operation of the N64, and it happens to be generating music.
So yes, while there is a sequence somewhere in each USF that you could examine to determine the loop timing, it is not something where I can point you at the hex and say "it's this byte".
The same holds in general for channel muting, unfortunately.
[edit] For that matter it isn't exactly straightforward to determine the loop points of a MIDI, you'd have to run through and simulate it to figure it out.
Darn. Apparently however, it is possible to mute some channels on some games (Banjo Kazooie being an example) with a hex editor, as I found out from someone years ago (about 2005), so I was wondering if you know of any other ones this can be done with?
Also, after using N64MIDITool to extract MIDIs from the ROMs, if a particular tune has different parts that loop differently, e.g. the Menu theme of Smash Bros, or the Oblivion theme from Turok 2, is there any way of finding exactly when these parts loop?
Also on the subject of looping, how does the looping work in SPC Timer or gsfopt? Because sometimes when I use it, and time it for 2 loops, I'll get unusual loops. Most of the time, it's accurate, so for example, it'll time Wildflower Fields from Wario Land 4 to about 4:44 for 2 loops (not counting the fade out), but other times, I'll get really odd times, such as for example, it timed Toxic Landfill at over 12 minutes for 2 loops, and I know for a fact that even 6 minutes is longer than 2 loops, so this is like 3 times longer than it needs to be.
Also, is it possible to get the loop start of a gsf? Like in SPC, it says the length, the intro and the loop (e.g. if it's 50 seconds in length, and there's a 10 second into, it'll say the loop is 40 seconds as you know). Is it possible to get this in a gsf, as well as the total length of a loop?