pub struct EnvelopeGenerator {
pub state: State,
pub envelope_counter: u8,
pub exponential_counter: u8,
pub exponential_counter_period: u8,
pub hold_zero: bool,
pub rate_counter: u16,
pub rate_counter_period: u16,
/* private fields */
}Expand description
A 15 bit counter is used to implement the envelope rates, in effect dividing the clock to the envelope counter by the currently selected rate period. In addition, another counter is used to implement the exponential envelope decay, in effect further dividing the clock to the envelope counter. The period of this counter is set to 1, 2, 4, 8, 16, 30 at the envelope counter values 255, 93, 54, 26, 14, 6, respectively.
Fields§
§state: State§envelope_counter: u8§exponential_counter: u8§exponential_counter_period: u8§hold_zero: bool§rate_counter: u16§rate_counter_period: u16Implementations§
Source§impl EnvelopeGenerator
impl EnvelopeGenerator
pub fn get_attack_decay(&self) -> u8
pub fn get_control(&self) -> u8
pub fn get_sustain_release(&self) -> u8
pub fn set_attack_decay(&mut self, value: u8)
pub fn set_control(&mut self, value: u8)
pub fn set_sustain_release(&mut self, value: u8)
pub fn clock(&mut self)
pub fn clock_delta(&mut self, delta: u32)
pub fn output(&self) -> u8
pub fn read_env(&self) -> u8
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for EnvelopeGenerator
impl Clone for EnvelopeGenerator
Source§fn clone(&self) -> EnvelopeGenerator
fn clone(&self) -> EnvelopeGenerator
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 moreSource§impl Default for EnvelopeGenerator
impl Default for EnvelopeGenerator
impl Copy for EnvelopeGenerator
Auto Trait Implementations§
impl Freeze for EnvelopeGenerator
impl RefUnwindSafe for EnvelopeGenerator
impl Send for EnvelopeGenerator
impl Sync for EnvelopeGenerator
impl Unpin for EnvelopeGenerator
impl UnsafeUnpin for EnvelopeGenerator
impl UnwindSafe for EnvelopeGenerator
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