pub struct Compressor { /* private fields */ }Expand description
Linked-channel compressor with deterministic lookahead and soft attack/release.
The static curve is the one of Giannoulis, Massberg and Reiss (2012): with level x,
threshold T, ratio R and knee W in decibels, the gain is 0 dB while 2 (x - T) < -W,
(1/R - 1) (x - T + W/2)^2 / (2 W) while 2 |x - T| <= W, and T + (x - T) / R - x above.
Retuned (Processor::control), its threshold, ratio and knee and the linear gain of its
makeup move in a straight line from one control point’s values to the next’s.
Implementations§
Source§impl Compressor
impl Compressor
Sourcepub fn new(settings: CompressorSettings) -> Self
pub fn new(settings: CompressorSettings) -> Self
Creates a compressor.
Sourcepub const fn keyed(self) -> Self
pub const fn keyed(self) -> Self
Makes the level of a key drive the reduction instead of the program’s own: the inputs are then the program channels followed by matching key channels.
Sourcepub fn set_bypass(&mut self, bypass: bool)
pub fn set_bypass(&mut self, bypass: bool)
Enables latency-preserving bypass.
Trait Implementations§
Source§impl Clone for Compressor
impl Clone for Compressor
Source§impl Debug for Compressor
impl Debug for Compressor
Source§impl Processor for Compressor
impl Processor for Compressor
Source§fn inputs_per_output(&self) -> usize
fn inputs_per_output(&self) -> usize
The program, then the key when Compressor::keyed.
Source§fn control_params(&self) -> usize
fn control_params(&self) -> usize
The threshold in decibels, the ratio, the knee in decibels and the makeup gain in decibels.
Source§fn control(&mut self, span: &ControlSpan<'_>)
fn control(&mut self, span: &ControlSpan<'_>)
Self::process call without clearing signal history: that block
starts span.phase samples into a control interval and moves from the interval’s first
settings toward its last. Each value is clamped as the constructor clamps it. A steady
span of the values already in effect changes nothing; a span of fewer values than
Self::control_params is ignored.