ADR-0002 — The DSP core is a crate independent of the plugin framework

Status: accepted

Context: Rust plugin frameworks are young and change (Plugin formats). The model inference must also be callable from Julia tests and from offline tools.

Decision: crates/dsp holds all signal processing and model inference behind a plain Processor trait: prepare(sample_rate, max_block) (may allocate), reset(), event(Event) and render(left, right) (never allocate), is_active(). Sample-accurate timing is the caller’s job: it renders up to an event’s offset, applies the event, continues — so processors don’t depend on how a host slices blocks. It depends on no plugin framework, allocates only in prepare, and can build as a cdylib with a small C API.

Rejected alternative: DSP inside the plugin struct (simpler at first; ties every line to the framework and makes headless tests and the Julia bridge harder).

Consequences: Plugin crates are thin (parameters, GUI, glue). The DSP is testable with plain cargo test and benchmarkable without a host.