Expand description
Dependency-free utilities shared across the truce workspace.
cast- numeric-cast helpers for the audio-plugin → host FFI boundary (usize↔u32length casts, hostf64↔ DSPf32, discrete-index ↔ normalized).midi- MIDI value-domain normalize / denormalize between wire-native integers andf32ranges, plus the spec’s MIDI 1.0 ↔ MIDI 2.0 bit-replication bridges.shell_sidecar- sidecar-file path resolution shared bycargo-truce(writes the sidecar at install-time) and thetruce::plugin!macro (reads it at runtime to locate the logic dylib for hot-reload).state- the canonical plugin-state wire format, shared by the runtime (truce-corere-exports it) andcargo-truce’s install-time preset emitters.preset- the.trucepresetcontainer (metadata + state envelope), written at install time and read by format wrappers during host preset scans.presets- the preset library: scope roots, discovery walk, and thePresetStoremanagement API (re-exported astruce_core::presets).slugify- ASCII-safe filesystem / IRI slug used by the LV2 staging path and runtime bundle-name derivation.safe_filename- case-preserving sanitizer for plugin display names used as path components ({name}.aaxplugin,{name}.vst3, etc.). Replaces filesystem-reserved characters without lowercasing or collapsing words.
truce-core re-exports the modules above so consumers that pull
truce-core don’t need a second dependency. Crates that want to
avoid truce-core’s truce-params chain (notably cargo-truce)
depend on truce-utils directly.
Modules§
- cast
- Numeric-cast helpers for the audio-plugin → host FFI boundary.
- midi
- MIDI value-domain helpers: normalize / denormalize between
wire-native integers and
f32ranges. - preset
- The
.trucepresetcontainer - truce’s native on-disk preset file. - presets
- Preset library: scope roots, the filesystem walk, loading, and the management (CRUD) API.
- shell_
sidecar - Sidecar file that pins the
--shelllogic dylib path at install time. - state
- Canonical plugin-state wire format.
Functions§
- safe_
filename - Sanitize a plugin’s display name into a filesystem-safe form,
preserving case and spaces. Use this whenever the name is going
to land in a path component (
{name}.aaxplugin,{name}.vst3, the executable inside an AAXContents/MacOS/, etc.). The in-Info.plist / in-host-browser display name should keep using the rawnameso users still see “Truce Dry/Wet” in their DAW. - slugify
- Slug a plugin’s display name into a lowercase, hyphenated, ASCII-safe identifier suitable for filesystem paths, LV2 bundle names, and IRI components.