Skip to main content

DspNode

Trait DspNode 

Source
pub trait DspNode: Send {
    // Required methods
    fn process(
        &mut self,
        inputs: &[Option<&[f32; 64]>; 8],
        output: &mut [f32; 64],
        params: &mut ParamBlock,
        sample_rate: f32,
    );
    fn type_name(&self) -> &'static str;

    // Provided methods
    fn capture_state(&self) -> StateBlob { ... }
    fn restore_state(&mut self, _state: StateBlob) { ... }
}
Expand description

The core DSP processing trait. Implementations MUST be real-time safe:

  • No allocation
  • No locks
  • No I/O
  • Bounded execution time

Required Methods§

Source

fn process( &mut self, inputs: &[Option<&[f32; 64]>; 8], output: &mut [f32; 64], params: &mut ParamBlock, sample_rate: f32, )

Process one buffer of audio.

inputs: resolved input buffer slices (None = silence). output: the node’s output buffer to fill. params: the node’s parameter block (pre-ticked by scheduler). sample_rate: current sample rate in Hz.

Source

fn type_name(&self) -> &'static str

Human-readable node type name (for serialization/UI).

Provided Methods§

Source

fn capture_state(&self) -> StateBlob

Capture internal state for continuity transfer.

Source

fn restore_state(&mut self, _state: StateBlob)

Restore internal state after a graph mutation.

Implementors§