Parameters
A reference of the soundor-plugin-architecture skill.
soundor-plugin-architecture reads this reference when a task needs it. Source on GitHub
Parameters are the plugin's contract with the host. Read the installed
version's @soundor/config types for every field; this is how to choose.
Identity
- The key in
parametersis the id. Hosts derive the VST3 parameter id from it, and store automation and sessions by it. Pick short camelCase ids that describe the control (cutoff,attack,wetMix), and never rename one after release.labelis free to change. - For many similar controls (bands, voices), number them in the id
(
band1Gain,band2Gain) and generate the declarations in the config with a loop: the config is TypeScript. - Group related parameters with
parameterGroupsand each parameter'sgroup; hosts show VST3 units for them.
Types and ranges
| Value | Declare |
|---|---|
| Continuous (gain, frequency) | float32 with min, max, default, unit |
| Count (voices, steps) | an integer type; hosts space its values evenly |
| On/off | boolean |
| Mode | choice; options stored by index: append only |
- Store values in the unit the label shows: decibels as decibels, and convert to linear gain in the processor.
- Choose a range a user needs, not the widest possible: a narrow range gives finer automation resolution.
stepsnaps every write; the default must be on the grid.- 64-bit numbers are refused: hosts carry every parameter as a normalized 32-bit float.
Mappings
The host, a generic editor and a knob all work in normalized positions
0..1. mapping decides how a position becomes a value:
'log'for frequencies, times and ratios that span decades (minabove 0);{ type: 'power', exponent }to give one end more travel;{ type: 'symmetricPower', exponent }for bipolar controls with detail around the centre;'linear'otherwise; custom mappings only with both directions as expressions that invert each other.
Controls in the UI should move in normalized space
(toNormalized/fromNormalized) and show format(), so their travel and
text match the host's.
Text
Hosts show and parse text without the editor. Defaults derive decimals from
the step or range and append the unit. Custom format and parse are
expressions compiled for every runtime; each format needs a parse that
reads it back (the config check fails otherwise).
Access
'automatable': the default.'manual': hosts show it but do not automate it. Use for changes that reallocate, add latency, or click no matter what.'readOnly': written only by the processor throughctx.publish, about 30 times a second; the host and UI read it. Writing it from the UI throws.
Gestures and automation
- A drag is one gesture:
beginGesture()on press,set()while moving,endGesture()on release and on cancel. Gestures nest; only the outer pair reaches the host (VST3beginEdit/endEdit). - A click, a reset to default, or a choice change is a discrete
set()and gets a one-shot gesture automatically. set(updater)runs synchronously against the latest value.- DAW automation is input like any other: the UI must show values it did
not set, so read with
useParameter(orsubscribe), never keep a copy. - Automation never creates History entries.
Bypass
One writable boolean may declare role: 'bypass', which the VST3 runtime
exposes as the host's bypass. Declaring it changes nothing in the audio:
the processor implements bypass, ideally with a short crossfade, and with
any latency kept so the dry signal stays aligned.
In the processor
let gain_db = ctx.params.output; // f32, as declared
let mode = ctx.params.mode; // a generated enum in soundor::choices
ctx.publish.reduction(-3.5); // a read-only parameterCheck the generated soundor::config::Parameters and soundor::choices in
.soundor/generated/rust/soundor/src/ for the exact names.