Architecture debugging
A reference of the soundor-debug-plugin skill.
soundor-debug-plugin reads this reference when a task needs it. Source on GitHub
Most "the plugin does nothing" bugs are wiring: a value is right on one side of a boundary and wrong, stale or absent on the other. Find the boundary by checking the value at each step.
A parameter has no effect on the audio
Follow it from the control to the samples:
- Declared? It is in
soundor.config.tsunderparameters, andnpx soundor gen --checkpasses. Restartdevafter config changes. - Does the UI set it? The control is bound (
parameter={parameters.x}) or callsparameters.x.set(). Check with the Driver: drag the control, then readplugin.parameter('Label').get(); or in a UI test,parameters.x.get()afteruserEvent. - Does the host see it?
launchHost(),parameter('Label').set(), thenget(): the value, text and range are as declared. - Does the processor read it?
ctx.params.xis used inprocess()(snake_case:wetMixisctx.params.wet_mix). A parameter only read inprepare()changes nothing until the next prepare. - Does it change the output? Process audio before and after setting
it (
host.process()), compare RMS. Remember the processor sees a new value from the next block, and smoothing delays the change.
The first step where the value is wrong is the bug.
UI and controller
- A native method rejects: the promise's error names the method and
carries the Rust
Errmessage or panic. Read thedevterminal. - A synchronous method blocks the UI: move slow work to an
async: truemethod andsoundor::unblockfor blocking calls. - State written in an async method is not visible: parameters, state and
History are reached through
ctx.schedule(|ctx| …)on the control thread, and the scheduled future must be awaited. - The controller cannot reach the processor's fields: data goes through
parameters,
audio: truestate, or resources. - In UI tests, native methods are mocked (
mockNative): a passing UI test says nothing about the Rust implementation; test it withTestController.
Controller and processor
- A resource never arrives: it is published after
prepare()only from the controller;get()isNoneuntil the first publication. Republish inprepare()from state so a reprepare or a new instance has it. - Audio state does not change the sound: the field needs
audio: true; changes arrive at the next block; arrays need amaxLengthand longer values are refused (try_setreturns why).
Streams and visualizations
- Nothing arrives: the processor publishes (
ctx.streams.x.publish(v), orbuffer_mut()thencommit(len); publishing more thanmaxLengthpublishes nothing and returnsfalse). In a UI test,publishStreamchecks the UI side alone. - Arrives but does not redraw:
useNativeStreamfor markup; for drawing,subscribe()in an effect and redraw the canvas, not React state. - Values look skipped: streams deliver the latest value at most once a frame by design; use a parameter or state for values that must all arrive.
State restore and automation
- Values lost after reopening a session: they lived in React state or the
controller's stores, which are not saved. Move them to
stateor a parameter. Test withgetState()/setState()onlaunchHost(). - Restored but the UI is stale: the UI must read current values
(
useParameter,useStateValue), and handlestate.onRestored. - Automation not shown: the UI keeps its own copy instead of subscribing.
- Automation recorded wrong: drags lack
beginGesture()/endGesture(), or end on only one exit path. - Old sessions sound different after an update: an id, choice order, range or mapping changed.
Native versus web
The web runtime supports one main input and output, mono or stereo, has no latency compensation, needs a user gesture before audio, and stores data in IndexedDB per plugin id. The UI layout is the engine's in both, but drawing differs (Skia versus the DOM), and fonts may differ. Compare the two with screenshots and with processed audio (a small tolerance for floating-point differences).
Lifecycle and host integration
- Works in the Soundor VST3 host but not in a DAW: check behavior with the editor closed, at the DAW's sample rate and block size, with several instances, and after the DAW reloads the project. Run pluginval on the release build.
- Works until the editor reopens: UI-side state (timers, subscriptions) restarts with each editor; keep lasting data in parameters or state.
- On Linux, the controller's scheduled work runs while an editor is open or the host lends its run loop: do not depend on it for audio.
Build and link failures
npx soundor doctor: a missing Rust target, linker, static C++ runtime or prebuilt adapter shows here.npx soundor gen, thencargo check --manifest-path lib/Cargo.toml: most "build" failures are Rust compile errors.- The full native log:
.soundor/dev/build.log(or the build's output). - Web builds compile the crate to
wasm32-unknown-unknown: a dependency that does not support it fails there only. Check its features. - Version mismatches:
soundorand@soundor/configmust be the same release; runtimes declare the CLI releases they support. Keep the versions the scaffolder chose, and upgrade them together.