Previous Page | Next Page
- by Nisto at 9:36 PM EDT on April 28, 2014
- When you say "that loop was 7588", do you mean it had 7588 samples? Or bytes? Or something else?
Either way I think it's just a coincidence. The two variables marked in the picture in the OP are most definitely "connected". Notice how, if the right variable is 0, the left is always 0 as well. We need to figure this out! :)
edited 9:36 PM EDT April 28, 2014
- by Benjamin at 9:39 PM EDT on April 28, 2014
- 7588 samples, I meant. I don't think you're getting what I mean.
If the number of samples in the song is "Total number of RAW samples", then I'm guessing the loop point is both "Loop start offset?" and "Loop end offset?", but it's after the number of RAW samples. Get that into decimal, and you got yourself your loop samples. The loop point is offset (h) 16 and 17 (dunno about 14 and 15) in HxD.
edited 9:42 PM EDT April 28, 2014
- by Nisto at 9:58 PM EDT on April 28, 2014
- It doesn't work that way. A loop start offset cannot be the same as the loop end offset (unless what you actually meant to say is that "loop end offset" could be the last sample, which is possible, but then again what about the other 4-byte value?). The values will be different if there's a loop context. I know you meant that you think the loop values are 2 bytes, and at 0x16, but again, it doesn't make sense, because when the right value is 0, the left will be 0 too. And the right variable IS larger than 0xFFFF for some samples (just look through the sdir file, and you'll find some), so I doubt the values are 2 bytes.
These values are with 99% likeliness 4 bytes. But they don't seem to be standard, start/end offset, nibble-expressed loop values (because, as mentioned, the left value will sometimes be larger than the right, and obviously vice versa..).
edited 10:06 PM EDT April 28, 2014
- by Benjamin at 5:36 AM EDT on April 29, 2014
Since I'm having a hard time explaining, the highlighted part is the loop offset in hexadecimal. Keep your eye on each row. If the sample has 00 00 there, it probably either loops from the beginning, or doesn't loop at all. I don't know if there is a value to allow it to loop, and I think the "number of RAW samples" may be the same value as "Loop end", because for most samples I can't find identical values.
Although the sample I highlighted, I believe, was one of the channels for "The Final Hall" ambience at the room before you fight Grodus.
edited 5:37 AM EDT April 29, 2014
- by Nisto at 2:27 PM EDT on April 29, 2014
- Once again: I know you meant that. But I simply do not think the loop values would be 2 bytes.
Here's something interesting for you...
This is bgm_0a.sdir from Biohazard 0. The structure of the sdir format between Bio0 and PMTTYD is identical.
EDIT: I think I figured it out. They're indeed 4-byte values. Both are expressed in raw samples (unlike the std, which is expressed in nibbles). The left is the start offset, and the right is the length of the loop.
Take the example above the entry that's marked: it has 0x133A5 raw samples. Adding the two values to the right (0x108EF and 0x2AB5) becomes.. 0x133A4!
Now I just need to figure out a proper way to convert raw samples to nibbles.. (samples / 1.75) * 2 kinda works, but it'll be off by one or two nibbles in most cases :/
And anyway, I actually think vgmstream doesn't support looping when the start offset is larger than however many null nibbles there are at the start for some reason (I could be wrong though - I don't know what a lot of the DSP values really are to be honest, like what's coefficients? predictor? scale?), so I'm not sure what to do here..
edited 7:58 PM EDT April 29, 2014
- by MarkGrass at 8:26 PM EDT on April 29, 2014
- Bio Rebirth uses the same format, as well, only the data is stored in the SND archive files.
For reference, the SON, SDIR, etc data is created by Factor 5's MusyX SDK. If you want to reverse-engineer it, I support you 100%... more information could probably be found in the Dolphin/Revolution SDKs.
Oh, and that version of biofat is highly outdated (SVN 6). biofat is now hosted at RHDN.NET
...update coming soon, with support for both Bio0 and Rebirth reimplemented.
- by Nisto at 8:53 PM EDT on April 29, 2014
- Oh, okay. I guess I'm gonna have a look at those SND files on it. Maybe I can modify the script to support those as well. Assuming they're like the sdir files?
Yup, I know SVN6 is old, but it's the last version that supports Bio0 and 4 files, so... Anyway, good to hear you'll reimplement them!
Do you have the MusyX SDK? Where can I find it? (If you wanna go PM, I'm on VGMdb, The Horror Is Alive, FFShrine and some other places)
edited 8:57 PM EDT April 29, 2014
- by MarkGrass at 9:59 PM EDT on April 29, 2014
- Check your PM at THIA.
- by Benjamin at 5:50 PM EDT on May 1, 2014
- OK, one thing:
The loop sample number is two bytes right of the loop start point. Add those two and you get your loop end. You won't always have the same loop end point as the number of samples.
- by Nisto at 11:46 AM EDT on May 16, 2014
- The script has been revamped. It can now extract samples from at least:
Biohazard (Resident Evil)
Biohazard 0 (Resident Evil 0)
Paper Mario: The Thousand-Year Door
Star Fox Adventures
A format must now be specified though - just pass the filepath of the script as an argument to PHP (without additional parameters) for usage instructions.
Loop values are still not added, and the issue with some DSPs not playing remains (not an issue with Bio1 and Bio0 though, all samples play), so feel free to contribute any fixes or ideas if you can!
Get the script here: https://dl.dropboxusercontent.com/u/48454461/misc/MusyXExtract.php
Also, I noticed something new about the sdir format. The bytes between offsets 0x04 and 0x08 (probably two 16-bit values) in the second table seems to be non-zero only when there's a loop context. So perhaps they have to do with one of the possible loop context header values.. ? The 2 bytes before these two values does not appear to be related to looping context. I don't know, maybe someone more experienced with audio formats can give a hint as to what the values may be?
edited 7:28 AM EDT May 17, 2014
Previous Page | Next Page
HCS Forum Index
Go to Page 0 1 2 3 4
Search this thread
Show all threads
Reply to this thread:
Halley's Comet Software