pub struct Adsr {
env: EnvRetrigADSR,
}
Expand description
A simple amplifier
Fields
env: EnvRetrigADSR
Implementations
sourceimpl Adsr
impl Adsr
pub fn new(_nid: &NodeId, _node_global: &NodeGlobalRef) -> Self
pub const inp: &'static str = "Signal input. If you don't connect this, and set this to **1.0** \ this will act as envelope signal generator. But you can also just \ route a signal directly through this of course."
pub const gate: &'static str = "Gate input that starts the attack phase and ends the sustain phase if it goes low."
pub const atk: &'static str = "Attack time of the envelope. You can extend the maximum \ range of this with the ~~mult~~ setting."
pub const dcy: &'static str = "Decay time of the envelope. \ You can extend the maximum range of this with the ~~mult~~ setting.\ "
pub const rel: &'static str = "Release time of the envelope. \ You can extend the maximum range of this with the ~~mult~~ setting.\ "
pub const sus: &'static str = "Sustain value. \ This is the value the decay phase goes to. \ Setting this to eg. **0.0** will make an AD envelope from this."
pub const ashp: &'static str = "Attack shape. This allows you to change the shape \ of the attack stage from a logarithmic, to a linear and to an \ exponential shape."
pub const dshp: &'static str = "Decay shape. This allows you to change the shape \ of the decay stage from a logarithmic, to a linear and to an \ exponential shape."
pub const rshp: &'static str = "Release shape. This allows you to change the shape \ of the release stage from a logarithmic, to a linear and to an \ exponential shape."
pub const mult: &'static str = "Attack and Decay time range multiplier. \ This will extend the maximum range of the ~~atk~~, ~~dcy~~ and ~~rel~~ parameters."
pub const sig: &'static str = "Envelope signal output. If a signal is sent to the 'inp' port, \ you will receive an attenuated signal here. If you set 'inp' to a \ fixed value (**for instance 1.0**), this will output an envelope signal \ in the range 0.0 to 'inp' (**1.0**)."
pub const eoet: &'static str = "End of envelope trigger output. This output \ sends a trigger pulse once the end of the decay stage has been reached."
pub const DESC: &'static str = r#"Attack-Decay Envelope This is an ADSR envelope, offering an attack time, decay time, a sustain phase and a release time. Attack, decay and release each have their own shape parameter. You can use it as envelope generator to modulate other inputs or process a signal with it directly. "#
pub const HELP: &'static str = r#"Attack-Decay Envelope This is an ADSR envelope, offering an attack time, decay time, a sustain phase and a release time. Attack, decay and release each have their own shape parameter. The ~~mult~~ setting allows you to multiply the times for the parameters and thus making really long envelopes possible. The ~~inp~~ can either be used to process a signal, or set the target output value of the envelope (**1.0** by default). In the latter case this node is just a simple envelope generator, with which you can generate control signals to modulate other inputs. You could for instance control a filter cutoff frequency and an `Amp` ~~att~~ parameter at the same time with this. With the ~~eoet~~ output you can either trigger other envelopes or via `FbWr`/`FbRd` retrigger the same envelope. You could also make a chain of multiple envelopes following each other. "#
pub fn graph_fun() -> Option<GraphFun>
Trait Implementations
sourceimpl DspNode for Adsr
impl DspNode for Adsr
sourcefn set_sample_rate(&mut self, srate: f32)
fn set_sample_rate(&mut self, srate: f32)
Updates the sample rate for the node.
sourcefn process(
&mut self,
ctx: &mut dyn NodeAudioContext,
_ectx: &mut NodeExecContext,
_nctx: &NodeContext<'_>,
atoms: &[SAtom],
inputs: &[ProcBuf],
outputs: &mut [ProcBuf],
ctx_vals: LedPhaseVals<'_>
)
fn process(
&mut self,
ctx: &mut dyn NodeAudioContext,
_ectx: &mut NodeExecContext,
_nctx: &NodeContext<'_>,
atoms: &[SAtom],
inputs: &[ProcBuf],
outputs: &mut [ProcBuf],
ctx_vals: LedPhaseVals<'_>
)
The code DSP function. Read more
Auto Trait Implementations
impl RefUnwindSafe for Adsr
impl Send for Adsr
impl Sync for Adsr
impl Unpin for Adsr
impl UnwindSafe for Adsr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more