Friday, March 26, 2010
SID waveform captures
Well well well, I knew that the 6581 and the 8580/6582 generated different combined waveforms, but I didn't know that not only each single chip generates slightly different bits from each other, but you also wont get twice the exact same waveform on two separate playbacks on a single chip.
This is a binary diff of two OSC3 sampling runs of a combined waveform on a 6581 CBM (r3) chip:
Thanks for kevtris again for the tip (but no thanks in a way, since I had to spend lots of evenings to make the code to generate these data files on a real c64 lol.)
I took care in recording the normal triangular and saw waveforms in each session for comparisons, and they match across all chips.
You can basically think of the SID chip as a 4096 (4kb) sized wavetable synthesizer with each entry being 12bits in precision, only instead of actually indexing a table (which would have been too long to do with the tight schedule given to Yannes when working at MOS), each index in the table is given to a function that generates output "samples" ; A simple counter in the case of the SAW, a comparator for the Pulse+PW, etc. Only later did Yannes/Ensoniq actually implement this as a real wavetable in the DOC chip used in the ESQ-1.
The combined waveforms are still a matter of study as to how they are generated, (see the work of Antti Lankila) . After recording a huge bunch of very different ones however I cant help but feel that
there is no "perfect" way to go at this. As each SID will generate something different, why not add some non-deterministic aspects into the generation?
In the mean time we can reasonably emulate the combined waveforms of the SID (which are really a odd mixture of bits in the analog world) by indexing a pre recorded table such as the one I've captured using the SID's 3rd oscillator "read" functionality. As you know the C64 is an 8 bit machine so we only can read a approximation of the real result (8 most significant bits out of the 'real' 12) but it doesn't really matter, since even at 8bits, we can prove that no two reads are the same, so who cares really if we lose 4bits of precision. Those data files for those combined waveforms will be included in my new emu code and you will be able to choose the version of the chip you want. That way you could simulate a wide range of different "runs".
Note1: the waveforms are $11,$21,(...)$81,
frequency=1, CIA timer=$FFF
Note2: I don't know what is "wrong" with that r2's P_T waveform. seems like its phase starts halfway compared to R3,R4 and 6582... I'm waiting for other R2's from Ebay so I'll retry when I get them.
Note3: The 6582's noise captures are all in phase, but not with my 6581 recordings... weird
more notes to come...