Skip to main content

PedalDef

Struct PedalDef 

Source
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: bool

When 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

Source

pub fn has_fx_loop(&self) -> bool

Returns true if this pedal has an FX send/return loop defined.

Source

pub fn primary_supply_voltage(&self) -> f64

Get the primary supply voltage (first supply, or default 9V). For backwards compatibility with single-supply code.

Source

pub fn get_supply(&self, name: &str) -> Option<&NamedSupply>

Get a supply by name.

Source

pub fn supply_names(&self) -> Vec<&str>

Get all supply rail names.

Source

pub fn is_supply_rail(&self, name: &str) -> bool

Check if a name is a supply rail.

Trait Implementations§

Source§

impl Clone for PedalDef

Source§

fn clone(&self) -> PedalDef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PedalDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PedalDef

Source§

fn eq(&self, other: &PedalDef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PedalDef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more