first let me say "sorry" for my bad english, but I will do my best.
Ok, I try to develop a limitet with an auto-release mode. It should work like the Waves L2 or Izotope Maximizer.
The limiter algo is a very simple one with an attack and release envelope. It has also a look-ahead buffer (creates a little latency) for smooth attacks. The limiter itself works fine.
What do I have to do to create a auto-release funktion? I read about peak-detection and read that transients should create short release times and period waves long release times. So how could i detect that?
Here is the limiter-code. I think that maybe several of You know that algorithm.
Code: Select all
const float in1 = sampleL;
const float in2 = sampleR;
const float rect1 = abs( in1 );
const float rect2 = abs( in2 );
float keyLink = rect1 > rect2 ? rect1 : rect2;
if ( keyLink < thresh.current )
keyLink = thresh.current;
if ( (++peakTimer >= peakHold) || (keyLink > maxPeak) )
{
peakTimer = 0;
maxPeak = keyLink;
}
// attack/release,
if ( maxPeak > env )
att.run( maxPeak, env );
else
rel.run( maxPeak, env );
const float gR = thresh.current / env;
const unsigned int delayIndex = ( cur - peakHold ) & mask;
const float delay1 = bufL[ delayIndex ];
const float delay2 = bufR[ delayIndex ];
bufL[ cur ] = in1;
bufR[ cur ] = in2;
cur++;
cur = cur & mask;
// output gain
outL = delay1 * gR;
outR = delay2 * gR;
T.