pub struct PedalboardProcessor { /* private fields */ }Expand description
Chains N CompiledPedal instances in series, with optional FX loop groups.
When impedance loading is enabled, interstage loading models are inserted between adjacent pedals to simulate the electrical interaction between source and load impedances.
Implementations§
Source§impl PedalboardProcessor
impl PedalboardProcessor
Sourcepub fn from_board(
board: &BoardDef,
board_dir: &Path,
sample_rate: f64,
) -> Result<Self, String>
pub fn from_board( board: &BoardDef, board_dir: &Path, sample_rate: f64, ) -> Result<Self, String>
Build a pedalboard from a parsed .board definition.
Each .pedal file is read relative to board_dir, compiled at the
given sample rate, and any knob overrides from the board file are applied.
If a pedal fails to load or compile, it is replaced with a dry passthrough slot and a warning is emitted to stderr. The board still loads — only the broken pedal is silent.
Sourcepub fn from_board_with_warnings(
board: &BoardDef,
board_dir: &Path,
sample_rate: f64,
) -> (Self, Vec<String>)
pub fn from_board_with_warnings( board: &BoardDef, board_dir: &Path, sample_rate: f64, ) -> (Self, Vec<String>)
Build a pedalboard, returning both the processor and any warnings.
Pedals that fail to read, parse, or compile are replaced with dry passthrough slots. The returned warnings describe each failure.
If a .global.board file is found (by walking up from board_dir),
its start pedals are prepended and end pedals are appended to
the signal chain.
Sourcepub fn from_board_with_resolver(
board: &BoardDef,
sample_rate: f64,
resolver: impl Fn(&str) -> Option<String>,
) -> (Self, Vec<String>)
pub fn from_board_with_resolver( board: &BoardDef, sample_rate: f64, resolver: impl Fn(&str) -> Option<String>, ) -> (Self, Vec<String>)
Build a pedalboard from a parsed .board definition, using a resolver
function instead of filesystem reads.
The resolver takes a pedal path string (as written in the .board file)
and returns the .pedal source text. This allows building boards from
include_str!’d sources without any filesystem access — useful for
embedded/factory boards in the VST plugin.
Global boards and FX loops are not supported in resolver mode (boards
referencing FX loops should use [from_board_with_warnings] instead).
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of pedals in the chain (flattened, including FX loop contents).
Sourcepub fn pedal_name(&self, index: usize) -> Option<&str>
pub fn pedal_name(&self, index: usize) -> Option<&str>
Get the name of pedal at the given flat index.
Sourcepub fn is_pedal_bypassed(&self, index: usize) -> bool
pub fn is_pedal_bypassed(&self, index: usize) -> bool
Check if a pedal is bypassed.
Sourcepub fn is_pedal_failed(&self, index: usize) -> bool
pub fn is_pedal_failed(&self, index: usize) -> bool
Check if a pedal slot failed to compile (dry passthrough).
Sourcepub fn set_interstage_loading(
&mut self,
junction_index: usize,
source: ImpedanceModel,
load: ImpedanceModel,
sample_rate: f64,
)
pub fn set_interstage_loading( &mut self, junction_index: usize, source: ImpedanceModel, load: ImpedanceModel, sample_rate: f64, )
Configure the impedance loading between two adjacent pedals.
junction_index is the junction between chain[junction_index] and
chain[junction_index + 1]. The source describes the output impedance
of the preceding pedal, and load describes the input impedance of
the following pedal.
This models the electrical interaction that causes real pedals to sound different depending on what’s connected before/after them. For example, a Fuzz Face after a buffered pedal sounds different than directly after a guitar, because its low input impedance loads the source differently.
Sourcepub fn input_impedance(&self) -> f64
pub fn input_impedance(&self) -> f64
Get the input impedance of the pedalboard (Ω).
Returns the input impedance of the first pedal in the chain. If the chain is empty or the first pedal has no processor, returns high-Z (1MΩ).
Sourcepub fn output_impedance(&self) -> f64
pub fn output_impedance(&self) -> f64
Get the output impedance of the pedalboard (Ω).
Returns the output impedance of the last pedal in the chain. If the chain is empty or the last pedal has no processor, returns low-Z (1kΩ).
Trait Implementations§
Source§impl PedalProcessor for PedalboardProcessor
impl PedalProcessor for PedalboardProcessor
Source§fn set_control(&mut self, label: &str, value: Wave)
fn set_control(&mut self, label: &str, value: Wave)
Control routing: "idx:label" dispatches to the appropriate pedal.
Indices are flat across the board — FX loop pedals are numbered sequentially after pedals before the loop. Special controls:
"idx:__bypass__"toggles bypass (value > 0.5 = bypassed)"fx_loop:mix"controls the FX loop wet/dry blend (first loop)"fx_loop_N:mix"controls the Nth FX loop’s mix (0-indexed)