AUDIO
Source snapshot · 12 October 2026

CLAP gain editor control bridge

Restore and automation ordering

Each queued edit carries the restore generation seen when it was submitted. A restore invalidates older queued values. Unstarted edits are discarded; if the host already accepted begin, end is still delivered without applying the stale value. An idle continuous gesture is also closed on the next scheduled callback after restore. Its later updates keep the original generation and are discarded until the main thread ends it and starts a new gesture. If restore occurs after an audio callback's initial snapshot, consumption is deferred until the next callback synchronizes the new DSP baseline. A restore racing an already accepted edit wins over stale reflection and is applied at the next boundary. Fewer than 2^31 restores may occur while an edit remains queued.

On audio process/active flush, accepted editor edits run before the incoming host stream. Host automation subsequently wins at its sample offsets. Accepted editor values are reflected independently before host-stream validation, so malformed host events do not undo edits already reported to the host. A newer restore always wins over reflection. On inactive flush, validated host input first publishes a new control generation, invalidating older queued edits, then remaining editor edits are delivered. The two consumers are never allowed to run concurrently.