SC3
A stereo compressor with sidechain input. Based on the code for SC1.
rms);
free(plugin_data->as);
]]>
env) {
env = env * ga + amp * (1.0f - ga);
} else {
env = env * gr + amp * (1.0f - gr);
}
if (count++ % 4 == 3) {
amp = rms_env_process(rms, sum * 0.25f);
sum = 0.0f;
if (isnan(env)) {
// This can happen sometimes, but I dont know why
env = 0.0f;
} else if (env <= knee_min) {
gain_t = 1.0f;
} else if (env < knee_max) {
const float x = -(threshold - knee - lin2db(env)) / knee;
gain_t = db2lin(-knee * rs * x * x * 0.25f);
} else {
gain_t = db2lin((threshold - lin2db(env)) * rs);
}
}
gain = gain * ef_a + gain_t * ef_ai;
buffer_write(left_out[pos], left_in[pos] * gain * mug);
buffer_write(right_out[pos], right_in[pos] * gain * mug);
}
plugin_data->sum = sum;
plugin_data->amp = amp;
plugin_data->gain = gain;
plugin_data->gain_t = gain_t;
plugin_data->env = env;
plugin_data->count = count;
]]>
Attack time (ms)
The attack time in milliseconds.
Release time (ms)
The release time in milliseconds.
Threshold level (dB)
The point at which the compressor will start to kick in.
Ratio (1:n)
The gain reduction ratio used when the signal level exceeds the threshold.
Knee radius (dB)
The distance from the threshold where the knee curve starts.
Makeup gain (dB)
Controls the gain of the makeup input signal in dB's.
Chain balance
Controls the chain signal used, 0 = Left+right in, 1 = Sidechain.
Sidechain
Left input
Right input
Left output
Right output