Controls
A reference of the soundor-plugin-design skill.
soundor-plugin-design reads this reference when a task needs it. Source on GitHub
Conventions users expect from every audio plugin, and how Soundor Components implement them (0.7; check the installed version's docs).
Binding
import { ControlGroup, Knob, Panel, Toggle } from '@soundor/components';
import { parameters } from 'soundor:parameters';
export function Tone() {
return (
<Panel title="Tone">
<ControlGroup>
<Knob parameter={parameters.drive} size="lg" />
<Knob parameter={parameters.tone} />
<Toggle parameter={parameters.bypass} />
</ControlGroup>
</Panel>
);
}A bound control takes its range, mapping, step, label, formatted text,
parser and reset value from the parameter, opens and closes host gestures,
and records History. For values that are not parameters, pass value,
onChange and a range, and keep the value in state or React state.
Check each component's props in its documentation for the installed version
(for example format, size, history, origin).
Labels, values and units
- Every control shows a label and its current value with unit, or shows the value on hover and focus when space is tight (never only on hover for the main controls).
- Values come from the parameter's
format(), so the UI and the DAW show the same text. - Avoid abbreviations users must decode; tooltips (
Tooltip) explain, they do not replace a label.
Interaction conventions
| Convention | Expectation | Components |
|---|---|---|
| Drag | vertical drag on a knob; along the track on sliders | built in |
| Fine adjustment | hold Shift | Shift: ten times finer on drag, wheel and keys |
| Reset to default | double-click or Alt/Option-click | both, plus Delete/Backspace |
| Exact entry | type a value | ValueField (double-click or Enter to type) |
| Wheel | small steps | 1 % per notch |
| Cancel a drag | Esc | restores the value from before |
| Context menu | right-click: reset, copy, type value, MIDI learn… | ContextMenu around a control |
| Keyboard | arrows, Page Up/Down, Home/End | 1 %, 10 %, min, max, along the mapping |
A custom control must match all of these; build it on the headless hooks
(@soundor/components/headless: useKnob, useSlider, useFader,
useValueField, useXYPad) rather than from raw pointer events.
Gestures
One drag is one host gesture: begin on press, end on release or cancel.
Bound Components do it. A custom control without the hooks calls
parameters.x.beginGesture() and endGesture() itself, on every exit path
(pointer up, pointer cancel, Esc, unmount).
Parameter types
- Bipolar values (pan, ±gain, tilt) fill from the centre: set the range
control's
originto the neutral value, and mark the centre. - Logarithmic values (frequency, time) use the parameter's
'log'mapping; the control follows it automatically. - Choices with few options are visible at once (
SegmentedControl); long lists go in aSelect. - Read-only values (meters, gain reduction) look different from editable ones and do not take drags.
Feedback
Show state changes immediately: pressed, focused (keyboard focus ring), disabled, bypassed. Bypass dims the processing section rather than hiding it.