VGMTrans not working with Ben 10: Protector of Earth?

Discussion in 'NDS - ROM Hacking and Translations' started by onslaughtiscool, Aug 12, 2019.

  1. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    Hello everyone,

    earlier today i tried to extract the vgm files from Ben 10: Protector of Earth, since it has a really cool remix for the theme song.
    When i tried to open the rom, VGMTrans did not read the file. Is there any way to fix this?
     
  2. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Have not got the game in front of me but I have tangled with a few other Cartoon network titles over the years and they are some of the more notable for not using the SDAT sound format. Can you open the ROM with whatever tool you like (ndstool, crystlatile2, tinke, ndsts...) and see if there is a .sdat file somewhere in the ROM as that is most of what VGMtrans (and what the vast vast majority of DS games utilise) is about ripping as far as DS things are concerned.

    If you just want a rip of the song then it might be worth just recoding it from an emulator.

    If we do have to cover the other formats ( https://gbatemp.net/threads/the-various-audio-formats-of-the-ds.305167/ ) then we can but, and it might even turn out to be a common PC format (or common format after a fashion) but start with the basics for now.
     
    MythicalData likes this.
  3. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    Most i found was a music.bin and a sound.bin file. i used crystaltile2 and tinke. I've seen uploads of the song on youtube, but i want to use a different soundfont on it, which is why i'm trying to find the vgm file.
     
    Last edited by onslaughtiscool, Aug 13, 2019 at 12:29 AM
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Can you open the .bin files you mention in a hex editor and either copy-paste the first few lines of code or share some screenshots (being a new user if uploads don't work you might have to split up the url a la http : // www. somesite .tld /imageblah or say I am using imgur and this is the unique part of the url). .bin is utterly generic as an extension but the first few lines could still be something common (see the previous link about various formats, some of which have seen a bit more development since I last updated that thread).

    I should also note it could be a wave file -- these intro songs often are just wave files and thus out of the scope for a different instrument library, or sound font if you prefer that term. I had a quick look at some gameplay footage and the main track from it



    The main menu theme certainly seems a bit more complex than the main game, however I have heard even more complex out of the DS sound system and it still being sample based rather than wave. Simple test if you want there. Open up the channels/mixer in desume and see how many channels it is using during the main menu theme. If it is not many then chances are it is wave based.
     
  5. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    Yikes. wasn't aware the ds could play wave files. I think it used 7/8 channels. Edit: I'm dumb and didn't realize there was another 8 sound channels. It uses 11 out of the 15. I have a slow laptop so running ds games at full speed isn't exactly it's best feature.

    Here's the first 6 lines of the music.bin file, breaking up the link didn't work, so this is the best i can do.

    01 01 3A 10 B4 88 1B 00 04 89 1B 00 F4 B0 01 00
    F8 39 1D 00 7C 4C 1D 00 E0 58 1D 00 10 5A 1D 00
    40 5B 1D 00 C8 6C 1D 00 4C 7E 1D 00 C0 8C 1D 00
    4C A0 1D 00 F8 BA 1D 00 74 CA 1D 00 04 DF 1D 00
    98 F2 1D 00 2C 07 1E 00 CC 1C 1E 00 5C 30 1E 00
    7A 03 00 00 FF FF FF FF 7B 03 00 00 02 00 40 00

    Not really sure how many are needed to see if it's similar to others, but more can be provided if needed.
     
    Last edited by onslaughtiscool, Aug 13, 2019 at 2:04 AM
  6. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Yeah the DS supports PCM and ADPCM streams natively. http://problemkaputt.de/gbatek.htm#dssound

    That looks like a list of pointers* more than a previously seen format, however it could still have stuffed some known files at that point. I guess we will have to have a look at the whole file.
    Said pointers keep getting bigger each time and mostly by fairly small amounts so could still be sequenced/tracker type audio. No names in that one though so I don't know what is what.

    *after being split up and flipped around. Kind of large numbers and some deviations from the "pattern" but where I would first look.
    Code:
    103A0101
    001B88B4
    001B8904
    0001B0F4
    001D39F8
    001D4C7C
    001D58E0
    001D5A10
    001D5B40
    001D6CC8
    001D7E4C
    001D8CC0
    001DA04C
    001DBAF8
    001DCA74
    001DDF04
    001DF298
    001E072C
    001E1CCC
    001E305C
    0000037A
    FFFFFFFF
    0000037B
    00400002
    
     
  7. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    Should i try and make a few more posts so i'm able to send links, then send you the whole music.bin file? What would be the best website to upload it at?

    I have a good feeling it's not a wave file. If we're only able to get the vgm itself and not the samples/instrument library, thats fine, since i was going to use another one anyways.
     
    Last edited by onslaughtiscool, Aug 13, 2019 at 3:08 PM
  8. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    I should stop being lazy and take a look myself is what I should do. That said I opened up audacity and the last file I tried a raw import on was one called club penguin and it had the same file names as this, also it seems they shared a dev. Looking back at my fiddling with that ( https://gbatemp.net/threads/club-penguin-music-files-help.496934/ ) then I did not get anything like what is wanted here but something more at least. I also note they did Puzzle Quest DS which was another interesting game from a hacker perspective but that was some time prior so don't know how much I want to look into that.

    Anyway tried a raw import with audacity of the music file and got a bunch of what might be said to be audio stings. However at 2 megs total I doubt it would have fit everything in it for that initial music. Had a quick scan and nothing indicated midi or a common format I know, but I don't know them all here.

    001e 42e4

    That said the last "pointer" is 001e 305c and the whole file ends at 001e 42e4 which is reasonable, and 001e 305c could well be the start of another section as before it is a bunch of FFFF.
    Said last file is interesting though and could be a pointer list all of its own.

    103A0101
    001B88B4
    001B8904
    0001B0F4
    001D39F8
    001D4C7C
    001D58E0
    001D5A10
    001D5B40
    001D6CC8
    001D7E4C
    001D8CC0
    001DA04C
    001DBAF8
    001DCA74
    001DDF04
    001DF298
    001E072C
    001E1CCC
    001E305C

    Checked a bunch. The ones starting at 001D and beyond seem to start with 0C
    Code:
    1284	0C1212	-114
    0C64	0C0C0C	-88
    0130	0C0101	-47
    0130	0C0101	-47
    1188	0C111C	-108
    1184	0C1117	-109
    0E74	0C0E13	-97
    138C	0C1318	-116
    1AAC	0C1A1C	-144
    0F7C	0C0F16	-102
    1490	0C1418	-120
    1394	0C131E	-118
    1494	0C1419	-123
    15A0	0C1522	-126
    1390	0C1319	-119
    1288	0C1215	-115
    
    Three columns there.
    Leftmost is what the next pointer take the current one equals. Middle is what is at that location (including the 0c thing) and the last is ignoring the first 0c what the difference between the values is.
    Sadly they are not all the same but that could just be padding to make some kind of boundary, and the differences are not so large as to not make it padding. Especially as 001D58E0 and 001D5A10 are the same size and have the same difference value.

    We are still quite far from any kind of audio sequence to look at here but a start.

    Took a look at some other files. Seems some common animations in the form of FLIC animations. Also most of the game appears to have ASCII text, and there is a folder called scripts which has a bunch of what looks like Lua (which Puzzle Quest also notably used). Might make for some quite hackable stuff. If you are lucky you might even find some kind of sound script for the game (didn't see one but it was a very quick scan) which would probably help quite a bit to understand what the game does.
     
  9. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    Seems like i chose the one game that was impossible to get, lol. So from what i understand, we might be getting somewhere, but it's not likely that were gonna find any sort of midi. Where exactly would a sound script be? I'm super interested in all of the "looking into the files" stuff, but i wish i knew how exactly every little thing worked
     
    Last edited by onslaughtiscool, Aug 13, 2019 at 6:09 PM
  10. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Yeah the vast vast majority of DS games use the SDAT format which VGMtoolbox, VGMtrans and all the rest will handle all day long, and even those that don't often still use known formats or simple formats. This however opts for neither from what I have seen thus far.

    I looked in the "chunks" folder and it had scripts for the various enemies, general play and more besides. It seems like it was some kind of binary/minimised/bytecode form of lua but still had loads of English language function calls/function names. If the game has a sound handler as part of that then you could glean some idea as to how it works. On the other hand if it is buried in normal DS code in the ARM9.bin or whatever then you are looking at a standard disassembly approach, which most don't do and instead go more from principles, fiddling, matching what your ear is telling you to what you have been able to determine does what, and observing it running.

    From here you can try to find where code handling the song is. Corruption would be an idea here -- tweak various parts of the music file until you get something different for that song and then you know what you changed to get it and thus where it is. In my case I would probably fiddle with the pointers I reckon I found above (assuming they are not relative then swapping them around should make different things play, once you know what plays differently you can probably get the section responsible for it and figure out what sort of tracker/sequence format style it uses)
     
  11. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    weird how most lisenced games use the same sound file format. How would i go about editing the music.bin file? hex editor?
     
  12. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23
    Nov 21, 2005
    United Kingdom
    Not really that weird; music formats are hard and SDAT does it all out of the box.

    Right now you would need to use a hex editor as I am not aware of any public tools to modify them.
     
  13. onslaughtiscool
    OP

    onslaughtiscool Newbie

    Newcomer
    1
    Aug 12, 2019
    United States
    We might be on to something here!!! I changed a random line (my changing it to A3 a bunch of times, i have no idea how hex files work, lol.) And the music actually got sped up! Edit: nevermind... i guess it was desume doing something wacky.
     
    Last edited by onslaughtiscool, Aug 14, 2019 at 2:31 AM
Loading...