The GPa... At last another compressor!

Started by Fancy Lime, October 21, 2021, 04:46:11 PM

Previous topic - Next topic

Fancy Lime

Hi all

Anyone in the mood for yet another compressor design? Wait! Come back! This time it'll be different, I swear!

Background
I am, at heart, a bass player. Yet I could never quite get myself to like compressors for some reason. I always found them to either not do anything audible at all or make the sound lifeless and boring while adding a ton of noise. Useful for mixing and such, sure, but not really for my pedal board. I tried a bunch of commercial offerings and bradboarded some others. None really caught my fancy. Until I was bored and needed a reason to experiment with the NSL32 optocouplers I had just bought. So I breadboarded an approximation of the DOD 280 optical compressor and after some tweaking I really grew quite fond of it. But then, as it often happens, I didn't get around to building it right away, so other stuff became more important and I mostly forgot about the idea to build a compressor. I have a Nobels CO-2 anyway and as far as commercial units go, this Dyna Comp type device seems to be one of the better ones to my ears. That was about three years ago. Some time later, I read a few threads here, where people were frustrated with not finding the exoctic parts they needed for compressors they wanted to build. Vactrols are getting harder to get, OTAs are apparently not easy to get everywhere, VCAs are about as easy to hunt down as a unicorn, and many JFET types are mostly fakes at this point. So I had a bit of a think how to design a proper DIY compressor that used only common off the shelf parts, was easy to build and mod and did not require fiddly trimming. Oh yeah, and it was supposed to be as low noise as I could possibly make it and sound good, too. No pressure, eh? After some consideration, I scribbled a design on the back of an envelope and intended to breadboard and refine it into something useable. That was almost two years ago. We all know why the breadboarding was delayed. Recently, there was a thread about the Rothwell Love Squeeze, which provided me with the kick in the backside I needed to finally breadboard this thing. And behold, it was very good...

Basic idea
I wanted to avoid vactrols and VCAs for reasons of obtainability. OTAs are a viable route if we avoid the obsolete types but that particular field has been well ploughed, nothing much to add here from my side that Merlin and Jonny haven't already done better than I could. A diode bridge design was tempting, especially because I could have called it Bridgman Compressor, but was ultimately deemed too complex and too fiddly to get right. Another time, maybe. Plus, those really aren't particularly fond of loud signals, and circumventing this problem inevitably leads to additional noise or significantly more complex design. That left me with a JFET design.



Design overview
Sound wise, I wanted good coverage from unobtrusive mild compression to all-syrup super squishee DOD 280 tones. The controls should be as few as possible and as many as necessary without loosing important functionality. That desired functionality was control over the overall compression and volume as pots, as well as over decay and high end. The latter two could be pots or switches.
The important thing was, that the design needed to be fairly insensitive to the JFETs characteristics so it could take a wide range of devices, including the very common ones that are still manufactured today and likely will be for some time to come. That meant designing primarily for N-channel switching JFETs like the J112.
I also wanted the amplifying element to be a only one opamp stage that would work with a common jelly bean chip like the TL072. That meant that the easiest way to add a gain control element, was to put the JFET in the ground leg of a non inverting opamp stage. With a P-channel device this would be rather straight forward. We could just put it on the ground and have the control voltage somewhere between the rails. But since I wanted to use easier to get N-channel JFETs, the control voltage would need to go below ground if the JFET connected the ground leg to ground. So the audio signal would need to be used as a voltage inverter pump. Indeed, this is exactly what the Rothwell Love Squeeze does. Unfortunately, this technique has a whole bunch of drawbacks, most notably a control voltage range that is limited to half the maximum voltage swing of the opamp, which works out to about 1/3rd of the supply voltage with many opamps, which would restrict us to JFETs with Vgs(off) > -3V. So instead of putting the JFET on the ground, I hung it from the ceiling in order to take advantage of the full supply voltage differential to use as the control voltage range. The Compression control was placed such that it not only controls the overall compression but also adjusts for the Vgs(off) variation of the JFET.
I decided to go with a feed back design instead of feed foreward. This has the massive advantage of being partially self-regulating, which makes it more tolerant to the inherently variable characteristics of the JFET gain control element. I also like the feel of feed back compressors better, especially on high settings. I suspect that this is due to the inherent soft knee characteristic of feed back compressors. Alas, feed back designs are also inherently susceptible to dynamic over-compression pumping, which we usually want to avoid. This problem can be greatly mitigated by making the attack time as short as possible. Since the compressor was supposed to be suitable for bass, a full wave rectifier was unavoidable to get the shortest possible attack and recovery times without rippling artefacts. The envelope detector of the good old Dyna Comp has, in my experience, by far the best ratio of performance to complexity for a stompbox compressor. Anything even slightly simpler tends to perform a lot worse (for my purposes) and anything better is much more complicated. The short attack time, however, introduces another problem, namely a precieved loss of treble on high compression settings, which is due to the dynamic nature of the frequency distribution of a plucked string. Because the overtones are most prominent in the loud initial peak of a freshly plucked string, but decay quickly, strong compression seems to subdue the overtones. This can be mitigated by adding some non-compressed treble to the signal, which can easily be done by adding a treble only ground leg in parallel to the gain control ground leg. The problem with this approach is again that now there is some uncompressed signal going into the envelope detector, which may cause over-compression on hard transients. However, I found this to be not as much of a problem as I feared it migtht be. I suspect that this is because the area under the curve of these treble transients is not particularly large and therefore they do not affect the charge of the holding cap as much. The holding cap of an envelope detector is, after all, an integrator of sorts.

Functionality and tweaks
It's all really rather simple if you take it apart. The power section is bog standard and probably doesn't need explaining. The audio section is also fairly standard. When the JFET Q1 is fully open, gain is controlled by the ratio of R11 (+R14 if the Ratio switch is open) to R10 + Ron of Q1. For a J112, Ron is typically somewhere around 30Ω, maximum 50Ω, meaning we get a gain of around 3.8 or 6.6, depending on the position of the Ratio switch. The Bright leg with R9 and C5 has little influence as long as Q1 is open. If Q1 is fully closed, the gain controll leg contributes nothing so the gain is the minimum of a non-inverting opamp, namely 1. Now the Bright leg starts to shine and contributes a gain of 2 and 3, respectively, depending on the Ratio switch, at around 1.5 kHz and above. Below that, the gain falls to 1 with 6db per octave. What all of that means is that the maximum compression that you can get at bass frequencies is 3.8/1 or 6.6/1 in this exact configuration. If you want more or less, you can adjust R10, R11, or R14. If you decrease R10, then you might want to increase C8 to avoid bass loss. If you want finer control, leave out R14 and put a 5k pot wired as a variable resistor in place of the Ratio switch but for me, a two-position switch works fine here. If you do that, lower C11 to 3n3, so to not loose treble at high ratio settings. The treble compression ratios are different if the Bright switch is closed: 3.8/2 or 6.6/3, which makes up for the preceived treble loss upon compression. If you like to enhance this effect, lower R9 and/or C5. The diodes D2 and D3 at the input simply protect the input of the opamp from excessives signal because the TL072, although otherwise a remarkably robust and useful opamp, really does not like it's input overdriven.
The envelope section is more or less the same as in a Dyna Comp but with the second opamp half used as a phase inverter for one of the sides, just like in the DOD 280. The transistors Q2 and Q3 can be almost any BJTs. I used high current types but even humble 2N3904s should work. Technically, the higher the current, the faster the attack of the compressor, which is what I was going for, but the difference will probably be negligible. Too small for me to bother calculating it anyway. 2N2222s would also be a good choice here. C16 (+C15 if engaged) mostly control the recovery time because the transistors can suck so much current, that the caps make hardly any difference in terms of attack. 2u2 for C16 are as low as I could go with a 100k compression pot and a 9V supply. At 1u, I got very noticeable rippling on the lowest notes of a 5-string bass. Nice sounding rippling, mind you. Sounds like very mild but really fat and saturated overdrive. So if that is what you are looking for, lower C16. For guitar, 1u or 470n should be fine. 10u for C15 gives a rather long recovery with a nominal time constant of 1000ms. Mostly useful for either mild compression or obvious heavy breathing compression. Making C16 into 1u and C15 into 2u2 or 4u7 may be more useful for some people. A 3-way switch for one more option may be justified.
The compression gain control is obviously where envelope detector and audio path communicate. The Compression pot acts as a voltage divider between the positive rail and the holding cap(s) C16 (+C15). If the Compression is set to minimum, the gate of Q1 is always at the positive rail, which is also where the channel of Q1 sits, meaning there is never any compression, no matter what the envelope detector says. If Compression is turned all the way up, the gate of Q1 is at the voltage of the holding cap. Because this voltage can be as low as ground + 0.6V or thereabouts, any JFET whose Vgs(off) is less than the power supply voltage minus 0.6V can be used for Q1 and still get maximum compression. However, if your Vgs(off) is lower, like the 3V or so that a J112 typically has, you can get over-compression if you turn the Compression pot up past the point where Q1 is juuuust turning of at extremely loud signals. The Compression pot therefore has two jobs: it controls the compression and it adjusts for the inherent inconsistency of the JFET Q1. Therefore you need to set this one by ear, 10 o'clock on one unit may not be the same compression level as 10 o'clock on the next unit. Having the option to purposely go into overcompression is also something I kind of like. Not always but sometimes. But what is it the Compression control actually does, you ask? Because this is a feed back compressor, there are no independent ratio and threshold controls. The gain arraingement in the audio section sets the *maximum* ratio, whereas the diodes D4 and D5, together withe the thresholds of the transistors Q2 and Q3 set the *minimum* threshold. The Compression control both lowers the threshold and increases the ratio as it is turned up. It is worth noting that such designs are inherently soft knee, meaning the real compression ratio of a signal gets higher, the further above the threshold it is. Neat, innit? R8 and C7 are there to isolate the compressor action from the power supply. R12 and C10 provide some audio feedback into the gain control, which helps reduce unwanted rippling.

Phuuu, that was long-winded... Please let me know if you find errors in the schematic or gross flaws in the design. If you have questions, shoot.

Cheers,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

sergiomr706

Hallo, thanks for sharing your design. Looks interesting, by the way, wouldnt you record some audio bits with It? It would be great to have a listen to It.

Vivek


deadastronaut

yay another compressor option..excellent.  8)

nice work man . 8)
https://www.youtube.com/user/100roberthenry
https://deadastronaut.wixsite.com/effects

chasm reverb/tremshifter/faze filter/abductor II delay/timestream reverb/dreamtime delay/skinwalker hi gain dist/black triangle OD/ nano drums/space patrol fuzz//

Mark Hammer

Often a good writeup is worth more than the design it describes.  And sometimes they're on even footing.  So kudos, Andy.

A question. the J112 is used to vary the gain of U1A.  I've been intrigued with the "soft distortion" of the Roland Funny Cat, where a JFET is also used as the ground leg to vary the gain of a non-inverting op-amp.  In that instance, the envelope ripple was employed to "wiggle" the JFET's resistance at audio frequencies to produce what sounds like distortion.  Of course, that design used half-wave rectification, while the GPa uses full-wave, doubling the frequency of any potential envelope ripple.

That is in no way implying there is a weakness in the design.  Rather, it leads up to my question: how much trial and error did you need to settle on time constants that would eliminate any invasive envelope ripple, while at the same time providing for good sidechain responsiveness?

Vivek

Thanks for your design, Andy !

I am trying to learn about compressors, so I entered the schematic into SPICE

I hope I did it correctly.

It will take me some time to study it and see if it reveals something interesting.

Fancy Lime

Thanks for the kind words!

Quote from: sergiomr706 on October 24, 2021, 04:37:32 AM
Hallo, thanks for sharing your design. Looks interesting, by the way, wouldnt you record some audio bits with It? It would be great to have a listen to It.
Hmm, I have some difficulty coming up with a useful way of recording a compressor that demonstrates what it really does. The problem is that if you only listen to it without feeling how hard you pick the strings, you are missing one part of the equation. But I will try to record a little loop with a large dynamic range and run that through the compressor on and off to give you an approximation. Will take a few days though (guests occupying my recording space at the moment).



Quote from: Mark Hammer on October 24, 2021, 11:11:41 AM
[...]
A question. the J112 is used to vary the gain of U1A.  I've been intrigued with the "soft distortion" of the Roland Funny Cat, where a JFET is also used as the ground leg to vary the gain of a non-inverting op-amp.  In that instance, the envelope ripple was employed to "wiggle" the JFET's resistance at audio frequencies to produce what sounds like distortion.  Of course, that design used half-wave rectification, while the GPa uses full-wave, doubling the frequency of any potential envelope ripple.
[...]
Intriguing. I haven't even tried removing the holding cap completely yet or using a much too low value. I did try adding a full-wave/half-wave switch by shorting R17, thus killing the signal of the inverted path. The result was, predictably, more ripply and had the typical "randomly sometimes longer attack effect" of half wave rectifiers due to the phase dependence of the initial swing. Certainly an addition worth considering if you want to adapt the design to be more of a rippler and less of a traditional compressor.

Quote
[...]
That is in no way implying there is a weakness in the design.  Rather, it leads up to my question: how much trial and error did you need to settle on time constants that would eliminate any invasive envelope ripple, while at the same time providing for good sidechain responsiveness?
Actually, I spent mere minutes on that. Not because I am naturally awesome (jury's still out on that one, or so my wife says) but because I did not have to try and err but just check and verify what others have figured out over the past few decades and then most helpfully published here and on other forums. I'm standing on the shoulders of giants here. But who am I telling this? There is a reason why the 100ms/1600ms switch on a Ross/Dyna Comp is called the Hammer Mod.*

My design process for the time constant went something like this:
1. I want to use a 100k pot for the Compression control.
2. Most such side chains use a minimum time constant ow 100ms.
3. So let's stick in a 1u cap, see what happens.
4. Rippling up to the second or third fret on the low E string of a bass.
5. So 2u2 should be fine. thing
6. Check?
7. Check!
8. Let's make the longer time something like five or six times that, so 10u in parallel.
9. Check?
10. Sounds about right.

That being said, I have since gone back to experiment some more and found that the holding cap may indeed warrant some additional choices. Maybe a 3-position switch or maybe even more.

Cheers,
Andy

* To everyone who does not know, what I am hinting at, this thread is still among the best resources for understanding how to design time constants on a Ross/Dyna Comp style sidechain and the sonic effects of chages: https://www.diystompboxes.com/smfforum/index.php?topic=21929.0
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

anotherjim

Interesting design choices.
You have made it a parallel compressor. The audio will pass x1 through the non-inverting opamp no matter what the side chain is doing. This is not necessarily a bad thing as it can be more natural with the compressed element adding body.

Fancy Lime

Quote from: anotherjim on October 24, 2021, 04:36:35 PM
Interesting design choices.
You have made it a parallel compressor. The audio will pass x1 through the non-inverting opamp no matter what the side chain is doing. This is not necessarily a bad thing as it can be more natural with the compressed element adding body.
Well, kinda, sorta, in a way. I tend to find the blend knobs on compressors that also have a (true) ratio control a bit strange because adding uncompressed signal to the compressed one has exactly the same result as lowering the compression ratio (unless you filter the uncompressed path or do something else interesting with it, interesting can of worms there). So you could view the "+1" in the opamp gain formula as an addition of clean signal, or you could view it as a reduction in ratio. What the choice of a non-inverting opamp means in practical terms here, is that we cannot get inf/1 ratio. For that reason I did toy with the idea of using an inverting opamp design instead and I *think* I came up with an idea that may be worth testing but it was significantly more complex and more finicky than the non-inverting and I personally can hardly tell the difference between 10/1 and 20/1 so I figured, why bother, and went with the simpler design. This is supposed to be a diy friendly design, after all. I reckon there are enough legendary studio compressor designs to clone out there for people looking for a challenge ;)

Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

PRR

Quote from: Fancy Lime on October 24, 2021, 03:32:35 PM...I have some difficulty coming up with a useful way of recording a compressor that demonstrates what it really does. The problem is that if you only listen to it without feeling how hard you pick the strings, you are missing one part of the equation. ...

That, AND: these days most of the ways you can share will impose their own compression. From the $13 cassette recorders of the 1970s onward, auto-level is in everything.
  • SUPPORTER

Vivek

I started to study this schematic in SPICE

Here are the first few graphs

Green = voltage on integration cap
Red = output for input 1Khz sine wave, starts at 0.1sec, ends at 0.6s


for inputs of 150mvp, 500mvp





I really need to check my SPICE schematic properly since some graphs I generated are totally wonky.


Fancy Lime

Quote from: Vivek on October 25, 2021, 07:34:39 AM
I started to study this schematic in SPICE

Here are the first few graphs

Green = voltage on integration cap
Red = output for input 1Khz sine wave, starts at 0.1sec, ends at 0.6s


for inputs of 150mvp, 500mvp





I really need to check my SPICE schematic properly since some graphs I generated are totally wonky.
Hi Vivek,

Thanks for the simulation! Very interesting! And slightly odd. From what it sounds like, I would have expected a much faster attack. This may partially have to do with the fact that plucked strings have a rather sharp bump at the beginning, that empties the holding cap fast before the signal settles. For reference, I used BC337-40 transistors. These have an hFE of 250 to 630 and can pass 800mAdc, so they should be able to suck that 1u cap dry real fast.

What settings did you use for the simulation? By the looks of it, I am assuming maximum compression and high ratio setting? Which holding cap setting?

Cheers,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

Vivek

#12
I might have made some error when building my SPICE file for the GPa

But if you guys humor me and treat error in SPICE file same as error on breadboard, and help me out

I input GPa into SPICE and found Dyna Comp SPICE file. About 11 months earlier, I had input Rockman ACE, Soloist and X100 compressors into SPICE.

Then I tried to compare what is going on

First, here is the GPa in SPICE. you can see the settings



C15 and C16 are in circuit
R11 and R14 are in circuit
Compression pot is at 50%
Transistors are BC337-40

Now we inject 1Khz, 600mvp input for a short while

Green trace is voltage on integration caps
Red is output



We see that green curve falls rapidly as soon as note is struck

But after reaching some value, it has a knee and continues to fall at slower pace till it reaches zero V.

When the note is over, the voltage on the cap starts to rise

Now lets look at the Collector current on Q3 (Blue)




Initially, no input = no collector current
Then the collector current rises rapidly at start of note (about 8.5ma peak for about 8 cycles)
Then it drops to a lower value around 420uA peak
Then it drops to 250uA peak
and becomes zero when input signal has stopped


For comparison purposes, here are the same graphs from the Dyna Comp :



Voltage in integration cap (Green Curve) rapidly reduces during attack phase and reaches some equilibrium. It stays there while the note is going on. It rises when the note stops. All as expected.

and look at Current through one of the discharge transistors on Dyna:



No signal = no current
Very sharp rise in current during very fast attack phase (about 31mA for about one cycle)
When voltage equilibrium reached after attack, extremely little current in transistor (11uA peak)
When signal stopped, no current in transistor.
All as expected.


There are further funnies as well, when I try to compare output after attack for inputs of 50,100, 200, 500, 1000mvp.


So the question is : What error have I made in my SPICE schematic / analysis  on GPa ?

Fancy Lime

Hi Vivek,

very awesome, thanks! I don't think there is anything wrong with the simulation.

First, the strangeness with the cap going to zero slowly after the initial fast drop: This is expected behavior because the gain providing opamp always has a minimum gain of 1. So, unlike in the dyna comp, the envelope detector can never reach a true "gain equilibrium". This leads to some pumping in high compression settings. To avoid this, the Compression control should be set no higher than a certain point. That point is where the gate of Q1 is exactly at Vgs(off) when the holding cap is completely drained. So if Vgs(off) = 3V, then the Compression pot can be set no higher than 1/3rd (assuming 9V power) to avoid this artefact. However, with actual string instrument input I kinda like the dramatic breathing effect that this produces in extreme settings, so I did not attempt to design it away.

One of the things I find slightly odd, is that the holding cap does not start out at 9V but slightly below. This means thet there is significant leakage through Q2 and 3 in the nominally off state. Should not have any influence on the practical operation, though.

The thing that bothers me is the very slow attack time. From all I can see, this should not be so different from the Dyna Comp. Can you try what happens when you disconnect c15 or open the bridge around R22? With only the 1u cap connected, is the attack quicker? If yes then Q2 and 3 may not deliver sufficient current, which may be due to the current going into them being limited by R18 and 19. Maybe changing those to 10k would help. The strange thing is that the thing on my breadboard sounds like the attack is absolutely immediate. I need to connect the treble ground leg to get any "attack sound" to shine through the compression.

Speaking of breadboard, I tried Mark's suggestion and removed the holding cap and made the inverting envelope detection path switchable. The result is an overdrive, as one would expect. Not bad but the same sounds can be had with much simpler devices. Where it gets interesting is if we put a much to small holding cap in. 100n to 470n produce a range of lovely fat analog synth sounds, especially with the envelope detector in half-wave mode. The kind of sounds that are begging to be put through an envelope filter or wah. So I tried that and it sounds amazing. Needs more experimentation but I have a feeling that this thing will end up getting a dedicated synth mode.

Cheers,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

PRR

Quote from: Fancy Lime on October 26, 2021, 05:12:40 PM....the holding cap does not start out at 9V but slightly below. This means thet there is significant leakage through Q2 and 3 ....

Or meter loading? 10Meg hanging on 100k will turn 9.00V to 8.9V.
  • SUPPORTER

Fancy Lime

Quote from: PRR on October 26, 2021, 10:52:53 PM
Quote from: Fancy Lime on October 26, 2021, 05:12:40 PM....the holding cap does not start out at 9V but slightly below. This means thet there is significant leakage through Q2 and 3 ....

Or meter loading? 10Meg hanging on 100k will turn 9.00V to 8.9V.
These are, however, simulations. No actual meter involved. Does LTSpice simulate meter loading by default? If so, can it be turned off?

Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

Vivek

We have 8.39V after D1 and R1.

I suppose that is main reason why integration cap does not charge up to 9 (not discharge transistor leakage)

(Spice meters / scopes are ideal and don't load the circuit in any way)

PRR

Quote from: Fancy Lime on October 27, 2021, 02:26:23 AM...These are, however, simulations.....

SPICE lies.

In layers.

This is probably a 1970s model of old BC337's worst-case leakage. You could quantify that by placing a 9V and a BC337 stand-alone and reading the collector current I(ce0).

Oddly my very old SPICE is giving 9.0V for a 2N3904. A dozen nA. I do not believe that either.
  • SUPPORTER

Vivek

Dear Andy

What is the purpose of C10 ?

What would happen if we had a jumper instead of C10 ?


Fancy Lime

Quote from: Vivek on October 28, 2021, 01:49:23 PM
Dear Andy

What is the purpose of C10 ?

What would happen if we had a jumper instead of C10 ?
C10 and R12 feed some audio signal to the gate of Q1 to keep the source-gate voltage a little steadier even when there is a large AC voltage across the channel. This is often done without the cap, for example in the Rothwell Love Squeeze. The (small) problem then is, that the DC voltage on the channel of Q1 messes with the gate voltage and therefore with the range of the Compression pot. Because R12 and R13 are so much larger than the Compression pot, this is not really a problem as long as none of these resistor values change, so C10 could just be left out and jumpered. I just like to keep unintentional DC influences to a minimum. Makes design and debugging easier, especially if values of resistors or pots may be modified later on.

Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!