pub struct ToneFeedback {
pub b0: f64,
pub b1: f64,
pub a1: f64,
pub dc_gain: f64,
/* private fields */
}Expand description
First-order IIR filter derived from an inverting op-amp active high-shelf circuit (e.g. Klon Centaur treble control).
Coefficients are computed analytically from component values and updated when the pot position changes.
Fields§
§b0: f64§b1: f64§a1: f64§dc_gain: f64Implementations§
Source§impl ToneFeedback
impl ToneFeedback
Sourcepub fn new(
rf: f64,
ri: f64,
c_tone: f64,
r_shelf: f64,
max_pot_r: f64,
_pot_id: String,
sample_rate: f64,
pot_pos: f64,
) -> Self
pub fn new( rf: f64, ri: f64, c_tone: f64, r_shelf: f64, max_pot_r: f64, _pot_id: String, sample_rate: f64, pot_pos: f64, ) -> Self
Create a new ToneFeedback IIR from circuit component values.
§Arguments
rf— feedback resistor (Ω)ri— input resistor (Ω)c_tone— tone capacitor (F)r_shelf— shelf resistor in feedback path (Ω)max_pot_r— maximum pot resistance (Ω)_pot_id— pot label (for future binding, currently unused)sample_rate— sample rate (Hz)pot_pos— initial pot position in[0.0, 1.0]
Auto Trait Implementations§
impl Freeze for ToneFeedback
impl RefUnwindSafe for ToneFeedback
impl Send for ToneFeedback
impl Sync for ToneFeedback
impl Unpin for ToneFeedback
impl UnsafeUnpin for ToneFeedback
impl UnwindSafe for ToneFeedback
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more