OP AXYPB GBAtemp Advanced Fan

    Sep 16, 2007
    United States
    I was thinking: Since it was possible to swap out the music of the DS port of Rhapsody with the music from the original PS1 version, would it be possible to do the same with Legacy of Ys, taking the music from the TurboGrafx-CD version?
  2. FAST6191

    FAST6191 Techromancer

    Nov 21, 2005
    United Kingdom
    Possible: yes.
    Difficult: very much so.

    A quick rundown of audio hacking on the DS.
    Most DS games (it is very notable if a game does not use it) use the SDAT format, this format is available in the nitroSDK and broadly speaking can do "midi" type sounds (called SSEQ), short wave "samples" (SWAR) and longer audio tracks (STRM). These files are bundled sometimes into subfiles and sometimes have hangers but ultimately they arrive in SDAT files*
    *notable exception, some files do occasionally sit outside the SDAT file.
    Usually there is one SDAT per game and it is found in a sound (or conveniently named) directory usually called sound_data.sdat, I have seen games with multiple SDAT files (goldeneye being a notable one: it provided a small soundfile, sonic rush another: the multiple sound files were part of the shrinking hack)

    Some games use common/well known formats like wave (electroplankton) or PCM (N plus) possibly with minor tweaks or strict ranges/output settings required.

    And a few others use other formats that are not so well known in general audio circles but in games, this like ADX/AHX (the world ends with you).

    Audio hacks generally include:
    ripping/converting to a more common format. The latter two "types" are easily done with standard equipment/programs (if you can play it back you can do things) and conversion of SDAT type files can be done with tools like ndssndext:
    or VGMtrans:
    Both sites are down or have removed them but those are my mirrors.
    I lean towards ndssndext but many lean towards VGMtrans so take your pick. Crystaltile2 also has some sound capabilities and kiwi.DS also made some stuff and put it over at the tahaxan forums and his site.

    "Play another song" tweaks, in the "other types" it is usually just a basic file system hack but SDAT is a bit more tricky (not by much though):
    Several of these hacks exist.

    Full blown replacement. In the case of the wave/PCM/ADX/AHX you make a new file in the required format and add it in as you would a "play another song" type hack.
    SDAT gets a bit more complex as there are no real tools for manipulation and SDAT rebuilding is usually accomplished either by hand or with some very early stage tools (again kiwi.DS at tahaxan forums).
    In the simplest form though you have the undub hack, this is usually just a matter of taking the sound file from your region of choice and replacing the existing one (usually this means Japanese audio in a US/Eu release).
    Slightly more complex than this is the slight tweaks some games need for undubbing (some releases gain or lose sound: usually this is films in the rom or Japanese voice overs).
    Note before you do this 99% of the time any problems with the undub method is the fault of ndstool (which DSLazy and DSBuff use) so check with a better tool (something like nitro explorer), replace by hand or use something like NDSTS (requires same size files but you can usually chop SDAT down and you can always pad files out).
    The simple fix is the "play another song" method but you aim to match the layouts (if there were 20 files originally in a given order/naming system you replicate it either by adding to the file or tricking it by linking/pointing to something twice).
    SDAT specifications:
    Some choose to go the other way and port the text to the other region rom.

    Assuming that is covered then you have proper replacement. While SDAT is a proprietary format it is based on known standards (more specifically it is fairly hardware oriented).
    The basic hacks take files from other games and add them into the SDAT, this is tricky because of the "hangers" on (midi and by extension SSEQ is an arrangement of instruments, the DS has no instruments onboard and so they are added in) and internal file formats).
    As a halfway house between full blown replacement and "play another song" people have remixed the odd song (made it play faster/slower, removed an instrument they do not care for). SSEQ is documented in the specs, alas it seems the fields of rom hacker and DJ/mixing artist do not overlap all that often so it does not happen very often.

    Back on topic for new stuff in SDAT from the ground up SSEQ can be made from midi with midi2sseq:
    http://kiwi.ds.googlepages.com/ Quality (by that I mean does it match both sides) is far from great (no strongly used standards on either the midi side or SSEQ side) but better than nothing.
    The other formats are tweaks on ADPCM, PCM and the like, alas I know of nobody, myself included, who has bothered to make a guide to this one, the SDAT spec up there and stuff like audacity and a hex editor is my general port of call.
    This is a very complex task and if you wish to undergo it it pays to understand the SDAT format
    The DS sound hardware:
    The GBA sound hardware is a good read too:
    http://belogic.com/gba/ (there was some work done for golden sun on the GBA that might be worth poking around, it is in the GBA rom hacking section)
    As well as general sound theory and computing implementations (a high school physics textbook and some electrical engineering books).
    I do not know of anyone who has done much in the way of sound hacking from an ASM perspective but it would not hurt to understand the basics there either.

    Now that is done to answer your question more specifically both the PS1 and TG16/PCE used file systems which is nice, you will need to get the sounds from those games and get it into a format the games in question use.
  3. AXYPB

    OP AXYPB GBAtemp Advanced Fan

    Sep 16, 2007
    United States
    Thank you for this very informative explanation.

    Oh well. So much for that.
Draft saved Draft deleted

Hide similar threads Similar threads with keywords - Legacy, Music,