Struct Adsr Config
pub struct AdsrConfig { /* private fields */ }Expand description
Validated durations in prepared samples; sustain is linear amplitude 0..=1.
Implementations§
§impl AdsrConfig
impl AdsrConfig
pub fn new(
sample_rate: f64,
attack: f64,
decay: f64,
sustain: f64,
release: f64,
) -> Result<Self, EnvelopeError>
pub fn new( sample_rate: f64, attack: f64, decay: f64, sustain: f64, release: f64, ) -> Result<Self, EnvelopeError>
Durations are seconds, finite/nonnegative, rounded to nearest samples. Counts beyond u32::MAX reject. Construction is control-thread work; no envelope configuration changes happen implicitly in process.
Trait Implementations§
§impl Clone for AdsrConfig
impl Clone for AdsrConfig
§fn clone(&self) -> AdsrConfig
fn clone(&self) -> AdsrConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AdsrConfig
§impl Debug for AdsrConfig
impl Debug for AdsrConfig
§impl PartialEq for AdsrConfig
impl PartialEq for AdsrConfig
impl StructuralPartialEq for AdsrConfig
Auto Trait Implementations§
impl Freeze for AdsrConfig
impl RefUnwindSafe for AdsrConfig
impl Send for AdsrConfig
impl Sync for AdsrConfig
impl Unpin for AdsrConfig
impl UnsafeUnpin for AdsrConfig
impl UnwindSafe for AdsrConfig
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