Let's build a "perfect" MOS SID (6581)

VST, AU, AAX, etc. plug-in Virtual Instruments discussion
User avatar
Halonmusic
KVRAF
2242 posts since 13 Nov, 2015 from Norway

Post Thu Jun 13, 2019 1:54 am

If you are making it? No thanks.
Don't be a Sheep. :borg:

HSum
KVRist
78 posts since 28 Aug, 2017

Re: Let's build a "perfect" MOS SID (6581)

Post Thu Jun 13, 2019 3:22 am

Great explanations and documentation. Thanks. Let's see if one day there'll be the perfect emu :D

User avatar
aciddose
KVRAF
12235 posts since 7 Dec, 2004

Re: Let's build a "perfect" MOS SID (6581)

Post Thu Jun 13, 2019 6:34 pm

Further "progress" if you'd call it that:
Image

I've decided I'll post the filter schematic even though it's nowhere near accurate. I've been able to muck around with manually entered NMOS models/parameters to get closer to what looks accurate, but it looks like using some of the special features of ltspice for high accuracy will be needed after all. Going transistor-by-transistor to measure and enter all that data is quite a bit of effort.

In the schematic image I've linked here I've tweaked things to produce vastly higher gain than the actual circuit is capable of. This allows self-oscillation and provides some protection against latch-up even when the input is driven to clipping.

I still haven't bothered to model the full audio-path or the voltage controlled resistors as without an accurate amp model finished the complete circuit wouldn't be accurate anyway.

With that taken into consideration it would still be fun to get some sequenced sounds played through the "rough" model. This can be done by providing .wav files of the raw unfiltered input signal and matching envelope.

http://xhip.net/sid/badsid3.mp3
( http://xhip.net/sid/badsid3.flac )

Due to the feedback based gain control the circuits themselves are of course much more linear than you'd expect given the raw transfer curve. In that respect it might be interesting to get the full audio-path set up so the additional mixer/gain stages can further color the timbre. I'll have to see when I get there.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.

User avatar
aciddose
KVRAF
12235 posts since 7 Dec, 2004

Re: Let's build a "perfect" MOS SID (6581)

Post Fri Jun 14, 2019 1:28 am

Here it is running with a clean square input and envelope signal:

http://xhip.net/sid/badsid_seq_1.mp3
( http://xhip.net/sid/badsid_seq_1.flac )

http://xhip.net/sid/badsid_seq_2.mp3
( http://xhip.net/sid/badsid_seq_2.flac )

The input square is a pure digitally generated "perfect" square. 100% of that timbre is coming from the filter circuit. There is no mixer/dac and no amplifier stage applied so this is still lacking the additional distortion from the complete signal path.

The source signals:
http://xhip.net/sid/sq_seq_1.flac
http://xhip.net/sid/sq_seq_1_env.flac
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.

User avatar
aciddose
KVRAF
12235 posts since 7 Dec, 2004

Re: Let's build a "perfect" MOS SID (6581)

Post Sun Jun 16, 2019 1:36 am

Examples of the filter tweaked in an attempt to maximize linearity (now includes the whole output signal path):

This is most likely what the designers wanted to produce (250mV):
http://xhip.net/sid/badsid_seq_3.mp3
( http://xhip.net/sid/badsid_seq_3.flac )

As the input gain increases, distortion grows exponentially (500mV):
http://xhip.net/sid/badsid_seq_4.mp3
( http://xhip.net/sid/badsid_seq_4.flac )

Now some bad distortion (1V):
http://xhip.net/sid/badsid_seq_5.mp3
( http://xhip.net/sid/badsid_seq_5.flac )

Until the point where it can't really even "filter" anymore (2V):
http://xhip.net/sid/badsid_seq_6.mp3
( http://xhip.net/sid/badsid_seq_6.flac )

I suspect there are remaining accuracy issues though as interesting as this may be on its own.

This distortion issue is a combination of things. The amplifier design matters (#1) but also the voltage controlled resistors play a very significant part. More modern designs can overcome these problems by using proper opamps and VCRs (full OTAs are used instead) which were beyond what they could do with the SID.

#1: The amplifier design actually contributes more to instability of the filter where it can break into uncontrolled oscillation. This is due to the non-linearity and non-uniform gain. (The gain+linearity is highest in a narrow region around near 4.5V) Outside the linear region the amp can be forced to act more like a switch and once it does it switches rapidly: you're now oscillating out of control. The very limited Q of the SID may in fact be due to avoiding this problem in combination with maximizing noise ratio and "hiding" distortion (making it less noticeable.)

I guess I'll just make this a huge wall of text blog-post. The SID amps also had much lower gain than they needed to operate correctly. This is why for example the signal level drops across each amp (it should be unity) and therefore the "highpass" is actually not getting enough feedback from the lowpass or bandpass feedback paths to actually work. Given proper gain in the amps the filter can nearly self-oscillate with Rfb = 270k. This is why the "highpass" output is actually a mixture of the input with the highpass: the low part hasn't been subtracted away entirely. This also means the bandpass is not actually an equal band but "mostly lowpass, slightly highpass", a severely tilted band.

Part of the reason for the low gain was that it was done intentionally (#2) due to severe variability in NMOS transistor gain. This is why individual chips in the same run as well as different runs and revisions have such radically different gains (and therefore distortion, Q, cutoff range, amplitude, clipping, high/band-pass quality, etc.)

#2: Since having the gain "too high" can force the circuit into out of control oscillation, the amp had to be designed given the "ideal maximum" transistor gain to have a gain slightly below the critical point where it would become unstable. At that point the average is now way lower and the minimum gain point is so low you'd barely get any Q and your high-pass doesn't really work at all anymore. Whole runs of chips were produced with transistors that had much lower than expected gains and therefore dysfunctional filters.

When maximizing gain it makes the circuit more likely to become unstable and switch into uncontrolled oscillation. This is the meaning when I said the amp design is "very finicky". It's like you go in the living room and move a sofa 1" and the whole house explodes.

The source signals:
http://xhip.net/sid/cfunk_osc.flac
http://xhip.net/sid/cfunk_env.flac
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.

User avatar
EvilDragon
KVRAF
18149 posts since 7 Jan, 2009 from Croatia

Re: Let's build a "perfect" MOS SID (6581)

Post Sun Jun 16, 2019 10:56 am

Very interesting findings!

Return to “Instruments”