Compressor dude (apply slope before peak detector)

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

The problem is that the attack time is scaled by the slope if I apply the slope after peak detector,

input is x * gr[-1]
slope is 1 - ratio (feedback compressor)

Code: Select all

// this code works, but the attack time is scaled by the slope
xdb = toDb (rectifier (hp (input)))
hr = halfRectifier (xdb - thresholdb)
gr = toAmp (peakDetector(hr) * slope)
I think I must apply the slope it before the detector, but by halfRectifier (xdb - thresholdb) * slope doesn't work (the compressor doesn't compress). What am I doing wrong?

Post

Should it be toAmp (peakDetector(hr) * -slope) so the gain is reduced as the level above the threshold increases?

Also that might not be the best (or only) place for a peak detector - I would put it right after the rectifier before converting to dB.

Post

Hi mda, yes, the slope is 1-ratio, it will be a negative value.

The problem to place the envelope follower right after the rectifier is that I get a lag in the attack, the only way that I found is to place there.

Post

Possible non-helpful ideas--

Feedback compressor design (except dbx-style compressor/expander noise reduction companders) seemed to me most-often used with non-linear gain elements. Often the gain reduction element would start gentle then get more aggressive toward limiting, the farther into gain reduction it was pushed. With such imperfect gain cells (fets, optos, diodes, etc) feedback topology was about the only way to get a musical result.

Using feedforward on weird gain cells, unless lots of parts and compensations for nonlinearities and possibly trimming each unit for the quirks of the individual gain cell in each unit, maybe at some points in the compression curve the output would start getting quieter as input gets louder. Maybe 0 dB input gives 0 dB output level, but +12 dB input level gives -12 dB output level or whatever. Ack! With increasing input level we normally want the compressor output to at least get a little louder, or to stay the same output level if heavy into limiting!

Feedback compander compressors uised feedback to keep a consistent ratio over a wide input/output range (often 2:1). But FET/Opto music compressors often had built-in unavoidable variable ratio, compressor-to-limiter behavior. Attack might "naturally" get more aggressive as the gain reduction becomes more agressive.

Am just wondering-- in a feedback design, perhaps level-dependent attack time could be viewed as a-feature-not-a-bug?

And maybe if doing a feedback dsp compressor just make the gain cell response non-linear so the ratio changes according to gain-reduction level? Am guessing those quirks are why some folks still like to use hardware feedback compressors? Something about the "messy" behavior is pleasing?

If you want to precisely control envelope times and ratios-- A simple dsp multiply operation is the perfect noise-free linear gain cell. Why not make feedforward compressor if you want precise control? It seems easier to do it thataway, assuming that you don't have to workaround a faulty gain cell.

Maybe compressor plugins have been written with a sidechain input pan knob? Dunno. When the knob is full-left it is a feedforward compressor. When the knob is full-right it is a feedback compressor. Intermediate knob settings morph between the two?

Alternately one might use two envelope detectors-- One detector for the input and another for the output. Apply some kind of logic to "morph between" or combine the two envelopes to control the compressor?

Post Reply

Return to “DSP and Plugin Development”