About the compressors

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

But I'm only talking about feedback compression, and more specifically, how feedback _expansion_ would work! :) I'm not modelling my compressor after any specific device at all, I just have the "opto" option for a different flavour, so to speak. Nevertheless, it was an interesting read, and probably for others as well, so thank you :)

Post

Well, I can't think of a quick solution. Once you've got a valid value, it's going to skyrocket soon. Maybe the inverse value might work but I'm not sure, sounds stupid [It's friday evening, my head feels empty...].
Affecting the envelope times by means of the cv value might be interesting. But I'd rather take 2 or 3 independent envelopes and take the mean value as reference whenever I want some automatism. Just as I would solder different RC lowpasses in parallel. Sophisticated hardware comps have OP amps arranged as comperator circuits that take the current maximum from any of the RC network as the highest one. But the more naive 'parallel caps' thing works pretty fine, too.
Taking the output for elongation or shrinking the envelope sounds interesting, but I think it's very hard to predict. At least you have to limit the process in some way.
Sascha Eversmeier [formerly digitalfishphones]
TOURAGE DSP
croquesolid drum processor- mix real drums fast & focused

Post

I think I will explore envelope scaling a bit, sounds like fun. Uniqueness can be interesting, and for the standard kind of expansion, one can just use the "VCA" mode. I really don't want to call them VCA/opto, but most users wouldn't know what "feed-back"/"feed-forward" ought to mean :)

Post

I'm back ! I have written some code, but that doesn't work as I want... I will try to explain what I have done, tell me I you think something is wrong... I have done something inspired by the "dynamics" section of "Digital Audio Signal Processing" by Udo Zolzer (1997).

*************************************************************
My compressor is working in stereo. I take the maximum of the absolute values of each channel, and I use this result to generate an RMS envelope with the following formula :

Code: Select all

maximum[n] = max(|input[1][n]|,|input[2][n]|)

xRMS[n] = square root of ((1 - TAV)*xRMS[n - 1] + TAV*maximum[n]^2)
with TAV = 1 - exp(-2.2 * Ts / tav).
I get the xRMS for each sample...

**************************************************************
Then, I apply the compression effect with a hard knee for the moment. I convert the xRMS into dB, I process, then I return into linear scale

Code: Select all

Xdb[n] = 20 * ln(xRMS[n]) / ln(10)
Ydb[n] = Tdb + (Xdb[n] - Tdb) / Ratio
y[n] = 10^(Ydb[n]/20)
*************************************************************
Finally, I must apply the attack/release adjustement with some filters. I calculate the constants TAT and TRE, and I do a comparaison between xRMS and the threshold to know if I must do an attack adjustement or a release adjustement...

Code: Select all

TAT = 1 - exp(-2.2 * TS / tat)
TRE = 1 - exp(-2.2 * TS / tre)

if (Xdb > Tdb) then Tc = TAT else Tc = TRE
env[n] = (1 - Tc)*env[n - 1] + Tc*y[n]

gain = env[n] / xRMS[n]
output[n] = input[n] * gain
**************************************************************

What is wrong on this ? I have tried to do firstly the attack/release adjustement and after the compression processing, but that still doesn't work. The compression is fine (but violent) when I don't use the attack/release filtering (I have the attenuation a bit higher of the threshold), with it I don't get what is expected...

Thanks for your help ;)

Post Reply

Return to “DSP and Plugin Development”