Skip to main content

Processor

Trait Processor 

Source
pub trait Processor<T: Transcendental, const BUF_SIZE: usize>: SignalNode<T, BUF_SIZE> {
    // Required method
    fn process(
        &mut self,
        clock: &ClockTick,
        signal_inputs: &[&[T; BUF_SIZE]],
        control_inputs: &[T],
        clock_inputs: &[ClockTick],
        feedback_inputs: &[&[T; BUF_SIZE]],
    ) -> ProcessResult<()>;

    // Provided method
    fn latency(&self) -> usize { ... }
}
Expand description

Passive processor of signals

Processors transform input signals into output signals. They have audio inputs and outputs, and may have control and clock ports.

Required Methods§

Source

fn process( &mut self, clock: &ClockTick, signal_inputs: &[&[T; BUF_SIZE]], control_inputs: &[T], clock_inputs: &[ClockTick], feedback_inputs: &[&[T; BUF_SIZE]], ) -> ProcessResult<()>

Process a block of audio

§Arguments
  • clock - Current clock tick
  • signal_inputs - Audio input buffers (one per audio input)
  • control_inputs - Control signal values (one per control input)
  • clock_inputs - Clock signal values (one per clock input)
  • feedback_inputs - Feedback values from previous blocks (one per feedback port)

The processor writes output samples into its own output port buffers, accessible via self.output_port_mut(index).

Provided Methods§

Source

fn latency(&self) -> usize

Latency in samples (for delay compensation)

Trait Implementations§

Source§

impl<T, const BUF_SIZE: usize> Processable<T, BUF_SIZE> for Box<dyn Processor<T, BUF_SIZE>>
where T: Transcendental,

Source§

fn process_block( &mut self, ctx: &mut ProcessContext<'_, T, BUF_SIZE>, ) -> ProcessResult<()>

Process a single block of audio. Read more

Implementors§