ROM Hack Changing a DS game from using sequenced music to streamed music (Solatorobo, snddata.sdat)

Tayruu

Where is Self?
OP
Newcomer
Joined
May 29, 2013
Messages
11
Trophies
0
Age
32
Location
NEO ZEALAND
Website
taylor.revasser.net
XP
129
Country
New Zealand
I hope that title is clear at all.

I discovered an enhanced version of Solatorobo's soundtrack exists in the form of Solatorobo Perfect Soundtrack. I have already toyed with modifying The World Ends With You's music, so I thought I could do the same here.
Unfortunately all the music is midi/sequencer-based within the snddata.dat file, except for the ending theme. (And the voice clips, which also are within the sdat for some reason.)

So I'm curious if there's a way to insert new streamed versions of the music, and (presuming it won't adapt automatically) tell the game to load those instead of the sequenced files. Though even that could be a challenge, as said ending song is 131kbps 16000~Hz "NDS-style 4-bit IMA ADPCM", and the quality is pretty grainy and rough as a result. I don't know how flexible the file format is compared to say, Criware ADX files. (The DS TWEWY's format.)

(EDIT: Oops maybe I should've used the "Rom Hacking" tag here.)
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
34,072
Trophies
2
Website
trastindustries.com
XP
22,954
Country
United Kingdom
Changed the tag for you.

Yes but also no, but eh and there are cowboy methods.

Baseline SDAT does have the STRM format* which is basically raw PCM or ADPCM audio, which is also what the hardware supports as a format you can feed it.
However if the game does not use STRM (which is a great deal of them) then the compiler got clever and removed the ability to decode it to save some space. If indeed the ending is STRM then that provides scope for more.

The cowboy method is to use as many samples as you can for as long as they will stand and make the song up from individual samples. Nobody really does this though.

https://github.com/Dirbaio/NSMBCR/tree/master/source
https://github.com/Dirbaio/NSMBCR/blob/master/source/soundThread.cpp and https://github.com/Dirbaio/NSMBCR/blob/master/source/wavplayer.cpp in particular. http://nsmbhd.net/thread/1281-how-asm-hacks-are-setup-tutorial/ is a bit older but how it was done and you will be doing something similar to that (or handling even more) almost regardless.

*in case you were unfamiliar then the SDAT format has three major audio types

STRM covered above. Basically raw wave audio and treated accordingly.
SWAV/SWAR. Short samples (not sure how long offhand, have pulled out official ones some seconds in length) but some limited options for extras (might have some minor loop options). SWAR files can contain very large numbers of files** and don't have names for a lot of them (compared to the rest of the SDAT family which tends to).
SSEQ, flanked by SBNK (sound bank) instrument libraries which themselves are .
This is the sequenced audio format where times, loops, volumes and more can be done. Most backing music in all DS games will be this.

Sound quality of samples varies and can theoretically be improved, and has been at times by editing the SDAT file (it will have info on what is to be played) and possibly calls to it/settings for the hardware the code sets up if it is not pulled from the file, though resource issues might crop up if a lot of memory is used. More likely is sound is usually a large component of DS ROMs so getting it down might mean you can use the lower size cheaper storage chips.

** I usually like to point people at the the first DS Castlevania. All sorts of fun things there, including the E3 announcement voiceover.
 
  • Like
Reactions: Tayruu

Tayruu

Where is Self?
OP
Newcomer
Joined
May 29, 2013
Messages
11
Trophies
0
Age
32
Location
NEO ZEALAND
Website
taylor.revasser.net
XP
129
Country
New Zealand
Your list of formats sound about what I observed with Solatorobo's sdat internals:
  • bank/ - contains sbnk files. These are either BANK_BGM_*.sbnk or BANK_SE_*.sbnk. The former is possibly the soundfont for the music, and the latter is actual sound effects. I originally presumed these the soundfonts/etc, but they're all <1KB, so they could be programming information more than actual sounds.
  • sequence/ - sseq files
  • stream/ - "B_ending.strm", the ending theme, and all the V_*.strm voice soundbites.
  • wave/ - swar files, these are probably the actual waveform packages, as they have identical naming schemes and files to bank/ (just with WAVE_) and are 3-to-360KB each.
It does occur to me that there may be some trouble if strm files can't do the likes of loop points.
 
General chit-chat
Help Users
    Ophelia_Later @ Ophelia_Later: A new 3ds update is available but it says important ! after the system is updated any existing...