Skip to Content
Soundor Skills

State, presets and compatibility

A reference of the soundor-plugin-architecture skill.

soundor-plugin-architecture reads this reference when a task needs it. Source on GitHub

What a host saves, how it comes back, and how to change a plugin people already use.

What a session holds

A DAW saves each plugin instance's parameters (as plain values, constrained to the current range and step when restored) and declared state, and restores both when the project opens, often before or without an editor. Not saved: streams, resources, controller stores, React state, History. soundor:storage is per machine and shared by all instances, never per session.

On restore:

  • every state field is installed, then subscribers hear the changes, then state.onRestored callbacks run;
  • History is cleared;
  • the processor sees restored parameters and audio state from its next block;
  • resources are not restored: republish them in prepare() (or from the controller) from what was restored.

Design so that a restore arriving at any time, with or without an editor, leaves the plugin consistent. Do not run expensive work for every field notification during a restore; react to onRestored instead.

Presets

  • Factory presets are presets in the config: an id, a name, and the parameter and state values that differ from the defaults. Each preset id is stable; their order is the VST3 program order.
  • Load them from the UI with soundor:presets, or from the controller. Loading is one History step when History is enabled.
  • A DAW saves and loads its own presets (including .vstpreset) as full plugin state. Saving user presets to files of the plugin's own is not a built-in feature: use soundor:fs if the plugin needs it.

History

The plugin has one History, shared by the UI and the controller: parameter and state edits with History enabled record entries; a gesture records one entry for the whole drag; transactions group several edits. Automation and restores never record. It holds up to 100 entries by default.

Changing a released plugin

ChangeEffect on existing sessionsDo instead
Rename a parameter id or state fieldvalue lost, automation lostkeep the id; change the label
Change plugin.idDAWs see a different pluginnever
Reorder or remove choice optionssaved index means another optionappend new options; keep old ones (label them "legacy")
Change a range, mapping or stepautomation (normalized) means other values; saved values outside the range are clampedadd a new parameter; leave the old one declared and ignored
Change a defaultaffects new instances onlyfine; say so in the changelog
Add a parameter or state fieldold sessions get its defaultchoose a default that sounds like the old behavior
Remove a parameterautomation of it disappearskeep it declared, ignore it, and hide it from the UI
Change the processingold sessions sound differentgate it behind a new mode or parameter whose default is old

Keep a test that restores a session saved by the previous release (an end-to-end test can save getState() output as a fixture) and checks what it sounds and shows like.

Instances

Two instances in one DAW share nothing but soundor:storage and the filesystem. Never keep mutable plugin data in Rust statics or module-level JavaScript variables that outlive an instance; use the controller's stores (per instance) or state.

On this page