Struct Adsr
pub struct Adsr { /* private fields */ }Expand description
Linear ADSR from the current level; retrigger does not reset to zero. The first processed sample advances the ramp; the last snaps to its target. Zero-duration stages transition immediately. Configuration replacement is explicit by constructing a new envelope. Sample/block/reset operations do not allocate. Voice lifetime and note-off/sustain policies belong to callers.
Implementations§
§impl Adsr
impl Adsr
pub fn new(config: AdsrConfig) -> Self
pub fn phase(&self) -> EnvelopePhase
pub fn level(&self) -> f64
pub fn reset(&mut self)
pub fn note_on(&mut self)
pub fn note_off(&mut self)
pub fn process_sample(&mut self) -> f64
pub fn process(&mut self, output: &mut [f64])
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Adsr
impl RefUnwindSafe for Adsr
impl Send for Adsr
impl Sync for Adsr
impl Unpin for Adsr
impl UnsafeUnpin for Adsr
impl UnwindSafe for Adsr
Blanket Implementations§
§impl<T> BorrowMut<T> for T
impl<T> BorrowMut<T> for T
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more