top of page

"That" compressor

Updated: Aug 1

I had wanted to make a compressor circuit for a long time, because it's a popular and somewhat easy to make effect, but the existing DIY offer left something to be desired. You should be ready to accept some compromise, in the form of: noisy and hard to find OTA chips; expensive and hard to find (in THT at least) VCA chips; hard to find (again in THT) and fiddly JFETs; circuits that underperform in some way or another, or; circuits that aren't well translated to instrument input and stompbox format, in the form unbuffered gain controls and bipolar power supplies. I'm not claiming that making a good VCA is easy, and the VCA chips of THAT corporation deserve some credit anyway, for their incredible performance and how easy they make a precise gain control. I own a compressor using one of such chips, and while I can't find any flaws in it, I still think a more accessible DIY alternative should be possible, without any major compromise.

I was then confronted with a choice between LDR optocouplers and JFETs as control elements: the former offer very good distortion performance, and I've used them successfully in the VCA-1 and the Trembling Satellite; I still wanted to give the latter a chance, because of their intrinsically higher speed (attack time can always be made slower with the side-chain, but there's an intrinsic lower limit) and the better defined voltage-resistance relationship. I thought they were still a decent option, if the circuit wasn't picky about specific part numbers, given also the possibility of using SOT-23 devices.

I've actually made and tested a JFET circuit before this one, but I was forced to face a distortion problem that's hard to overcome: I thought instrument levels were small enough to be fine, but the peaks (otherwise, what's a compressor for) aren't! There are ways around it, but an upper limit on amplitude handling without distortion is given by Vp, the pinch-off voltage. You can't use a part with a very negative Vp on a 9 V single supply or you won't be able to use much of its resistance range. Moreover, the necessary local negative feedback (usually) halves the control voltage that reaches the gate, making things even worse! This is how, after a month, I ended up with the following circuit, using a trusty homemade LDR-LED optocoupler, with the LDR is still available at low prices despite its small Cadmium content, a situation I hope doesn't change.

That's not to say my troubles instantly ended, having made this choice: they started even earlier, due to the general lack of useful technical information about compressor theory, and they persisted, while I was looking for a circuit that gave me the results I wanted. THAT corporation has by far the best collection of resources, but while it's all useful on a general level, most of it is best applied to their own chips. You start getting into this and the world seems in your hands, but then you wonder how general those conclusions are, when you don't have RMS detectors and precise voltage-gain control relationships.

Maybe it's worth taking a moment to go over some general principles.


Notes on dynamics processing

Dynamics processors are inevitably shown on a log-log plot of input vs. output dB levels, like the one here for a downward compression (the usual kind).

The x axis shows the dB (peak, RMS, pick one) of the input signal, on the y axis the corresponding dB level at the output. Easy right? Deceptively, I'd say. Also because the axes are logarithmic, this kind of plot has some quirks:

  • Because it's a steady-state representation of input vs output in dB, the slope doesn't represent gain, but the rate of change of gain: the slope corresponds to ratio, and an unprocessed signal will always be a 45° line (the black one). Compression and expansion result from rotation of those lines.

  • Static gain has the effect of sliding the whole curve up or down (dBout = dBin + c), but gain at any point isn't easily visualized if the slope isn't 45°.

The curve above represents downward compression: at some point above a threshold, the transfer curve deviates from a straight line, and is rotated clockwise (the grey portion). Through a combination of above and below-threshold rotation, in both directions, one can achieve different effects:

  • Line passes through the origin, slope is 45°, there is no threshold; this is a unity gain buffer.

  • Slope is 45°, there is no threshold, but the line doesn't pass through the origin; if it passes above it's an amplifier, if it passes below it's an attenuator.

  • The less trivial case above; 45° line through the origin, rotated clockwise after a threshold. Downward compression with unity gain below threshold.

  • 45° line above a threshold, but it's rotated anti-clockwise below a threshold. This is downward expansion, and if you prolong the 45° line and it passes through the origin, above-threshold gain is unity.

  • Same as above, but the line turns clockwise below the threshold; this is upward compression. You know it's compression because the output dB range is smaller than the input one.

  • 45° line from the origin up to a threshold, then it rotates anti-clockwise; this one is upward expansion.

  • There is no threshold in this dB range, the whole line is turned clockwise; this is the so-called "full range" compression.

  • In the same way, turning the whole curve anti-clockwise results in "full range" expansion.

Some of these cases are less common than others, and these are only the simplest, since you can have more complex curves with "soft knees", two nontrivial slopes, multiple thresholds...


The circuit

This circuit aims at being a simple but versatile compressor, meant primarily for stompbox use, but suitable for other applications, given the good signal handling capability and the control options. It's configurable for anything between 1 and 5 controls: the schematic shows all of them, but includes suggestions for fixed values to substitute where possible; the "Threshold" control is the only one that is necessary, followed by the make-up gain.

I don't feel very ashamed for having reused the same joke as for that overdrive for the name, since it seems even more fitting for a compressor.


Signal path

The signal path is simple, as in these circuits the complexity tends to be concentrated in the side-chain. It's reminiscent of the ones found in the VCA-1 and the Satellite, but with the difference that the LDR is normally non-conducting if the signal is below the threshold; this is because the turn-on time of LDRs is faster than the turn-off, and I wanted to be able to have a fast attack.

The small amount of gain at the input improves SNR over having it all after the attenuation, and is possible thanks to the low distortion of LDRs even at large levels. I've found that 6dB is a safe amount of gain to avoid clipping, at 9 V with normal op-amps.

The second half of the 072 buffers the output, and can go from 0 up to 20 dB. This is only necessary with low thresholds, when most of your signal is compressed instead of just the peaks, and the average level drops.

I was experimenting with the resistance in the attenuator to observe something I call "compliance": how many dB above the threshold can the input go before the compression ratio goes down, because the control element can't attenuate the signal further ( in this case, the resistance has reached a minimum). While this eventually happens, the main consequence is a decrease of the compression ratio without affecting the threshold. To explain this, think of the divider as a common emitter amplifier and vary the load resistor: in feedback compressors, ratio is proportional to closed-loop gain. That's how this became my

serendipitous "Ratio" control. This could also be a switch between presets. The relationship isn't linear, and the ratio here varies between roughly 3:1 and 8:1 (measured). If you don't want the control, I think 47k is a good compromise between Johnson noise and the high ratios usually found in stompbox compressors.

The LDR I've used has a wide resistance range, roughly from 400 ohms (light) to 20M (dark), but almost any should work fine, since the low part of the resistance range isn't usually reached in practice, and it's the ratio with the "Ratio" resistance that matters for both: as long as the dark resistance isn't lower than that, nothing bad will happen, and if it's not, it's just a matter of make-up gain. Feedback will take care of the rest.


Side-chain

I went back and forth between different arrangements for the side-chain, both referenced to half supply and to ground (possible with the 358-style op-amps), before settling on this one. I've even tried a feedworward arrangement, but found it unusable with the not-well defined characteristics of the optocoupler.

The final design features 4 op-amp sections, but despite that it's as compact as it can be. I show using a LM324, which is the quad version of the 358, but two LM358 can be used instead. These op-amps aren't the best in most regards, but you'll find me using them often out of the signal path not only because they're one of the cheapest and most easily available models, but for their very useful capability of having the output go to the negative rail ("single supply" op-amps). This is exploited by U1B and U1C here.

The first op-amp just buffers the signal before the rectifier. Not sharing this stage with the output has the advantage of letting you set the make-up gain without it affecting the threshold or the ratio in a vicious cycle. An op-amp buffer keeps the same DC level, which is necessary for correct operation of the rectifier.

The rectifier itself is an odd one: it's based on one of the simplest full-wave precision rectifiers possible, which I've found it shown by two different sources.

How it works is that U1A is an inverting amplifier with -1 gain for inputs more negative than Vref, and the diode drop is compensated by feedback. With more positive inputs, the output of the op-amp is disconnected and the signal goes out through the two resistors.


The downsides of the original are that it's sensitive to both source and load impedances: the buffer takes care of the former, U1B of the latter. The third issue, and the one that led to my version, is that the op-amp goes open loop on positive peaks, and those 4.5 V negative pulses can couple in very small quantity to nearby stages pretty easily (the demo below was made with this rectifier, and you probably can't hear anything wrong, but it bothered me).

My solution was to make an hybrid between this and the standard full-wave rectifier shown in the ESP page above. You can think of this as a version of that one with passive summing, or a version of the more frugal one that doesn't go open-loop as badly. The only thing to watch out for is that the resistor feeding the input must be much smaller than the resistor network in the inverting rectifier, for the two peaks to be matched. This is done in the schematic.

It's even possible to ground-reference this circuit (and it would solve the open-loop problem), and even AC-couple it: in this last case you need to be careful to load the source with a resistor smaller than the two input and feedback resistors (10k to ground, 100k in series works well).

You might think "why haven't you just used the more standard precision full-wave circuit instead"? For some reason, trying to offset that one in a similar way, by pulling the virtual ground input up to 9v, couldn't get the output below 0.6 V and the rectifier just got clipped below that, a problem I didn't have with the "Threshold" control connected to the inverting input, and the rectifier to the noninverting one.


What follows is a somewhat standard AD envelope generator, using signal Schottky diodes for the good compromise between low Vf and leakage. Discharging to the op-amp output, together with the full-wave rectification, results in very low ripple. Linear taper gives linear control over Attack and Decay times (which are level-dependent so not specified), but log pots might give better adjustability, I haven't tried it. I've also suggested some good fixed setting for the total resistance if you don't want these controls. I understand not everyone wants the highest number of controls in a compressor like me, and the "Decay" control is particularly subtle, unless you play staccato and set it too slow. Ripple is not an issue even at the faster settings, it seems.

While it is sometimes possible to connect a passive AD directly to the rectifier, that one needs to have an output that goes open with no input, or the capacitor would be discharged just as quickly as it charged. An example of this is the simple single-diode precision half-wave rectifier. Here, U1B has also another role, though...

For the rectified signal, U1B is a non-inverting amplifier with a gain of two. The inverting input is fed a voltage by the "Threshold" control, and for this one it is a unity-gain inverting amplifier. What this does is shift the rectified signal down from 4.5 V. At the maximum setting, U1B idles at 0 V, at the minimum at about 1.2-1.3 V, a voltage that is just below what's required by the LED for any significant attenuation. This effectively controls the peak signal voltage required for the optocoupler to kick into action. Together with the envelope diodes, this results in a little bit of soft knee, even if not by much.

The threshold voltage varies from basically zero, to ~ -6 dB from the maximum designed input level of 1 V peak.

The 47k resistor in series with the "Threshold" pot is generous, to account for tolerance in the pot resistance value, but is the largest common value that allows full control over the threshold. You'll find that at very low settings (below a quarter, depending on "Ratio"), there will always be some attenuation. This is the point at which the compressor stops behaving like the usual above-threshold compressor, and becomes a full-range compressor, with a ratio that is fixed at about 2:1 regardless of the "Ratio" setting (or any other circuit parameter, I'm not sure why). A linear potentiometer gives linear control over the threshold peak voltage, but a log pot gives better control over low threshold settings.

The envelope output (yet another node that is sensitive to any kind of loading, even BJT base current), is buffered by the last op-amp to drive the optocoupler LED. In most cases, the LED current is low and it glows dimly, so the 1k resistor is mostly there as safety measure. I've used a 5 mm high brightness red LED, but yellow, green, red and white are all suitable.


Other amenities like high-passing the side-chain or a high shelf eq on the output are easily applicable, but I think the circuit as it is doesn't need anything else and can stay reasonably simple.


Transfer curves

Here are a few representative curves. In all of them 0 dB = 1 V peak. The yellow line isn't representative of input signal and is mostly just a reference for compression ratio, because of the make-up gain and my interface's input gain setting, but I've made an attempt to match it with the sub-threshold level, or with the half-way level for the "full range" one.


Demo


Layout

Here are layouts for a 3-knob version with fixed sidechain rates, courtesy of chip, and a 5-knob layout based on that by me:



Acknowledgements

As it is usual for my most involved projects, I thank aotmr for the feedback, the discussion, and helping me find a way out when I was stuck with some issues. Plugindoctor has been fundamental for checking that I was getting what I wanted, but if you know of similar software let me know.

693 views5 comments

5 Comments


Aquataur
Oct 21

Dylan, I just looked at this great unit here. I found the usage of C5 is unexpected and different from the Chewborg, which uses the same envelope generator. Should it not be in parallel to R10 or is R11 deliberately included? The latter makes no sense to me.


Also, a CA3130 precision rectifier resp. peak hold may work here too.

Cheers,

-Helmut

Edited
Like

RockFodden FX
RockFodden FX
Oct 16, 2023

Dear pedal inventor

Thank you for sharing your knowledge with us

A hug from Brazil for you

Like
bentfishbowl
Oct 28, 2023
Replying to

Thank you!

Like

Guest
Sep 07, 2023

Hello, I follow your work and I am a big fan of your designs...! I wanted to ask you about the performance of the compressor in bass guitar

Like
bentfishbowl
Sep 22, 2023
Replying to

Hi, thanks. I think the performance is good! It does what it should with no additional adjustments!

Like

If you want to leave a comment, try to be logged in, even with a throw-away account, so that I get notified.

bottom of page