Monday, 22 June 2015

INSIDIOUS 6581 Part 3: When a filter doesn't behave

Part 2, "How on earth does someone copy a 30-year old sound chip?" can be found here.

It is often that a mistake leads to greatness. There have been many times when I've been writing music when I've hit the wrong note or had the wrong sound selected and it's led me down a different, better path. And so it is that the filter of the 6581 is a great thing because it is broken.

'Mention that filter one more time
and I'll cut ya!', said Ben Daglish
Unfortunately, if you were a C64 musician back in the day, the choice to use the filter was fraught with peril. After spending hours making your sounds just right, you could then go and play it on a different Commodore 64 only to be presented with a completely different sound, maybe even resulting in an entire channel being muted.

The type of transistors used to make the 6581 SID meant that due to inaccuracies of the manufacturing process each one had slightly different amount of resistance. The effect of this is that the cutoff frequency of the filter is different for every chip. And so, as explained above, you could have a perfect filtered tone on one machine, a muffled mess on another and no detectable filtering at all on another. I wonder how many people loaded a game with heavily-filtered music by David Dunn and thought that the music was awful because of their SID filter.

In the words of Bob Yannes, designer of the SID chip, "the resistance of the FETs varied considerably with processing, so different lots of SID chips had different cutoff frequency characteristics. I knew it wouldn't work very well, but it was better than nothing and I didn't have time to make it better".

When used for recorded music production, the filter cutoff problem is mostly irrelevant. You just write the music how you want it for your particular chip and render the master file. The cutoff problem is not what makes the 6581 SID great. What makes it stand out above any old filter is the fact that another bug in the hardware causes it to distort. And it's not a nasty harsh clipping distortion, but a really nice warm one that is very musically pleasant.

What seems to happen is that the filter has a saturation point where the waveform gets squashed at its extremes. If you can make the waveform level push past this threshold, it then distorts exponentially. I can't easily recreate this exactly in Reaktor, so I just tried to model the above behaviour. It doesn't sound exactly like my real SIDs, but it sounds similar enough to sound good.

If you're wondering how I know this, it's because of Antti Lankila's excellent work on opening the secrets of the SID filter.

It's worth noting that the later 8580 SID chips do not benefit from this error as their filters are much more stable and sadly do not distort to any great extent. However, they do have a much better resonant peak than on the 6581. The maximum 6581 resonance is unfortunately pretty weak.

Here's how it works:

Starting from the left in the wiring above, we have A and B. These are the rotary controllers for root cutoff  frequency and resonance that you can see in the corresponding panel to the right, also labelled A and B. To the right of those, we have C, the Modulation module. This corresponds to the complete C panel on the right. It combines the results of all of the modulation controls and outputs a value for the cutoff frequency, which is then added to the value of A. In Reaktor, you can double-click on this to see inside. Moving on, we have D, the filter module. The signal is routed through here into a Reaktor filter module and filtered according to the controls and filter type selection. Again, this can be double-clicked in Reaktor to see the routing.

If the output of the Filter module was sent to the main output, it would result in a very clean, very boring standard filter, much like that in the SID 8580.

Section E is where the action really is. First, the signal passes through a parabolic saturator. This squashes the waveform as it approaches the threshold value (1.75 in this case) and gives it a bit of a growl. From there it gets split up and passed into a Clipper, which clips off the top edges of the waveform beyond values of 1.25. I then take the clipped signal and subtract it from the non-clipped signal to leave me a waveform that consists of just the very top and bottom of the wave. This represents the signal that has been pushed beyond the threshold point in the real SID. As I don't want this to get overblown, I route it through a high-pass filter; we really only want to add the fizz back in. Then I multiply this waveform by 4 to enhance those high frequencies. The SID is apparently exponential here, but a multiply seemed enough. Then I add that back on top of the original signal

After all that, I route it back into another parabolic saturator, labelled F, using a higher threshold value than before, just to calm it down a bit and dampen any new clipping that could result from the newly multiplied signal.

The result of all this is that for single channels, no distortion occurs, but when multiple channels are routed through it the input gets loud enough to gain a soft saturated distortion. This sounds especially good when the channels are set to modulate against each other, for example by detuning one channel.

Now that's all very well and good, but for all that work it's simply not right. It's a filter. It saturates and distorts with thresholds similar to the SID. But it's not the SID. In fact, when you really look into to, it's very far away from how the real thing sounds. So while writing this entry, I went back to the HardSID and started looking more closely at the actual SID output with a software oscilloscope. The results of that investigation will appear in a later article.

Next: "What makes the SID sound like a SID is not the SID"

No comments:

Post a Comment