Expand description
The parameter registry of a synth: the key, range, unit and law of every control, with the provenance of each law.
A ParamSpec holds one control. Its Law converts between the
stored value in the preset file and a physical value in an E1 unit.
Laws never round: a non-integer stored value for a menu or a count is an
error, and choosing the nearest option belongs to the mapper.
Each law carries a Provenance: read from facts, measured on a render
or probe, or interim. A CalibrationSet replaces laws with measured
tables without a code change.
use sound_to_patch::preset::registry::{registry_for, Physical, UnitKind};
use sound_to_patch::synth::Synth;
let registry = registry_for(Synth::Vital)?;
let cutoff = registry.get("filter_1_cutoff").ok_or("no cutoff")?;
let stored = cutoff.stored(&Physical::parse(UnitKind::Hz, "261.6255653 Hz")?)?;
assert!((stored - 60.0).abs() < 1e-6);Structs§
- Build
- A synth build, such as
1.5.5. Each adapter defines what its text holds. - Calibration
Error - A calibration set that cannot load into a registry.
- Calibration
Set - The calibration tables of one synth.
- Calibration
Table - A measured law for one key, as a render or probe produced it.
- Custom
Law - A law an adapter implements itself, shared between registries.
- Param
Error - A conversion of one control that failed.
- Param
Spec - One control of a synth.
- Registry
- A registry built from a list of entries.
- Table
- A piecewise law through measured points. It never extrapolates.
- UnitLaw
- A unit and the law that converts stored values to it.
Enums§
- Interp
- How a
Tableinterpolates between its points. - Law
- The closed-form laws, a measured table and a law an adapter defines.
- Param
Kind - What a stored value is.
- Physical
- A physical value in one of the E1 unit types.
- Provenance
- Where the law of an entry comes from.
- Unit
Kind - The E1 unit type of a physical value.
Traits§
- Param
Law - A law between the stored value of a control and its physical value.
- Param
Registry - The parameter registry of one synth.
Functions§
- registry_
for - The registry of a synth.