Skip to main content

check_voltage_compatibility

Function check_voltage_compatibility 

Source
pub fn check_voltage_compatibility(
    pedal: &PedalDef,
    voltage: f64,
) -> Vec<VoltageWarning>
Expand description

Check a pedal definition for voltage compatibility at a given supply voltage.

Returns a list of warnings for components that may not tolerate the target voltage. These are heuristic — the DSL doesn’t carry voltage ratings, so we infer from component types and typical part specs:

  • Germanium transistors: Vce(max) typically 15–32V. Caution above 15V.
  • Electrolytic capacitors (≥ 1 µF): often rated 10–16V. Caution above 12V.
  • Op-amps: common audio opamps (TL072, NE5532) rated to ±18V (36V total). Caution above 18V.
  • Silicon transistors: usually Vce(max) ≥ 40V. Caution above 24V.
  • Germanium diodes: forward behaviour is voltage-independent, but reverse breakdown is lower (~50V Ge vs ~100V+ Si). Only flagged above 24V.

Note: passive elements (R, L) and silicon diodes are unaffected in the WDF model and are not flagged.