pub struct PedalDef {Show 15 fields
pub name: String,
pub subtitle: Option<String>,
pub supplies: Vec<NamedSupply>,
pub components: Vec<ComponentDef>,
pub nets: Vec<NetDef>,
pub controls: Vec<ControlDef>,
pub trims: Vec<ControlDef>,
pub monitors: Vec<MonitorDef>,
pub sidechains: Vec<SidechainInfo>,
pub mirrors: HashMap<String, String>,
pub calibrate: bool,
pub subcircuits: Vec<SubcircuitDef>,
pub ports: Vec<PortDef>,
pub init_hints: Vec<InitHint>,
pub uses: Vec<UseInstance>,
}Expand description
Top-level pedal definition.
Fields§
§name: String§subtitle: Option<String>Optional subtitle for UI display (e.g., “Klon Centaur — transparent overdrive”)
supplies: Vec<NamedSupply>Power supply rails. Multiple named supplies are supported (e.g., V+, V-, B+). If empty, defaults to a single 9V “vcc” rail in the compiler.
components: Vec<ComponentDef>§nets: Vec<NetDef>§controls: Vec<ControlDef>§trims: Vec<ControlDef>Internal trim pots (not user-facing, factory adjustments)
monitors: Vec<MonitorDef>Monitor definitions for real-time metering visualization
sidechains: Vec<SidechainInfo>Sidechain definitions for feedback compression loops. Each entry defines a tap point, CV return, and modulation target.
mirrors: HashMap<String, String>Mirrored pot mappings: mirrored_pot_id → source_pot_id.
A mirrored pot’s position is always 1.0 - source.position.
Used for dual-gang pots where one gang tracks inversely.
calibrate: boolWhen true, auto-calibrate output level at compile time.
subcircuits: Vec<SubcircuitDef>Subcircuit definitions. When non-empty, the top-level components and
nets become the routing layer connecting subcircuits.
ports: Vec<PortDef>Named voltage port declarations (audio I/O, CV, gates, envelope taps).
Ports are voltage nodes in the circuit, drivable at audio rate.
When empty, implicit in/out ports are created by the compiler.
init_hints: Vec<InitHint>Optional initial NL device states from the init { ... } block.
Empty when no init block is present (the common case — all existing pedals).
Used by the compiler to seed the homotopy pre-convergence asymmetrically,
which is required for free-running oscillators (BJT astable multivibrators)
that would otherwise converge to a symmetric saddle point.
uses: Vec<UseInstance>File-based subcircuit instances declared via id: use("path.pedal")
inside the components { ... } block. These are FLATTENED into the
parent’s component/net/control lists by crate::dsl_expand::expand_uses
before compilation; the compiler never sees them. Empty for the common
case (no use(...) instances).
Implementations§
Source§impl PedalDef
impl PedalDef
Sourcepub fn has_fx_loop(&self) -> bool
pub fn has_fx_loop(&self) -> bool
Returns true if this pedal has an FX send/return loop defined.
Sourcepub fn primary_supply_voltage(&self) -> f64
pub fn primary_supply_voltage(&self) -> f64
Get the primary supply voltage (first supply, or default 9V). For backwards compatibility with single-supply code.
Sourcepub fn get_supply(&self, name: &str) -> Option<&NamedSupply>
pub fn get_supply(&self, name: &str) -> Option<&NamedSupply>
Get a supply by name.
Sourcepub fn supply_names(&self) -> Vec<&str>
pub fn supply_names(&self) -> Vec<&str>
Get all supply rail names.
Sourcepub fn is_supply_rail(&self, name: &str) -> bool
pub fn is_supply_rail(&self, name: &str) -> bool
Check if a name is a supply rail.