.SWAR rip help!

Discussion in 'NDS - ROM Hacking and Translations' started by Ray =D, Jul 16, 2011.

Jul 16, 2011

.SWAR rip help! by Ray =D at 5:43 PM (1,335 Views / 0 Likes) 8 replies

  1. Ray =D
    OP

    Member Ray =D GBAtemp Regular

    Joined:
    May 17, 2011
    Messages:
    288
    Country:
    Germany
    Hey, I try to find the right wave's for one SSEQ. In one SWAR of my game are about 600 WAVE's [​IMG] There are 3 SWAR files overall. I cant find the right WAVE's. So I thought if its possible to rip the swar out of a SSEQ (I mean which WAVES are used^^). Is that possible with any program?
     
  2. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,716
    Country:
    United Kingdom
    For the sake of others reading the midi type sounds are handled by SSEQ files which are small files of a proto programming language linked to small bank files which are lists of instruments which can be varied which in turn are linked to SWAR files which are big (or not so big) archives of SWAV files which are the (AD)PCM audio of various flavours that get sent back up the chain to make some of the sounds you hear.

    I figure this is for an actual hack rather than a rip (in which case I would point you at VGMtoolbox).

    Back on topic I can get you the bank the sseq is linked to (any old smap generator like vgmtoolbox will pull that off, the "list information" in crystaltile2 or a basic hex editor if you know where to look) and the SWAR after that but as for gathering only the used SWAV sounds (especially if it is a shared bank) I guess it is possible but I know of nothing that parses the SSEQ format at that level with the intention of doing something like this (you sound like you want an instrument frequency analysis like we sometimes do for text hacking) and you really will need a parser (basic hex editor searches will be oh so tedious as it is a variable length command affair). sseq2mid does have a log option* (-l on the end although you will probably want to stick a ">>a.txt" on the end else it will just sit in your command line window) but it is still not quite what you might wish for
    .

    Perhaps go the crude way and just build a massive SWAR although I guess if you are fiddling at the instrument level that is not really any use. Perhaps instead consider converting the audio to STRM- we had a short discussion on the matter about dragon quest in the rom hacking docs although you probably know most of the content already.

    *a sample of what you might see
    sample
     
  3. andibad

    Member andibad Soon™

    Joined:
    Sep 14, 2009
    Messages:
    699
    Location:
    hospital
    Country:
    Indonesia
    @FAST6191: swav is still same as wav?
     
  4. Ray =D
    OP

    Member Ray =D GBAtemp Regular

    Joined:
    May 17, 2011
    Messages:
    288
    Country:
    Germany
    <!--quoteo(post=3777545:date=Jul 17 2011, 12:45 AM:name=FAST6191)--><div class='quotetop'>QUOTE(FAST6191 @ Jul 17 2011, 12:45 AM) <a href="index.php?act=findpost&pid=3777545"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->For the sake of others reading the midi type sounds are handled by SSEQ files which are small files of a proto programming language linked to small bank files which are lists of instruments which can be varied which in turn are linked to SWAR files which are big (or not so big) archives of SWAV files which are the (AD)PCM audio of various flavours that get sent back up the chain to make some of the sounds you hear.

    I figure this is for an actual hack rather than a rip (in which case I would point you at VGMtoolbox).

    Back on topic I can get you the bank the sseq is linked to (any old smap generator like vgmtoolbox will pull that off, the "list information" in crystaltile2 or a basic hex editor if you know where to look) and the SWAR after that but as for gathering only the used SWAV sounds (especially if it is a shared bank) I guess it is possible but I know of nothing that parses the SSEQ format at that level with the intention of doing something like this (you sound like you want an instrument frequency analysis like we sometimes do for text hacking) and you really will need a parser (basic hex editor searches will be oh so tedious as it is a variable length command affair). sseq2mid does have a log option* (-l on the end although you will probably want to stick a ">>a.txt" on the end else it will just sit in your command line window) but it is still not quite what you might wish for
    .

    Perhaps go the crude way and just build a massive SWAR although I guess if you are fiddling at the instrument level that is not really any use. Perhaps instead consider converting the audio to STRM- we had a short discussion on the matter about dragon quest in the rom hacking docs although you probably know most of the content already.

    *a sample of what you might see
    sample
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    W-What? I'm german and I cant understand all that >_> Sorry... I have to open the .sbnk with a Hex editor or Crystaltile2?
     
  5. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,716
    Country:
    United Kingdom
    @andibad wave as in standard windows wave then no- Electroplankton is the only rom I know of to use those but swav are still ADPCM or PCM audio (both of which wave files use) of some form so it is fairly trivial to convert them between standard wave and swav using various tools and it should be lossless. http://code.google.com/p/loveemu/downloads/list and http://gbatemp.net/t243430-swav-to-swar-converter might be of interest here. VGMtoolbox and ndssndext are of interest if simple ripping is your game.

    Back on topic my apologies, I should really stop writing technical things just before I pass out for the evening.
    Rephrasing
    SSEQ files as you know are like midi files (certainly a tracker type format) but better than midi they can change their instruments.
    For this instrument change they are hooked into a bank file and that bank file hooks into a SWAR archive (which is usually just a collection of SWAV samples).

    What bank files the game might use is determined in the SDAT header which usually follows into the SWAR but if not you can find it out from the relevant BANK file. You need not take a hex editor to the SDAT if you do not want to as you can make an SMAP file* with VGMtoolbox among other things or if you prefer the crystaltile2 sdat viewer will display similar data under "list information" although it will be in hex.

    *this is the file that was found in Zoids and since a few other games that sped up reverse engineering of the whole SDAT format no end. It is not part of SDAT but seemingly made when the SDAT is compiled by the developers and should be deleted when the rom is made. Either way it contains a lot of nice info on the whole SDAT file.

    This can net you the SWAR archive you need but yours seem to be shared and contain hundreds of files. SSEQ files simple say which notes to play and change speeds, volumes, tempos, loop, call other tracks....... but they are annoying to parse as each command need not be the same length unlike say a graphics format that has a 1:1 relationship between hex and pixels.
    SSEQ2midi can be used to parse* the SSEQ file (I know of nothing else that can do it) and you can then figure out which notes are used by the SSEQ in question that you can then use to direct your extraction tools but there is nothing that simply says this sseq uses this bank, this SWAR and these SWAV files from it.

    *you need to add the "-l" (the letter L) before you tell it what SSEQ file to look at but as that only outputs to the command line you also probably want to add >>a.txt to the end of the command which puts any output to a text file named a.txt which you can then open to have a look at and figure out where you want to go next. Do not quote me on it (I have not pulled it apart at source level) but it seems SSEQ2midi just assumes every instrument will have an entire scale of it so each instrument hook will be redirected to a more conventional midi instrument (I guess then why it sounds anything from slightly different to very different when using such tools).
     
  6. Gericom

    Member Gericom GBAtemp Advanced Fan

    Joined:
    Jun 30, 2011
    Messages:
    592
    Country:
    Netherlands
    The next version of my MKDS Course Modifier will also support swar.
     
  7. Ray =D
    OP

    Member Ray =D GBAtemp Regular

    Joined:
    May 17, 2011
    Messages:
    288
    Country:
    Germany
    Ok I think I'm to silly for that [​IMG] I'll try it again in a few years, when my english is better xD Or could I send you my SSEQ and the swar, so you can say me which waves are used for the song?
     
  8. Gericom

    Member Gericom GBAtemp Advanced Fan

    Joined:
    Jun 30, 2011
    Messages:
    592
    Country:
    Netherlands
    You can also use VGMTrans.
     
  9. Ray =D
    OP

    Member Ray =D GBAtemp Regular

    Joined:
    May 17, 2011
    Messages:
    288
    Country:
    Germany
    This only shows me, which swav it uses. My rom has 3 large swav's.
     

Share This Page