Module process_context

Module process_context 

Source
Expand description

Transport and process context for audio plugins.

This module provides Transport for DAW timing/playback state and ProcessContext which bundles transport with sample rate and buffer size.

§Example: Tempo-Synced Effect

fn process(&mut self, buffer: &mut Buffer, _aux: &mut AuxiliaryBuffers, context: &ProcessContext) {
    // Calculate LFO rate synced to tempo
    let lfo_hz = if let Some(tempo) = context.transport.tempo {
        tempo / 60.0 / 4.0  // 1 cycle per 4 beats
    } else {
        2.0  // Fallback to 2 Hz
    };

    let samples_per_cycle = context.sample_rate / lfo_hz;
    // ...
}

Structs§

ProcessContext
Complete processing context for a single process() call.
Transport
Host transport and timing information.

Enums§

FrameRate
SMPTE frame rate for video synchronization.