truce-params
Parameter system for the truce audio plugin framework.
Overview
Provides the types and utilities for declaring, smoothing, and formatting
plugin parameters. Parameters are the primary interface between a plugin and
its host -- they drive automation, presets, and UI controls. Use this crate's
types inside your Params struct, then derive with #[derive(Params)].
Key types
FloatParam-- continuous floating-point parameter (with smoother)IntParam-- discrete integer parameter. Pick this overFloatParamwheneverrange = "discrete(...)"describes the parameter - the type expresses intent and skips the unused smoother state.BoolParam-- on/off toggle parameterEnumParam-- parameter backed by a Rust enum (via#[derive(ParamEnum)])ParamRange-- defines value ranges and mapping curves (linear, logarithmic, discrete)Smoother/SmoothingStyle-- per-sample parameter smoothing to avoid zipper noiseParamInfo-- metadata (name, unit label, flags) for host communicationFloat/Sample-- sealed traits overf32/f64that carry the cross-precision math methods (to_f32,to_f64,from_f32,from_f64, plusexp,log10,powf).SampleisFloat + Default + Send + Sync + 'static- the audio buffer element bound.FloatParamReadF32/FloatParamReadF64-- precision-routed read traits. The prelude brings one of them into scope as_;param.read()then returnsf32orf64directly without per-call-site annotation.
Example