Musical Soft Clipping Circuits - Tri-to-Sine Waveshapers & the Differential Pair

Started by bowanderror, September 27, 2021, 05:42:38 PM

Previous topic - Next topic

Steben

Quote from: ashcat_lt on September 30, 2021, 06:17:40 PM
Quote from: Vivek on September 30, 2021, 04:59:23 AM
I really wonder what is the sonic difference between all these different transfer functions.
There is at least one JS plugin for Reaper (I'll try to dig around and find it if anybody's interested) which allows you to try a number of different common functions in real time.  It's very much the same thing we've said over and over again about the difference between different diodes, or diode vs transistor or opamp or whatever.  Pre and post filtering, the signal-to-clipping-threshold relationship, and the symmetry/asymmetry will have a much bigger impact on both sound and feel than any subtleties in the curve itself.

I think the slight bend in non feedback amps is more interesting than the knee roundness because it adds things to relatively clean signal.
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Vivek

Quote from: niektb on October 01, 2021, 02:54:13 AM
Well let's put our ears to the test, shall we?  ;)

I've written a simulation in Faust

I noticed that the gain knob responds radically different: https://www.desmos.com/calculator/czdixdgki0?lang=nl
So that's why one clipper starts at 5 and the other at 3.65. I level-matched them as well as I could and also added VU meters to aid with this.


The gain control of arctan seems to behave odd when I use pure sine wave to see resultant waveshape

But maybe that is the nature of that function.

The small signal gain seems to be constant irrespective of gain control, and the only thing that changes with gain is amount of clipping of larger signals.

Vivek

Quote from: ashcat_lt on September 30, 2021, 06:17:40 PM
It's very much the same thing we've said over and over again about the difference between different diodes, or diode vs transistor or opamp or whatever. 

Pre and post filtering, the signal-to-clipping-threshold relationship, and the symmetry/asymmetry will have a much bigger impact on both sound and feel than any subtleties in the curve itself.


This is my main takeaway from this and many other similar threads.

(but maybe I am confirmation biased because that is what I wish to believe)

amz-fx

Quote from: Vivek on September 29, 2021, 07:49:22 AM
I have played with a few Diff Amps in LTSpice:


Kassutronics Discrete VCA
Hagerman Distort - Guitar Pedal with Diff Amp stage (see here for schematic & info)
Kassutronics Moog Transistor Ladder Filter - A bit more complex, but the backbone is a set of stacked Diff Amps


Here is another similar discrete circuit:



regards, Jack


Vivek

Quote from: amz-fx on October 01, 2021, 07:29:10 AM

Here is another similar discrete circuit:

regards, Jack

Thanks Jack!

I suppose it has an input impedance around 80k.

Is that Ok ? High frequency drop compensated for somewhere else ?

teemuk

QuoteIs that Ok ? High frequency drop compensated for somewhere else ?

Why? It is not a high-fidelity preamp but a distortion effect.

Featuring high input impedance might be a good rule of thumb for preserving fidelity and upper end of a good-sounding guitar but we don't neccessarily need such feature in a distortion effect. In fact, it could actually be more beneficial to low-pass and attenuate the higher end of frequencies.

Peavey and Randall frequently employ input impedances in the order of just about 200 kilo-ohms and that's not even "extreme": Back in the days folks used coiled cords, rolled down the tone knob and perhaps plugged to "Low" input to exploit the effect of cutting down top end before overdrive. If you think about it, the other input of typical "Fender" tube preamp (and countless clones of it) has input impedance of mere 33 kilo-ohms. Older fuzz effects, reputed to "clean up well with guitar's volume knob", also regularly feature a very low input Z.

At least 1 megaohm for input impedance applies to specific applications where fidelity and transparent reproduction of the guitar signal is preferred. A distortion effect hardly falls to that category.

niektb

Quote from: Vivek on October 01, 2021, 05:17:51 AM
Quote from: niektb on October 01, 2021, 02:54:13 AM
Well let's put our ears to the test, shall we?  ;)

I've written a simulation in Faust

I noticed that the gain knob responds radically different: https://www.desmos.com/calculator/czdixdgki0?lang=nl
So that's why one clipper starts at 5 and the other at 3.65. I level-matched them as well as I could and also added VU meters to aid with this.


The gain control of arctan seems to behave odd when I use pure sine wave to see resultant waveshape

But maybe that is the nature of that function.

The small signal gain seems to be constant irrespective of gain control, and the only thing that changes with gain is amount of clipping of larger signals.

That's because, strictly seen, it's not a gain knob in case of the arctan. It really shapes the distortion in a different manner also, the higher you set it the more hard clipping is introduced... (something you can also see in the graphical calculator). With loud signals you will experience a volume drop as a result.

That's actually the reason why I added the boost knob in front. So you can set the character with the gain knob and boost the gain with the 'Boost'. It takes a bit of fiddling in the graphical calculator I guess to find good values :icon_mrgreen:

My advice: with boost en volumes to 1, find proper values for the gain knobs (using the derivative in the graphical calculator) and then adjust boost to alter the amount of distortion and volume to compensate for level differences :)

Steben

as expected the arctan sounds more like overdrive, tanh like distortion
  • SUPPORTER
Rules apply only for those who are not allowed to break them

PRR

Quote from: teemuk on October 01, 2021, 09:02:33 AM....the other input of typical "Fender" tube preamp (and countless clones of it) has input impedance of mere 33 kilo-ohms.....

I don't see that.

The direct is 1Meg.

The padded is 68k+68k or 136k.

When two guitars are mixed, "it depends", but can't be lower than 136k, typically >150k.

A very extended discussion:
https://robrobinette.com/How_Fender_Input_Jacks_Work.htm
  • SUPPORTER

Vivek

Quote from: teemuk on October 01, 2021, 09:02:33 AM

In fact, it could actually be more beneficial to low-pass and attenuate the higher end of frequencies.


I think I understand need to attenuate high frequencies (let's say more than 6khz) after a distortion stage.


What are the benefits of removing high frequencies before a distortion stage ?

bowanderror

Quote from: niektb on October 01, 2021, 02:54:13 AM
Well let's put our ears to the test, shall we?  ;)

I've written a simulation in Faust, comparing both clipper types and putting them through a Marshall-type tonestack and a simple cab sim. I used anti-aliased approximations so you should be able to crank the gain without getting all kinds of nasty harmonics  8)
You can open this link and copy-paste the code below: https://faustide.grame.fr/
And then you can use any DI guitar track you like. I used the one from this forum thread (which is used to test Kemper Profiles): https://www.kemper-amps.com/forum/index.php?thread/26817-a-dry-guitar-track-for-our-tests/

I noticed that the gain knob responds radically different: https://www.desmos.com/calculator/czdixdgki0?lang=nl
So that's why one clipper starts at 5 and the other at 3.65. I level-matched them as well as I could and also added VU meters to aid with this.


import("stdfaust.lib");

amp_clipper1 = aa.tanh1(amp_k*_)*amp_vol
with {
    amp_k = vslider("[01]Gain", 3.65, 0.1, 10, 0.1);
    amp_vol = vslider("[02]Volume", 1, 0.001, 10, 0.001) / 5;
};

amp_clipper2 = (aa.arctan(amp_k*_)/aa.arctan(amp_k))*amp_vol
with {
    amp_k = vslider("[01]Gain", 5, 0.1, 10, 0.1);
    amp_vol = vslider("[02]Volume", 1, 0.001, 10, 0.001) / 5;
};

vumeter = vmeter(0)
with {
    vmeter(i, x) = attach(x, envelop(x) : vbargraph("VU[2][unit:dB]", -70, +5));
    hmeter(i, x) = attach(x, envelop(x) : hbargraph("VU[2][unit:dB]", -70, +5));
    envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db;
};

amp_tonestack = component("tonestacks.lib").jcm800(t,m,l), component("tonestacks.lib").jcm800(t,m,l)
with {
    t = vslider("[05]Treble", 6, 0, 10, 0.01) / 10;
    m = vslider("[04]Middle", 4.5, 0, 10, 0.01) / 10;
    l = vslider("[03]Bass", 5, 0, 10, 0.01) / 10;
};

amp_cabsim = sp.stereoize(ef.speakerbp(80,5000));

bpc = checkbox("[04]Arctan Select");
boost = vslider("Boost", 5, 0.1, 10, 0.1);
amp_sim = hgroup("[00]Boost", boost*_) <: hgroup("[02]Tanh", amp_clipper1 : vumeter), hgroup("[01]Arctan", amp_clipper2 : vumeter) : select2(bpc) <: hgroup("[03]Tonestack", amp_tonestack) : amp_cabsim;

process = hgroup("British Amp", amp_sim);


Wow, that's really cool! I fed a drum loop into it that I use in LTSpice and the arctan definitely had more headroom, as well as an extended Boost slider range where the "limiter" effect was more audible than obvious overdrive sound.

That browser IDE is quite powerful. What kind of dedicated hardware can run Faust programs?

teemuk

QuoteThe padded is 68k+68k or 136k.

You are right. I remembered incorrectly that the 68k resistors would be switched to a parallel arrangement.

Benefit of low-pass prior to distortion is the same as always: Concentrating IMD more on a limited bandwidth. The attenuated high frequencies contribute less to IMD and help to produce less convoluted distorted tone (more clarity on chords etc). Distortion will introduce higher order harmonic frequencies anyway so it will regain the attenuated high end, but now with lesser intrusion of harmonically incoherent intermodulation frequencies.

niektb

Quote from: Steben on October 01, 2021, 12:27:54 PM
as expected the arctan sounds more like overdrive, tanh like distortion

I wouldn't really go so far as to categorize one as distortion and one as overdrive. The differences are too subtle imo.
Again I should stress that the gain knobs are not comparable... To get the exact amount of gain at the zero crossing, the arctan gain should be set roughly 1.5x higher than the tanh gain!

I must say I prefer the arctan at higher settings cause it feels a little bit fuller. But tanh at lower settings cause it feels a little more dynamic

Vivek

niektb,

Please help me to understand how wav files are mapped in Faust

What is the range of the wav file data when converted to decimals ?

is highest possible data in the wav mapped to 1.00000000000 ?

Steben

Quote from: niektb on October 02, 2021, 04:27:21 AM
Quote from: Steben on October 01, 2021, 12:27:54 PM
as expected the arctan sounds more like overdrive, tanh like distortion

I wouldn't really go so far as to categorize one as distortion and one as overdrive. The differences are too subtle imo.

I don't :icon_mrgreen: I said the difference in clipping / curve tend to sound "rather" towards what is commonly known perceptions.
The absence of hitting the rails is IMHO the culprit here, which leaves a lot of dry signal lingering, just as so many soft clipping devices.
  • SUPPORTER
Rules apply only for those who are not allowed to break them

Vivek

Funny think is, when I look at these graphs from 0,0 to 1,1

And play with the sliders

I see exactly same graphs as Gamma correction for calibrating my PC monitor

and indeed, links on use of differential amps for TV monitor Gamma correction were posted here

So it's the same idea for Sine wave generation, Clipping and Gamma correction.

Fantastic !!!

Vivek


bowanderror

That's an interesting circuit, lots of building blocks you don't see too often in pedals. I wonder how the behavior of a differential amplifier changes hooked up to a transformer vs. opamp?

Clipped portion of the IVP Preamp Schematic:


bowanderror

Quote from: Vivek on October 02, 2021, 05:59:15 AM
So it's the same idea for Sine wave generation, Clipping and Gamma correction.

It seems that non-linearity is the key similarity between the three, but I'm still not sure why this particular transfer curve is so widely used.