pub trait DspNode: Debug + Send {
fn set_sample_rate(&mut self, _srate: f32);
fn reset(&mut self);
fn process(
&mut self,
ctx: &mut dyn NodeAudioContext,
ectx: &mut NodeExecContext,
nctx: &NodeContext<'_>,
atoms: &[SAtom],
inputs: &[ProcBuf],
outputs: &mut [ProcBuf],
led: LedPhaseVals<'_>
);
}
Expand description
This trait represents a DspNode for the crate::matrix::Matrix
Required Methods
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],
led: LedPhaseVals<'_>
)
fn process(
&mut self,
ctx: &mut dyn NodeAudioContext,
ectx: &mut NodeExecContext,
nctx: &NodeContext<'_>,
atoms: &[SAtom],
inputs: &[ProcBuf],
outputs: &mut [ProcBuf],
led: LedPhaseVals<'_>
)
The code DSP function.
ctx
is the audio context, which informs the node about the number of samples to process. It also provides input/output ports for the in/out nodes.ectx
is the execution context, which provides global stuff for all nodes to potentially use. For instance it’s used by theFbWr
andFbRd
nodes to share an audio buffer.atoms
are un-smoothed parameters. they can hold integer settings, samples or even strings.params
are smoother paramters, those who usually have a knob associated with them.inputs
contain all the possible inputs. In contrast toparams
these inputs might be overwritten by outputs of other nodes.outputs
are the output buffers of this node.