So, I've been slowly reversing the Digital Sound Element http://www.procyon-studio.co.jp/dse/ format that's used by several Nintendo DS games, like Pokemon Mystery Dungeon Explorers of Time/Darkness/Sky.
I've got most of the most important stuff figured out, but I'm still not certain how to do a few things...
So far, I wrote a WIP tool that does a decent job at ripping the tracks. It can rip the samples as-is, but the envelopes not being linear make a significant difference. Or it can rip them and "bake" the envelope into them, however that causes issues when the sounfont player resamples the sounds past a certain note.. And the release phase of the envelope just doesn't sounds right because it has to be handled by the soundfont.. So that's why now I'm asking around for help because I'm not sure how to fix everything or finish documenting the format..
I filled a bunch of wiki pages with my notes at project pokemon :
http://projectpokemon.org/wiki/Digital_Sound_Elements
But, yeah, any help would be welcome !
I've got most of the most important stuff figured out, but I'm still not certain how to do a few things...
- For one, I'm not sure how the system computes the volume for each instruments/programs.. I've traced the execution a few times, but its really hard to follow what's going on.. All I know is that all the volumes for the master, the track, the program, and the sample split are combined together, and the result is a very large integer that is shifted several times over and placed into the NDS's sound control registers..
- And also, I was wondering if anyone had a suggestion on how to export the music from those games? I've been using sounfonts and midis to do it, but soundfonts lack the proper volume envelope parameters. DSE uses an envelope with an initial attack volume, and a fade-out while the key is still held, but its impossible to do that in SF. And the volume envelopes are linear in DSE, but they're logarithmic in the soundfont format. Also, the DSE format supports up to 4 "LFO" based effects per program, with an arbitrary high rate limit, depth parameter, delay, and effect fade-out. Each effect can affect the pitch, pan, volume, or a 4th parameter that could be cutoff. And there are several waveforms to chose from. But the soundfont format has 2 LFOs, there's no obvious way to affect the pan using those, and they're limited to 100Hz max as rate, and the depth is logarithmic...
- Also I lack audio knowledge, and I'm not sure why some basic synth wave samples sound extremely off-pitch when the midis are played back.. Even though the root key seems ok, and it sounds correctly when playing a note using that soundfont + sample. The samples are very short, and the waves repeats only 2-4 times.
So far, I wrote a WIP tool that does a decent job at ripping the tracks. It can rip the samples as-is, but the envelopes not being linear make a significant difference. Or it can rip them and "bake" the envelope into them, however that causes issues when the sounfont player resamples the sounds past a certain note.. And the release phase of the envelope just doesn't sounds right because it has to be handled by the soundfont.. So that's why now I'm asking around for help because I'm not sure how to fix everything or finish documenting the format..
I filled a bunch of wiki pages with my notes at project pokemon :
http://projectpokemon.org/wiki/Digital_Sound_Elements
But, yeah, any help would be welcome !