pub struct GainCurve {
pub input_range: (f32, f32),
pub output_range: (f32, f32),
}Expand description
Piecewise-linear map from a modulator level to a gain scale.
§Examples
use axon_encoder::prelude::*;
// Map level 0..1 to gain 1..2 (identity at mid-point is 1.5).
let curve = GainCurve::new((0.0, 1.0), (1.0, 2.0));
assert!((curve.evaluate(0.5) - 1.5).abs() < 1e-5);Fields§
§input_range: (f32, f32)§output_range: (f32, f32)Implementations§
Trait Implementations§
impl Copy for GainCurve
impl StructuralPartialEq for GainCurve
Auto Trait Implementations§
impl Freeze for GainCurve
impl RefUnwindSafe for GainCurve
impl Send for GainCurve
impl Sync for GainCurve
impl Unpin for GainCurve
impl UnsafeUnpin for GainCurve
impl UnwindSafe for GainCurve
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