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.
ctxis 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.ectxis the execution context, which provides global stuff for all nodes to potentially use. For instance it’s used by theFbWrandFbRdnodes to share an audio buffer.atomsare un-smoothed parameters. they can hold integer settings, samples or even strings.paramsare smoother paramters, those who usually have a knob associated with them.inputscontain all the possible inputs. In contrast toparamsthese inputs might be overwritten by outputs of other nodes.outputsare the output buffers of this node.