pub struct AudioNode {Show 16 fields
pub id: NodeId,
pub node_type: AudioNodeType,
pub label: String,
pub enabled: bool,
pub x: f32,
pub y: f32,
pub phase: f32,
pub filter: BiquadFilter,
pub envelope: AdsrEnvelope,
pub lfo_state: Lfo,
pub delay_line: DelayLine,
pub reverb: Reverb,
pub chorus: Chorus,
pub compressor: Compressor,
pub last_peak: f32,
pub last_rms: f32,
/* private fields */
}Expand description
A node in the audio processing graph.
Fields§
§id: NodeId§node_type: AudioNodeType§label: String§enabled: bool§x: f32§y: f32§phase: f32§filter: BiquadFilter§envelope: AdsrEnvelope§lfo_state: Lfo§delay_line: DelayLine§reverb: Reverb§chorus: Chorus§compressor: Compressor§last_peak: f32§last_rms: f32Implementations§
Source§impl AudioNode
impl AudioNode
pub fn new(id: NodeId, node_type: AudioNodeType) -> Self
Sourcepub fn initialize(&mut self)
pub fn initialize(&mut self)
Initialize node state from its type parameters.
Sourcepub fn process(&mut self, inputs: &[&AudioBuffer]) -> AudioBuffer
pub fn process(&mut self, inputs: &[&AudioBuffer]) -> AudioBuffer
Process one buffer. inputs contains buffers from upstream nodes.
Sourcepub fn note_on(&mut self, _freq: f32, _velocity: f32)
pub fn note_on(&mut self, _freq: f32, _velocity: f32)
Note on event (triggers envelope, resets oscillator phase if desired).
pub fn note_off(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AudioNode
impl RefUnwindSafe for AudioNode
impl Send for AudioNode
impl Sync for AudioNode
impl Unpin for AudioNode
impl UnsafeUnpin for AudioNode
impl UnwindSafe for AudioNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.