# @euterpe/audio-engine

The real-time audio engine for the Euterpe DAW — the gate that was missing (all
DSP was previously delegated). Pure Rust DSP, unit-tested against known-correct
behavior, compiling to native (tests) and `wasm32` (the browser AudioWorklet).

## Crates

| Crate | Type | Responsibility |
|-------|------|----------------|
| `dsp-core` | rlib (pure) | Real-time-safe DSP primitives: oscillators (PolyBLEP), ADSR, RBJ biquad filters, dynamics, delay, reverb, EQ, mixer, meters. No alloc in the audio path, no I/O. |
| `dsp-graph` | rlib | *(next)* block-based real-time node graph hosting the primitives. |
| `dsp-wasm` | cdylib | *(next)* `wasm-bindgen` surface for the AudioWorklet. |

## Why it's testable

DSP is deterministic math, so correctness is asserted directly:
- a Butterworth low-pass is **−3 dB at its cutoff**, unity at DC, ~0 at Nyquist;
- a sine's RMS is **1/√2**; its frequency matches its zero-crossing rate;
- an ADSR reaches unity after the attack time and returns to 0 after release;
- a +6 dB peaking EQ has a center magnitude of **×2**.

```bash
# From libs/euterpe/audio-engine (bypasses Nx per the worktree rules):
cargo test --workspace      # DSP correctness
cargo fmt --all --check      # lint
cargo clippy --workspace     # lints
```
