spc or rsn to sdat? by dj4uk6cjm at 5:39 PM EDT on September 10, 2015
Geez its been a long time since I made a thread here >_< anyways, was just wondering if there was a program that can convert spc or rsn to sdat? It'd be neat to mess with the converted files in vgmtrans or use them for custom music imports in ds games.
My understanding on this subject is a bit limited and I am going to be extrapolating from knowledge I have in similar things.
An SPC file, to my understanding, contains program code to be sent to the SPC700 sound chip. I assume somewhere in the program code is also the waveform samples to use. If it is anything like NSF, then the SPC700 programs will have no set standard on how to define a loop point, which I think would be one of the key things to converting the music. I know very little about ASM but I've read that creating a loop can be done many different ways and I know this to be true even with higher level programming languages.
The SSEQ format in an SDAT is a MIDI-like data file. The sound banks and waveform samples are stored in other files within the SDAT. Unless there was a way to translate an SPC's sound data 1:1 into a DS sequence, I don't think such a thing would be possible.
Now, granted, it probably isn't impossible. It would probably just require more work than a simple program could accomplish, as you'd need to most likely be able to provide loop points. I know for a fact that Square-Enix was able to convert Chrono Trigger's music from the SNES to the DS and it sounds pretty much identical, but they probably also still have the original sequence data of the songs to work with.
Thanks for your insight, I didn't know spc doesn't store loop points. I guess that wouldn't be too helpful for conversions but spc does store the wav samples and midi like sseq so during those few similarities I thought it would be possible :P ah well...also the nintendo was able to do the same thing for the music of Kirby Super Star Ultra, the snes and ds versions sound alike too. Wonder how they did that.
It should be possible to track loops, using actual emulation of playback to record which samples are used, and what their loop points are when they actually loop, as this is important for engines like with Toy Story, which rewrites the directory instead of using different sample numbers with each voice.
The directory contains two offsets. First the sample start offset, which is read at key on, and then the sample loop offset, which is read when the sample actually loops.
Then there's the sample end. For looping samples, the end and loop bits will be set on the last block of sample data, and then it will repeat from the loop start address.
For samples that have no loop flag set on the end, the last _24_ samples will be lopped off by the decode and playback pipeline reacting to the end bit. Or, one and a half blocks.
Earthworm Jim takes advantage of this non-looping behavior with its one shot streamed samples, filling up to a whole block to a block and a half with garbage with only the end bit being valid. Don't chop? Get loud crack on the end.