On 10/11/2021 at 3:30 PM, Kalvan said:
If we time things exactly, with the samples, we may be able to put any two of them through the PCI channel, using the FIFO, since the SegaPCM's channels are 12 bits wide each, and most samples were more like 8 bit wide.
So... what I'm looking into doing is just collecting the PCM samples and figuring out the sample rate / bit depth / etc from the VGM file in my pre-processor. My thought is to load those into memory along with a generated index file from my preprocessor. Then inject "play digi X" messages into the music data stream. I'm not sure about the analysis / packaging part just yet....
Question for you: is the DAC always always ALWAYS 12-bit data on YM2612? I know the sample rate is not really defined, as that's a product of how fast samples are written to the DAC, but I imagine that any given game was probably consistent - but that is probably a bad assumption. Perhaps if I keep track of delta-T and N-samples played, I can compute the sample rate for a given playback and generate "play digi" commands that include sample rate to be used.
Assumptions - nobody was ever a mad lad enough to do things like compress the digis by having data inteded to be played back with various portions looped in order to get the real sound - e.g. a sample with an attack, a piece of the sustain, and then a decay. It's possible, and given how precious storage space was back then, it may be that games did in fact use techniques like this. For now, I will be happy if I can just get the PCM drum track working for my Sonic the Hedgehog music conversion demo that I posted earlier - you know, for completion's sake. If whatever tactic I use works in the general case would be "Bonus points" but not required as a success metric for me.
?