Struct oxcable_basic_devices::adsr::Adsr [] [src]

pub struct Adsr {
    // some fields omitted
}

A multichannel ADSR filter.

Methods

impl Adsr

fn new(attack_time: f32, decay_time: f32, sustain_level: f32, release_time: f32, num_channels: usize) -> Self

Returns a new ADSR filter with the provided envelope settings.

  • attack_time specifies the length of the attack in seconds.
  • decay_time specifies the length of the decay in seconds.
  • sustain_level specifies the amplitude of the sustain from 0 to 1.
  • release_time specifies the length of the release in seconds.
  • num_channels defines how many channels of audio to filter.

fn default(num_channels: usize) -> Self

Returns an ADSR with reasonable default values for the envelope.

Trait Implementations

impl MessageReceiver for Adsr

type Msg = Message

fn handle_message(&mut self, msg: Message)

impl AudioDevice for Adsr

fn num_inputs(&self) -> usize

fn num_outputs(&self) -> usize

fn tick(&mut self, _: Time, inputs: &[Sample], outputs: &mut [Sample])