Struct AdsrEnvelope
pub struct AdsrEnvelope { /* private fields */ }Expand description
ADSR envelope generator for controlling VCA/VCF.
Implementations§
§impl AdsrEnvelope
impl AdsrEnvelope
pub fn new(sample_rate: f64) -> AdsrEnvelope
pub fn new(sample_rate: f64) -> AdsrEnvelope
Create a new ADSR envelope.
pub fn set_attack(&mut self, time: f64)
pub fn set_attack(&mut self, time: f64)
Set attack time in seconds.
pub fn set_sustain(&mut self, level: f64)
pub fn set_sustain(&mut self, level: f64)
Set sustain level (0.0 - 1.0).
pub fn set_release(&mut self, time: f64)
pub fn set_release(&mut self, time: f64)
Set release time in seconds.
pub fn gate_on(&mut self)
pub fn gate_on(&mut self)
Trigger gate on (note on).
pub fn gate_off(&mut self)
pub fn gate_off(&mut self)
Trigger gate off (note off).
pub fn stage(&self) -> EnvelopeStage
pub fn stage(&self) -> EnvelopeStage
Get current stage.
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset envelope.
pub fn set_sample_rate(&mut self, sample_rate: f64)
pub fn set_sample_rate(&mut self, sample_rate: f64)
Update sample rate.
Trait Implementations§
§impl Clone for AdsrEnvelope
impl Clone for AdsrEnvelope
§fn clone(&self) -> AdsrEnvelope
fn clone(&self) -> AdsrEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AdsrEnvelope
impl RefUnwindSafe for AdsrEnvelope
impl Send for AdsrEnvelope
impl Sync for AdsrEnvelope
impl Unpin for AdsrEnvelope
impl UnsafeUnpin for AdsrEnvelope
impl UnwindSafe for AdsrEnvelope
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