Skip to content

armgit / nota

Public Imported from GitHub
0

Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.

(fix) No more clicks when filter knobs move fast

Egor Khindikaynen66fb3fccf6f7
diff --git a/.specify/bugs/filter-param-zipper/assessment.md b/.specify/bugs/filter-param-zipper/assessment.md
new file mode 100644
index 00000000..6be3246f
--- /dev/null
+++ b/.specify/bugs/filter-param-zipper/assessment.md
@@ -0,0 +1,143 @@
+# Bug Assessment: Clicks on fast Freq / Morph moves in Auto Filter, EQ-8 and Dynamic EQ-8
+
+- **Slug**: filter-param-zipper
+- **Created**: 2026-10-13
+- **Source**: pasted text (user report + a preliminary code read in the same session)
+- **Verdict**: valid
+- **Severity**: medium
+
+## Report (verbatim or summarized)
+
+> В Autofilter, eq-8, dynamic eq могут возникать щелчки при резком изменении freq или morph
+
+The preliminary read found these causes:
+1. Freq, Morph, Gain and Q are read once per audio block and not smoothed.
+2. The EQs use RBJ biquads, so a step in the coefficients produces a transient.
+3. Auto Filter's Morph is an instant crossfade between SVF outputs.
+4. Auto Filter's Mod Smooth smooths only the env/LFO modulation, not the Freq knob.
+
+## Symptom
+
+A fast move of the **Freq** knob (all three devices) or **Morph** (Auto Filter) makes an
+audible click or zipper noise. The same happens with **Gain** and **Q** in both EQs. The
+expected behaviour is that a fast knob move or a steep automation ramp sounds smooth, as in
+other DAWs.
+
+## Reproduction
+
+1. Put a sustained, bright or low-heavy source on a track, e.g. a saw pad or a bass with a lot of low end.
+2. Insert Nota Auto Filter (LP, Res around 0.5) and press Play.
+3. Flick Freq quickly from about 200 Hz to about 5 kHz, or drag Morph quickly from 0 to 1. Clicks are heard.
+4. Repeat with Nota EQ-8 and Nota Dynamic EQ-8 using a Bell band at +12 dB, Q 4. Sweep its
+ Freq quickly through 60–300 Hz, or step its Gain. Clicks are heard.
+5. The same should happen with a steep automation ramp on these parameters.
+ [NEEDS CLARIFICATION: not verified by ear; it follows from the code, since automation writes the same parameter atomics.]
+
+## Suspected Code Paths
+
+- `src/native/nota.engine/src/AutoFilter.h:187-191` — `baseHz`, `resBase` and `morph` are read
+ once per `process()` call (one audio block) and held constant for the whole block. A knob
+ move therefore reaches the DSP as a step at the block boundary.
+- `src/native/nota.engine/src/AutoFilter.h:269-277` — at the 16-sample control rate only the
+ *modulation* (`smOct_`, `smRes_`) is slewed by `smCoef`, and only when Mod Smooth > 0.
+ `baseHz` is applied unsmoothed.
+- `src/native/nota.engine/src/AutoFilter.h:482` — `y = y*(1-morph) + outs[next]*morph`.
+ A Morph step means an instant switch between two different signals (for example LP→BP), which is a waveform discontinuity.
+- `src/native/nota.engine/src/Eq.h:135-145` — the per-band biquad cascades are built once per
+ block from the raw Freq, Gain and Q (×Scale). The comment at :142 confirms that a frequency
+ move keeps the filter state and just swaps the coefficients.
+- `src/native/nota.engine/src/Eq.h:349-357` — `State::run` is a transposed direct form II biquad.
+ When its coefficients jump, the old `z1`/`z2` no longer match the new filter, so the output
+ jumps. This is worst at low f0, high Q and large gain, because the states there are large.
+- `src/native/nota.engine/src/DynamicEq.h:155-161, 183-185` — the same pattern: `f0`, `gStat`
+ and `q` are read once per block. The apply coefficients are refreshed every `kCtrl` = 16
+ samples (:215-220), but only for the dynamic gain term `dynDb_`, which is smoothed by
+ attack/release. The static Freq, Gain and Q still step at the block boundary.
+- `src/native/nota.engine/src/DynamicEq.h:174` — the detector band-pass `det[b]` also jumps
+ with Freq. That moment is inaudible, but it can make the dynamic gain twitch for a moment.
+- Precedent in the same code base: `Eq.h:160-162` already glides Output and Auto Gain
+ ("~20 ms, click-free"). The idea exists in the code; it just isn't applied to the filter parameters.
+
+Dynamic EQ-8 has no Morph parameter. There the report applies to Freq (and Gain/Q).
+
+## Root Cause Hypothesis
+
+**Confidence: high.** None of the three devices smooths its filter-shaping parameters on the
+audio thread. The UI/automation value is sampled once per block, so the DSP sees a step function.
+- **EQ-8 and Dynamic EQ-8**: a step in TDF-II biquad coefficients with the old state values
+ produces a transient whose size grows with resonance, gain and how low the frequency is.
+ This is the classic "zipper/click" of unsmoothed biquads.
+- **Auto Filter**: the TPT SVF itself is robust to coefficient changes, so a Freq step there
+ causes a brief tonal jump rather than a blow-up, but it is still audible at high
+ resonance. The Morph step is a hard crossfade jump, and this is the sharper click.
+- **Auto Filter's Mod Smooth** does not help, by design: it smooths only the env/LFO path.
+
+## Proposed Remediation
+
+**Preferred**: add per-parameter smoothing on the audio thread in all three devices and
+recompute coefficients from the *smoothed* values at the existing control rate (`kCtrl = 16`).
+
+- Smooth each parameter with a one-pole smoother of about 20 ms, matching the existing Output glide in `Eq.h`:
+ - **Freq** in log2 domain (octaves), so a sweep sounds even across the spectrum;
+ - **Gain** in dB, plus the EQ-8 **Scale**, applied to the scaled gain;
+ - **Q**, **Res** in log domain (or linear for Res, 0..1);
+ - **Morph**: linear (one-pole is fine) — evaluated **per sample** or per control block, since it is a cheap crossfade.
+- Smoother state is snapped to the target on first block, on `prepare`/sample-rate change and
+ on preset load. Apply the same `primed_` pattern as `Eq.h` so a freshly inserted
+ device doesn't sweep from a default value.
+- **Auto Filter**: smooth `baseHz` (octaves), `resBase` and `morph`. Fold the smoothed base into
+ the per-16-sample `fcL`/`fcR` computation, which already exists. No change to Mod Smooth semantics.
+- **EQ-8**: the cascade is currently built once per block. Move the build into a control-rate
+ refresh inside the sample loop, but only for bands whose smoothed values are still moving.
+ Skip the work once `|current − target|` is below an epsilon, so a static EQ costs the same as today.
+- **Dynamic EQ-8**: smooth `f0`, `gStat` and `q`, and include them in the existing 16-sample
+ refresh (it currently runs for dynamic bands only; extend it to any band that is gliding).
+ Rebuild the detector `det[b]` from the smoothed f0 as well.
+
+**Alternatives**:
+- **Switch both EQs from TDF-II biquads to a TPT SVF (Simper/Cytomic) formulation**, with the
+ same RBJ-equivalent responses for bell, shelf, HP, LP and notch. The SVF tolerates coefficient changes far better,
+ so it removes most of the residual zipper even under fast modulation. Trade-offs: a larger
+ rewrite of `coeffs()`/`cascade()`, including the 24/48 dB cascades and `averageDb`/curve drawing that read
+ `Coeffs`, plus re-verifying the EQ curves against the UI graph. It is worth doing if smoothing alone
+ still leaves audible artefacts at high Q and low f0. It can be a follow-up.
+- **Per-sample coefficient interpolation instead of control-rate recompute.** It is smoother still, but
+ costs more CPU (8 bands × up to 4 sections × 2 channels), and 16-sample steps of an already-smoothed
+ parameter are inaudible in practice. Not recommended.
+
+**Files likely to change**:
+- `src/native/nota.engine/src/AutoFilter.h`
+- `src/native/nota.engine/src/Eq.h`
+- `src/native/nota.engine/src/DynamicEq.h`
+- possibly a small shared helper (e.g. a `ParamSmoother` header next to them) if one does not already exist in the engine
+- `CHANGELOG.md` ([Unreleased] → Fixed)
+
+**Tests to add or update**:
+- A smoke test (`tests/Nota.SmokeTest`) per device: render a steady sine or saw through the device,
+ step Freq (and Morph for Auto Filter; Gain for the EQs) mid-render, and measure the
+ maximum sample-to-sample difference (or high-passed energy) around the step against a
+ no-step baseline. Assert that it stays within a small tolerance. A deterministic source is needed,
+ because synth notes drift (see the smoke-level-tests note): use a generated WAV or a sine.
+- A regression check that a *static* setting renders the same as before the change (level
+ within ±0.1 dB), so the smoothing does not change the steady-state response.
+- A check that a newly inserted device or a preset load does not audibly sweep (first block at target).
+
+## Risks & Considerations
+
+- **Feel / latency of controls**: a 20 ms glide is imperceptible as lag, but it slightly softens
+ intentional hard steps, e.g. stepped automation used as an effect. This is acceptable; other DAWs do the same.
+- **CPU**: recomputing EQ cascades every 16 samples while a band moves costs more than once per block.
+ It is bounded by the "only while gliding" gate, and the static cost is unchanged.
+- **Real-time safety**: smoother state must live in the device and be touched only on the
+ audio thread. No allocations or locks (CONTRIBUTING audio-thread rules).
+- **Type / Slope / Channel changes** in EQ-8 still reset the band state (`Eq.h:144`) and can
+ click. These are discrete switches and out of scope here, but worth noting. A short crossfade on type
+ change would be a separate improvement.
+- **UI curve and analyzer** read the parameters directly, not the smoothed values. This is fine (the UI
+ should show the target), but don't route the smoothed values back into the UI.
+- **Auto Gain in EQ-8** is re-measured from raw params. It already has its own 20 ms glide, so this needs no change.
+
+## Open Questions
+
+- [NEEDS CLARIFICATION: is the click also heard on *automation* playback, or only on manual knob moves? The code says both; worth confirming by ear after the fix.]
+- [NEEDS CLARIFICATION: should the SVF rewrite of the EQs be part of this fix, or a follow-up if smoothing alone is not enough? The preferred plan assumes a follow-up.]
diff --git a/.specify/bugs/filter-param-zipper/fix.md b/.specify/bugs/filter-param-zipper/fix.md
new file mode 100644
index 00000000..6a8a799a
--- /dev/null
+++ b/.specify/bugs/filter-param-zipper/fix.md
@@ -0,0 +1,98 @@
+# Bug Fix: Clicks on fast Freq / Morph moves in Auto Filter, EQ-8 and Dynamic EQ-8
+
+- **Slug**: filter-param-zipper
+- **Fixed**: 2026-10-13
+- **Assessment**: ./assessment.md
+- **Status**: applied
+
+## Summary
+
+The filter-shaping knobs now glide on the audio thread. A one-pole glide with a ~20 ms time constant
+moves Freq (in log2 Hz), Gain (in dB) and Q (in log2), and the coefficients are re-built from the
+gliding values every 16 samples while a knob moves. Morph in Auto Filter glides per sample.
+When a glide reaches its target it snaps to the exact value. A still knob therefore renders bit-identically
+to before, and a static EQ does no extra work.
+
+## Changes
+
+| File | Change | Notes |
+|------|--------|-------|
+| `src/native/nota.engine/src/AutoFilter.h` | modified | `glOct_`/`glRes_`/`glMorph_` glide toward Freq/Res/Morph. Freq and Res step once per 16-sample control block and feed the existing `fcL`/`fcR`/`resN` computation. Morph glides per sample inside the sample loop. `primed_` snaps on the first block after construction or `setSampleRate`. |
+| `src/native/nota.engine/src/Eq.h` | modified | Per band, `glF_`/`glG_`/`glQ_` hold the gliding values (Gain includes Scale). The cascade is built from the gliding values. While any band moves, the sample loop re-builds its cascade every `kCtrl` = 16 samples. Auto Gain is measured on the **target** cascade, not the mid-glide one. A band that just came on (`cfgKey_ < 0`) or a fresh device starts at its values. Slope is pinned per block (`sl[]`). |
+| `src/native/nota.engine/src/DynamicEq.h` | modified | The same glide for f0, the static gain and Q. Gliding bands step on the existing 16-sample refresh, and their apply coefficients are re-built together with the dynamic gain. The detector band-pass follows the gliding f0/Q. `wasOn_`/`primed_` make a band that just came on start without a glide. |
+| `tests/Nota.SmokeTest/FilterGlideTests.cs` | added test | Seven jump cases across the three devices (see below). |
+| `tests/Nota.SmokeTest/Program.cs` | modified | Wires `FilterGlideTests` into the full run, and adds a `--glide` entry next to `--grid`. |
+| `CHANGELOG.md` | modified | Adds a `[Unreleased]` → Fixed entry. |
+
+## Diff Highlights
+
+```cpp
+// Eq.h — the band glides; the cascade is re-built while it moves
+if (moving && --ctrl_ <= 0) {
+ ctrl_ = kCtrl;
+ ...
+ glF_[b] = settle(glF_[b] + (tF[b] - glF_[b]) * glideC, tF[b], 1e-5);
+ ...
+ cascade(c[b], ty[b], sl[b], sr, std::exp2(glF_[b]), glG_[b], std::exp2(glQ_[b]));
+}
+```
+
+```cpp
+// AutoFilter.h — Morph is a crossfade: glide it per sample
+glMorph_ = settle(glMorph_ + (morph - glMorph_) * glideS, morph, 1e-6);
+```
+
+## Tests Added or Updated
+
+`tests/Nota.SmokeTest/FilterGlideTests.cs::Run` plays steady tones (100 Hz + 1 kHz, a generated
+WAV) through the real engine and jumps one knob at a block boundary. It then checks that the
+output's peak 4th difference right after the jump is at most ×150 of the settled sound before
+and after the jump. The cases are:
+- Auto Filter: Freq 0.2→0.8 at Res 0.5, and Morph 0→1.
+- EQ-8: high cut Freq 600→8000 Hz at Q 4; bell Freq 1→4 kHz at +15 dB Q 8; 48 dB low cut Freq 40→300 Hz at Q 6.
+- Dynamic EQ-8: high cut Freq 600→8000 Hz at Q 4, and bell Gain 0→+15 dB.
+
+Results with the fix: ×20.2, ×3.8, ×13.3, ×1.7, ×1.0, ×7.7, ×1.1.
+
+## Local Verification
+
+**Standalone C++ harness** (`/tmp/fpz/harness.cpp`, not in the repo). It runs each device directly at
+44.1 kHz with 512-sample blocks and measures the peak 4th difference after a jump against the settled sound.
+
+| Case | Before | After |
+|---|---|---|
+| Auto Filter Freq 0.2→0.8, Res 0.7 | ×17 472 | ×44 |
+| Auto Filter Morph 0→1 | ×10 028 | ×7 |
+| EQ-8 bell Freq 80→250, +12 dB Q 4 | ×40 | ×1.3 |
+| EQ-8 bell Gain 0→+15 | ×22 | ×1.4 |
+| EQ-8 48 dB low cut 40→300, Q 6 | ×725 | ×9 |
+| EQ-8 bell Freq 1k→4k, +15 dB Q 8 | ×438 | ×4 |
+| EQ-8 high cut 600→8k, Q 8 | ×6 324 | ×75 |
+| Dynamic EQ-8 bell Freq / Gain | ×44 / ×35 | ×1.3 / ×1.3 |
+| Dynamic EQ-8 high cut 600→8k, Q 8 | ×4 148 | ×45 |
+
+- **Static renders** (no knob move) of Auto Filter, EQ-8 and Dynamic EQ-8 have the same RMS to 6 digits before and after. A ducking dynamic band also renders identically.
+- **Native engine**: `cmake --build src/native/nota.engine/build` passes. Building the harness with `-Wall -Wextra` gives no warnings from the changed headers.
+- **Smoke test**: `dotnet run --project tests/Nota.SmokeTest -c Release` → **SMOKE TEST PASSED** (0 failures, including the 7 new checks).
+- I did not run the new smoke test against the pre-fix engine. Other work-in-progress is uncommitted in the same tree, so I did not stash. The before numbers above come from the standalone harness, which runs the same device classes.
+
+## Deviations from Assessment
+
+- **Preset load is not snapped.** The assessment suggested snapping smoother state on preset load.
+ A preset arrives as plain `setParam` calls, so the device can't tell it from a knob move. A
+ 20 ms glide on a preset switch is click-free and harmless, so I left it. Snapping happens on device
+ creation, `setSampleRate`, and when a band turns on.
+- **Auto Filter Freq and Res still step per 16-sample control block** (the same rate the existing LFO and
+ envelope modulation uses), not per sample. The residual is ×44 against ×17 000 before. Making it
+ per sample would cost a `tan()` per sample per channel.
+- **First version of the smoke test used tones at 0.3.** A Q 8 resonance sweeping across them clipped the
+ engine's output at ±1, which looked like a click. The test now uses tones at 0.05 and Q 4 for the cuts.
+ This was a test artefact, not a DSP finding.
+
+## Follow-ups
+
+- If any zipper is still audible at extreme settings (high cut or low cut at Q 18 swept fast), consider
+ the TPT-SVF rewrite of the EQ sections from the assessment's alternatives.
+- In EQ-8, a Type, Slope or Channel change still resets the band state and can click. These are discrete
+ switches and out of scope here; a short crossfade on those changes would be a separate fix.
+- A listening check in the app: sweep the knobs by hand and play automation ramps.
diff --git a/.specify/bugs/filter-param-zipper/test.md b/.specify/bugs/filter-param-zipper/test.md
new file mode 100644
index 00000000..f8bc5857
--- /dev/null
+++ b/.specify/bugs/filter-param-zipper/test.md
@@ -0,0 +1,66 @@
+# Bug Verification: Clicks on fast Freq / Morph moves in Auto Filter, EQ-8 and Dynamic EQ-8
+
+- **Slug**: filter-param-zipper
+- **Tested**: 2026-10-13
+- **Assessment**: ./assessment.md
+- **Fix**: ./fix.md
+- **Result**: partial
+
+## Summary
+
+Measured in both the standalone DSP harness and the real engine, the click on a sudden knob jump is gone:
+- **Standalone harness**: the transient over the settled sound drops from ×22 – ×17 000 (HEAD) to ×1.3 – ×75 (fix).
+- **Real engine**: the new smoke test fails 4 of 7 cases on a pre-fix engine and passes 7 of 7 with the fix.
+- **Static renders** are unchanged.
+- **Full smoke suite** passes with 0 failures.
+
+The result is **partial**, not verified, for two reasons. The assessment's reproduction is a by-ear check in the running app, which was not done. Automation playback was not exercised either.
+
+## Checks Performed
+
+| Check | Command / Action | Result | Notes |
+|-------|------------------|--------|-------|
+| Reproduction, pre-fix vs post-fix (DSP) | `/tmp/fpz/harness.cpp` built twice: against `git show HEAD:` copies of the three headers, and against the working tree | pass | HEAD clicks: Auto Filter Freq ×17 472, Morph ×10 028; EQ-8 high cut ×6 324, 48 dB low cut ×725, bell 1k→4k ×438; Dynamic EQ-8 high cut ×4 148. Fix: ×44, ×7, ×75, ×9, ×4, ×45. Low bells ×22–44 → ×1.3. |
+| Static output unchanged | same harness, no knob move | pass | RMS identical to 6 digits for Auto Filter, EQ-8, Dynamic EQ-8 and a ducking dynamic band |
+| New test fails without the fix | Engine copy in `/tmp/fpz/eng` (working tree with the three headers reverted to HEAD), smoke binary run against it: `dotnet /tmp/fpz/binbase/Nota.SmokeTest.dll` | pass (fails as expected) | 4/7 FAIL: Auto Filter Freq ×3 329, Morph ×4 816; EQ-8 high cut ×518; Dynamic EQ-8 high cut ×296. 3/7 pass even pre-fix, see Residual Risks. The other 9 FAILs in that run are "repo root located", an artefact of running the binary from `/tmp`. |
+| New test passes with the fix | `dotnet run --project tests/Nota.SmokeTest -c Release` (filter knob glide section) | pass | ×20.2, ×3.8, ×13.3, ×1.7, ×1.0, ×7.7, ×1.1, all ≤ ×150 |
+| Regression suite | `cmake --build src/native/nota.engine/build` + `dotnet build tests/Nota.SmokeTest -c Release` + full smoke run | pass | 3182 PASS, 0 FAIL, `SMOKE TEST PASSED`. This ran on a tree that also holds another session's uncommitted work (`specs/004-default-project-template`). |
+| Full `scripts/build.sh` | — | not-run | Only the Release native build and the smoke test project were built. The universal `lipo` build and the whole `Nota.sln` build were not run. |
+| By-ear check in the app | manual knob sweeps and an automation ramp | not-run | The reproduction steps in the assessment are aural. Not performed in this session. |
+| Lint / type-check | `dotnet build` (warnings) | pass | No new warnings. The existing CS8602/CS0219 warnings are in untouched files. |
+
+## Output Excerpts
+
+```
+-- filter knob glide -- (pre-fix engine)
+ [FAIL] Auto Filter Freq jump glides without a click (jump ×3329,2 the settled sound, limit ×150)
+ [FAIL] Auto Filter Morph jump glides without a click (jump ×4815,6 the settled sound, limit ×150)
+ [FAIL] EQ-8 high cut Freq jump glides without a click (jump ×518,0 the settled sound, limit ×150)
+ [FAIL] Dynamic EQ-8 high cut Freq jump glides without a click (jump ×296,4 the settled sound, limit ×150)
+```
+```
+-- filter knob glide -- (fixed engine)
+ [PASS] … ×20,2 · ×3,8 · ×13,3 · ×1,7 · ×1,0 · ×7,7 · ×1,1 (limit ×150)
+SMOKE TEST PASSED
+```
+
+## Residual Risks
+
+- **Three test cases don't guard the fix.** EQ-8 bell Freq (×33.8 → ×1.7), EQ-8 48 dB low cut (×15.8 → ×1.0)
+ and Dynamic EQ-8 bell Gain (×16.6 → ×1.1) pass under the single ×150 limit even without the fix. A regression
+ there would go unnoticed. Per-case limits (e.g. ×10 for these, ×50 for the resonant sweeps) would close the gap.
+ That is a test change, outside this command.
+- Not heard in the app. Automation playback was not exercised, though it writes the same param atomics the test uses.
+- The residual ×44 – ×75 on resonant cuts in the harness is attributed to the resonance sweeping across the
+ test tone, plus 16-sample coefficient steps. That attribution is reasoned, not proven by ear.
+- Extreme settings (Q 18, very fast sweeps), other sample rates (only 44.1/48 kHz were checked) and EQ-8
+ Type/Slope/Channel switches were not covered. The last one is out of scope.
+
+## Recommendation
+
+Hold before closing:
+1. Sweep Freq/Morph by hand and play a steep automation ramp on each device. This turns the result into **verified**.
+2. Optionally tighten the smoke-test limits per case so all seven cases guard the fix.
+3. Run `scripts/build.sh` before the PR.
+
+The DSP evidence is strong and nothing regressed, so no re-assessment is needed.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5c473cf..ecae9ea0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -64,6 +64,10 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.
The browser also opens wider by default.
### Fixed
+- **No more clicks when you move filter knobs fast:** quickly turning Freq or Morph on Auto
+ Filter, or Freq, Gain or Q on EQ-8 and Dynamic EQ-8, could make a click. Steep automation
+ on these knobs could too. The knobs now glide to the new value over a few milliseconds,
+ so the sound changes smoothly. A knob you leave alone sounds exactly as before.
- **Plug-in search in Downloads no longer crashes:** typing a search that matched nothing
and then erasing it with Backspace threw an error instead of bringing the list back.
- **Long audio files no longer stall the app:** after dropping a long file (a multi-minute
diff --git a/src/native/nota.engine/src/AutoFilter.h b/src/native/nota.engine/src/AutoFilter.h
index 5b715cff..4e0d2da4 100644
--- a/src/native/nota.engine/src/AutoFilter.h
+++ b/src/native/nota.engine/src/AutoFilter.h
@@ -8,6 +8,8 @@
// a sidechain source) and an LFO (rate free or tempo-synced / amount / wave incl.
// sample-&-hold / morph / start phase / stereo phase / retrigger). Mod Smooth slews the
// modulation. A pre-filter Drive stage adds colour; Analog saturates; Dry/Wet blends.
+// Freq, Res and Morph themselves glide (~20 ms) so a fast knob move or automation step
+// doesn't click; a fresh device or a sample-rate change starts at the set values.
//
// A core Device (JUCE-free), lock-free params. All params are normalized 0..1 and
// denormalized in process(); persistence/automation/clone flow generically. Param order
@@ -127,6 +129,7 @@ public:
for (auto& s : svf_) s.reset();
env_ = 0.0f; lfoPhase_ = 0.0; shHeld_ = 0.0f; shCycle_ = -1.0;
smOct_ = smRes_ = 0.0; holdLeft_ = 0; armed_ = true;
+ primed_ = false;
histAcc_ = 0.0; histEnvMax_ = 0.0f;
srA_.store(static_cast<float>(sr_), std::memory_order_relaxed);
}
@@ -185,10 +188,10 @@ public:
void process(float* buf, int32_t frames) override {
const auto t0 = std::chrono::steady_clock::now();
const double baseHz = expMap(get(Freq), 30.0, 18000.0);
- const float resBase = std::clamp(get(Res), 0.0f, 1.0f);
+ const double resBase = std::clamp(get(Res), 0.0f, 1.0f);
const int type = std::clamp((int)std::lround(get(Type) * 3.0f), 0, 3);
const bool slope24 = get(Slope) >= 0.5f;
- const float morph = std::clamp(get(Morph), 0.0f, 1.0f);
+ const double morph = std::clamp(get(Morph), 0.0f, 1.0f);
const bool envOn = get(EnvOn) >= 0.5f;
const double envBip = envOn ? ((double)get(EnvAmt) - 0.5) * 2.0 : 0.0; // −1..1
const float attMs = (float)expMap(get(EnvAtt), 0.1, 500.0);
@@ -211,6 +214,10 @@ public:
const double smMs = 120.0 * (double)get(ModSmooth) * (double)get(ModSmooth);
const double smCoef = smMs < 0.05 ? 0.0 : std::exp(-(double)kCtrl / (smMs * 0.001 * sr_));
const double offset = (double)std::clamp(get(LfoOffset), 0.0f, 1.0f);
+ const double baseOct = std::log2(baseHz);
+ const double glide = 1.0 - std::exp(-(double)kCtrl / (kGlideS * sr_)); // per control block
+ const double glideS = 1.0 - std::exp(-1.0 / (kGlideS * sr_)); // per sample (Morph)
+ if (!primed_) { glOct_ = baseOct; glRes_ = resBase; glMorph_ = morph; primed_ = true; }
const bool retrig = get(LfoRetrig) >= 0.5f;
// Per-sample envelope coefficients (one-pole).
@@ -264,9 +271,13 @@ public:
smOctR_ = rawR + smCoef * (smOctR_ - rawR);
smRes_ = rawRes + smCoef * (smRes_ - rawRes);
- const double fcL = std::clamp(baseHz * std::exp2(toFreq ? smOct_ : 0.0), 20.0, nyq);
- const double fcR = std::clamp(baseHz * std::exp2(toFreq ? smOctR_ : 0.0), 20.0, nyq);
- const double resN = std::clamp((double)resBase + (toRes ? smRes_ : 0.0), 0.0, 1.0);
+ // The knobs glide toward their targets (snapping once there, so a still knob is exact).
+ glOct_ = settle(glOct_ + (baseOct - glOct_) * glide, baseOct, 1e-5);
+ glRes_ = settle(glRes_ + (resBase - glRes_) * glide, resBase, 1e-6);
+
+ const double fcL = std::clamp(std::exp2(glOct_ + (toFreq ? smOct_ : 0.0)), 20.0, nyq);
+ const double fcR = std::clamp(std::exp2(glOct_ + (toFreq ? smOctR_ : 0.0)), 20.0, nyq);
+ const double resN = std::clamp(glRes_ + (toRes ? smRes_ : 0.0), 0.0, 1.0);
const double k = 1.0 / (0.5 + resN * 14.5);
const double gL = std::tan(3.14159265358979323846 * fcL / sr_);
const double a1L = 1.0 / (1.0 + gL * (gL + k)), a2L = gL * a1L, a3L = gL * a2L;
@@ -295,8 +306,10 @@ public:
} else env_ = det + rCoef * (env_ - det);
if (env_ > 1.0f) env_ = 1.0f;
- buf[i * 2] = filterOne(0, l, drive, driveGain, driveComp, type, morph, (float)k, a1L, a2L, a3L, slope24, wet, outGain, analog);
- buf[i * 2 + 1] = filterOne(1, r, drive, driveGain, driveComp, type, morph, (float)k, a1R, a2R, a3R, slope24, wet, outGain, analog);
+ glMorph_ = settle(glMorph_ + (morph - glMorph_) * glideS, morph, 1e-6); // a crossfade: glide per sample
+ const float morphNow = (float)glMorph_;
+ buf[i * 2] = filterOne(0, l, drive, driveGain, driveComp, type, morphNow, (float)k, a1L, a2L, a3L, slope24, wet, outGain, analog);
+ buf[i * 2 + 1] = filterOne(1, r, drive, driveGain, driveComp, type, morphNow, (float)k, a1R, a2R, a3R, slope24, wet, outGain, analog);
outPk = std::max(outPk, std::max(std::fabs(buf[i * 2]), std::fabs(buf[i * 2 + 1])));
}
@@ -434,6 +447,9 @@ public:
private:
static constexpr int32_t kCtrl = 16; // control-rate block for coefficient updates
+ static constexpr double kGlideS = 0.02; // Freq / Res / Morph glide time constant
+
+ static double settle(double v, double target, double eps) { return std::fabs(v - target) < eps ? target : v; }
float get(int i) const { return p_[i].load(std::memory_order_relaxed); }
static double expMap(float v, double lo, double hi) { return lo * std::pow(hi / lo, std::clamp((double)v, 0.0, 1.0)); }
@@ -506,6 +522,8 @@ private:
double lfoPhase_ = 0.0;
double anchorBeat_ = 0.0; // synced LFO restarts here after a retrig
double smOct_ = 0.0, smOctR_ = 0.0, smRes_ = 0.0; // smoothed modulation
+ double glOct_ = 0.0, glRes_ = 0.0, glMorph_ = 0.0; // gliding knobs: log2 Hz, 0..1, 0..1
+ bool primed_ = false; // the glides start at the set values
float shHeld_ = 0.0f;
double shCycle_ = -1.0; // last synced S&H cycle index
double beatStart_ = 0.0, spb_ = 0.0; // transport (for LFO sync)
diff --git a/src/native/nota.engine/src/DynamicEq.h b/src/native/nota.engine/src/DynamicEq.h
index b0b0bd44..010aec53 100644
--- a/src/native/nota.engine/src/DynamicEq.h
+++ b/src/native/nota.engine/src/DynamicEq.h
@@ -18,7 +18,8 @@
// upward expansion, a Lift that cuts is downward expansion). The detector reaches full
// engagement 6 dB past the threshold. Only shelves and bells take dynamic gain. Dynamics (a
// master switch) parks every band on its static gain at once — an A/B of what the dynamics do.
-// Solo auditions one band alone.
+// Solo auditions one band alone. Freq, Gain and Q glide (~20 ms) so a fast knob move or an
+// automation step doesn't click; a band that just came on starts at its set values.
//
// Params are the device's raw units (not 0..1) and APPEND ONLY: 0..79 are the eight bands
// (10 fields each: On, Type, Freq, Gain, Q, Mode, Thr, Rng, Atk, Rel), 80 Output, 81
@@ -117,6 +118,7 @@ public:
for (auto& ch : s_) for (auto& st : ch) st = {};
for (auto& st : detState_) st = {};
for (int b = 0; b < kBands; ++b) { detEnv_[b] = 0.0; dynDb_[b] = 0.0; lvlDisp_[b] = -120.0; }
+ primed_ = false;
inPk_ = outPk_ = 0.0f;
fftN_ = sr_ > 50000.0 ? 8192 : 4096;
size_t ring = 1;
@@ -151,14 +153,16 @@ public:
bool on[kBands], dyn[kBands], hasGain[kBands], ext[kBands];
int mode[kBands], type[kBands];
double f0[kBands], gStat[kBands], q[kBands], thr[kBands], range[kBands], atkC[kBands], relC[kBands];
+ double tF[kBands], tG[kBands], tQ[kBands]; // glide targets: log2 Hz, dB, log2 Q
+ bool glMoving[kBands] = {}, moving = false;
Coeffs det[kBands];
for (int b = 0; b < kBands; ++b) {
on[b] = bp(b, On) > 0.5f;
type[b] = typeOf(b);
hasGain[b] = (type[b] == LowShelf || type[b] == Bell || type[b] == HighShelf);
- f0[b] = clampd(bp(b, Freq), 20.0, sr * 0.49);
- gStat[b] = clampd(bp(b, Gain), -18.0, 18.0);
- q[b] = clampd(bp(b, Q), 0.1, 18.0);
+ tF[b] = std::log2(clampd(bp(b, Freq), 20.0, sr * 0.49));
+ tG[b] = clampd(bp(b, Gain), -18.0, 18.0);
+ tQ[b] = std::log2(clampd(bp(b, Q), 0.1, 18.0));
mode[b] = modeOf(b);
thr[b] = clampd(bp(b, Thresh), -60.0, 6.0);
range[b] = clampd(bp(b, Range), -18.0, 18.0);
@@ -167,12 +171,21 @@ public:
atkC[b] = 1.0 - std::exp(-1.0 / (atkMs * 0.001 * sr));
relC[b] = 1.0 - std::exp(-1.0 / (relMs * 0.001 * sr));
ext[b] = sc && (allExt || get(KeyBase + b) >= 0.5f);
- det[b] = bandpass(sr, f0[b], std::max(q[b], 0.5));
}
// Solo: audition a single band (mute the rest, force the soloed one on).
const int solo = std::clamp(static_cast<int>(std::lround(get(Solo))), 0, kBands) - 1;
if (solo >= 0)
for (int b = 0; b < kBands; ++b) on[b] = (b == solo);
+ // Freq / Gain / Q glide toward the knobs; a band that just came on starts at its values.
+ for (int b = 0; b < kBands; ++b) {
+ if (on[b] && (!primed_ || !wasOn_[b])) { glF_[b] = tF[b]; glG_[b] = tG[b]; glQ_[b] = tQ[b]; }
+ wasOn_[b] = on[b];
+ if (on[b]) moving |= glMoving[b] = glF_[b] != tF[b] || glG_[b] != tG[b] || glQ_[b] != tQ[b];
+ f0[b] = std::exp2(glF_[b]); gStat[b] = glG_[b]; q[b] = std::exp2(glQ_[b]);
+ det[b] = bandpass(sr, f0[b], std::max(q[b], 0.5));
+ }
+ primed_ = true;
+ const double glideC = 1.0 - std::exp(-(double)kCtrl / (kGlideS * sr)); // per control step
for (int b = 0; b < kBands; ++b) {
dyn[b] = dynMaster && on[b] && hasGain[b] && mode[b] != DynOff;
if (!dyn[b]) dynDb_[b] = 0.0; // parked bands read flat
@@ -191,10 +204,27 @@ public:
const bool ringOk = !ring_.empty();
int ctrl = 0;
+ bool glStepped[kBands] = {};
for (int32_t i = 0; i < frames; ++i) {
const float l = buf[i * 2], r = buf[i * 2 + 1];
inPk = std::max(inPk, std::max(std::fabs(l), std::fabs(r)));
+ // --- gliding bands: step Freq / Gain / Q (refreshed with the dynamic gain below) ---
+ const bool step = ctrl <= 1;
+ if (step && moving) {
+ moving = false;
+ for (int b = 0; b < kBands; ++b) {
+ if (!on[b] || !glMoving[b]) continue;
+ glF_[b] = settle(glF_[b] + (tF[b] - glF_[b]) * glideC, tF[b], 1e-5);
+ glG_[b] = settle(glG_[b] + (tG[b] - glG_[b]) * glideC, tG[b], 1e-4);
+ glQ_[b] = settle(glQ_[b] + (tQ[b] - glQ_[b]) * glideC, tQ[b], 1e-5);
+ f0[b] = std::exp2(glF_[b]); gStat[b] = glG_[b]; q[b] = std::exp2(glQ_[b]);
+ det[b] = bandpass(sr, f0[b], std::max(q[b], 0.5));
+ moving |= glMoving[b] = glF_[b] != tF[b] || glG_[b] != tG[b] || glQ_[b] != tQ[b];
+ glStepped[b] = true;
+ }
+ }
+
// --- detection + per-band dynamic gain ---
const double self = 0.5 * (l + r);
const double key = sc ? 0.5 * (sc[i * 2] + sc[i * 2 + 1]) * scGain : 0.0;
@@ -216,7 +246,7 @@ public:
if (--ctrl <= 0) {
ctrl = kCtrl;
for (int b = 0; b < kBands; ++b)
- if (dyn[b]) cf[b] = coeffs(type[b], sr, f0[b], gStat[b] + dynDb_[b], q[b]);
+ if (dyn[b] || glStepped[b]) { cf[b] = coeffs(type[b], sr, f0[b], gStat[b] + dynDb_[b], q[b]); glStepped[b] = false; }
}
// --- apply cascade, both channels ---
@@ -411,6 +441,7 @@ public:
private:
static constexpr double kPi = 3.14159265358979323846;
static constexpr int kCtrl = 16; // control-rate coeff refresh (samples)
+ static constexpr double kGlideS = 0.02; // Freq / Gain / Q glide time constant
static constexpr double kKneeDb = 6.0; // detection range from threshold to full engagement
struct Coeffs { double b0 = 1, b1 = 0, b2 = 0, a1 = 0, a2 = 0; };
@@ -449,6 +480,7 @@ private:
}
static double clampd(double v, double lo, double hi) { return v < lo ? lo : (v > hi ? hi : v); }
+ static double settle(double v, double target, double eps) { return std::fabs(v - target) < eps ? target : v; }
static float db(float lin) { return lin > 1e-6f ? 20.0f * std::log10(lin) : -120.0f; }
static Coeffs normC(double b0, double b1, double b2, double a0, double a1, double a2) {
return {b0 / a0, b1 / a0, b2 / a0, a1 / a0, a2 / a0};
@@ -547,6 +579,9 @@ private:
State detState_[kBands] = {}; // detector bandpass state (mono)
double detEnv_[kBands] = {}; // detector envelope (linear)
double dynDb_[kBands] = {}; // smoothed dynamic gain per band (dB)
+ double glF_[kBands] = {}, glG_[kBands] = {}, glQ_[kBands] = {}; // gliding Freq (log2 Hz) / Gain (dB) / Q (log2)
+ bool wasOn_[kBands] = {}; // band was on last block (a fresh band doesn't glide in)
+ bool primed_ = false;
double lvlDisp_[kBands] = {}; // peak-held detector level (dB)
std::atomic<float> gr_[kBands]; // published momentary gain (dB)
std::atomic<float> lvlA_[kBands]; // published detector level (dBFS)
diff --git a/src/native/nota.engine/src/Eq.h b/src/native/nota.engine/src/Eq.h
index 98bee3c6..105017a4 100644
--- a/src/native/nota.engine/src/Eq.h
+++ b/src/native/nota.engine/src/Eq.h
@@ -14,8 +14,10 @@
//
// RBJ biquads. A 12 dB/oct cut is one biquad at the band's Q (the original EQ-8); 24 and 48
// dB/oct are Butterworth cascades of two / four sections whose last, sharpest section carries
-// the resonance (Q / 0.707). Coefficients are recomputed per block from atomic params, so
-// setParam stays lock-free; a band whose slope or channel changes starts from a clean state.
+// the resonance (Q / 0.707). Coefficients come from atomic params, so setParam stays
+// lock-free; a band whose slope or channel changes starts from a clean state. Freq, Gain (×
+// Scale) and Q glide (~20 ms, re-built every kCtrl samples while moving) so a fast knob move
+// or automation step doesn't click; a band that just came on starts at its set values.
//
// Params are the device's raw units and APPEND ONLY: 0..39 are the original layout (8 bands ×
// On, Type, Freq, Gain, Q), then 40..47 "n Slope" (0 = 12, 1 = 24, 2 = 48 dB/oct), 48..55 "n
@@ -130,15 +132,22 @@ public:
// Per-band config + coefficient cascades, once per block.
bool on[kBands];
- int ty[kBands], ch[kBands], nSec[kBands];
+ int ty[kBands], ch[kBands], sl[kBands], nSec[kBands];
+ double tF[kBands], tG[kBands], tQ[kBands]; // glide targets: log2 Hz, dB, log2 Q
+ bool moving = false;
Coeffs c[kBands][kMaxSec];
for (int b = 0; b < kBands; ++b) {
on[b] = bandOn(b);
if (!on[b]) { cfgKey_[b] = -1; continue; }
ty[b] = typeOf(b);
ch[b] = channelOf(b);
- nSec[b] = cascade(c[b], ty[b], slopeOf(b), sr, clampd(bp(b, Freq), 20.0, sr * 0.49),
- clampd(bp(b, Gain), -18.0, 18.0) * scale, clampd(bp(b, Q), 0.1, 18.0));
+ sl[b] = slopeOf(b);
+ tF[b] = std::log2(clampd(bp(b, Freq), 20.0, sr * 0.49));
+ tG[b] = clampd(bp(b, Gain), -18.0, 18.0) * scale;
+ tQ[b] = std::log2(clampd(bp(b, Q), 0.1, 18.0));
+ if (!primed_ || cfgKey_[b] < 0) { glF_[b] = tF[b]; glG_[b] = tG[b]; glQ_[b] = tQ[b]; } // fresh: no glide in
+ moving |= glMoving_[b] = glF_[b] != tF[b] || glG_[b] != tG[b] || glQ_[b] != tQ[b];
+ nSec[b] = cascade(c[b], ty[b], sl[b], sr, std::exp2(glF_[b]), glG_[b], std::exp2(glQ_[b]));
// A band whose cascade length or channel changes starts clean (its old state means
// something else); a type or frequency move keeps it, as the original EQ-8 did.
const int key = nSec[b] * 10 + ch[b];
@@ -153,13 +162,17 @@ public:
if (moved) {
for (int i = 0; i < kAutoKeys; ++i) autoKey_[i] = get(i);
autoSr_ = sr;
- autoDb_ = clampd(-averageDb(on, ty, ch, c, sr), -12.0, 12.0);
+ Coeffs ct[kBands][kMaxSec]; // measured at the targets, not mid-glide
+ for (int b = 0; b < kBands; ++b)
+ if (on[b]) cascade(ct[b], ty[b], sl[b], sr, std::exp2(tF[b]), tG[b], std::exp2(tQ[b]));
+ autoDb_ = clampd(-averageDb(on, ty, ch, ct, sr), -12.0, 12.0);
}
}
const double autoTarget = autoOn ? std::pow(10.0, autoDb_ / 20.0) : 1.0;
const double outTarget = std::pow(10.0, clampd(get(Output), -12.0, 12.0) / 20.0);
if (!primed_) { autoCur_ = autoTarget; outCur_ = outTarget; primed_ = true; }
const double glide = 1.0 - std::exp(-1.0 / (0.02 * sr)); // ~20 ms, click-free
+ const double glideC = 1.0 - std::exp(-(double)kCtrl / (0.02 * sr)); // the same, per control step
float inPk = 0.0f, outPk = 0.0f;
uint32_t w = ringW_.load(std::memory_order_relaxed);
@@ -169,6 +182,20 @@ public:
inPk = std::max(inPk, (float)std::max(std::fabs(l), std::fabs(r)));
if (ringOk) ring_[0][w & ringMask_] = (float)(0.5 * (l + r));
+ // Gliding bands: step toward the targets and re-build the cascade every kCtrl samples.
+ if (moving && --ctrl_ <= 0) {
+ ctrl_ = kCtrl;
+ moving = false;
+ for (int b = 0; b < kBands; ++b) {
+ if (!on[b] || !glMoving_[b]) continue;
+ glF_[b] = settle(glF_[b] + (tF[b] - glF_[b]) * glideC, tF[b], 1e-5);
+ glG_[b] = settle(glG_[b] + (tG[b] - glG_[b]) * glideC, tG[b], 1e-4);
+ glQ_[b] = settle(glQ_[b] + (tQ[b] - glQ_[b]) * glideC, tQ[b], 1e-5);
+ cascade(c[b], ty[b], sl[b], sr, std::exp2(glF_[b]), glG_[b], std::exp2(glQ_[b]));
+ moving |= glMoving_[b] = glF_[b] != tF[b] || glG_[b] != tG[b] || glQ_[b] != tQ[b];
+ }
+ }
+
for (int b = 0; b < kBands; ++b) {
if (!on[b]) continue;
const int n = nSec[b];
@@ -343,6 +370,7 @@ public:
private:
static constexpr double kPi = 3.14159265358979323846;
static constexpr int kMaxSec = 4;
+ static constexpr int kCtrl = 16; // control-rate cascade re-build while a band glides
static constexpr int kAutoKeys = Scale + 1; // band params, slopes, channels and Scale shape the curve
struct Coeffs { double b0 = 1, b1 = 0, b2 = 0, a1 = 0, a2 = 0; };
@@ -376,6 +404,7 @@ private:
}
static double clampd(double v, double lo, double hi) { return v < lo ? lo : (v > hi ? hi : v); }
+ static double settle(double v, double target, double eps) { return std::fabs(v - target) < eps ? target : v; }
static float db(float lin) { return lin > 1e-6f ? 20.0f * std::log10(lin) : -120.0f; }
static Coeffs norm(double b0, double b1, double b2, double a0, double a1, double a2) {
return {b0 / a0, b1 / a0, b2 / a0, a1 / a0, a2 / a0};
@@ -518,6 +547,9 @@ private:
double autoSr_ = -1.0, autoDb_ = 0.0;
double autoCur_ = 1.0, outCur_ = 1.0; // smoothed auto / output gains
bool primed_ = false;
+ double glF_[kBands] = {}, glG_[kBands] = {}, glQ_[kBands] = {}; // gliding Freq (log2 Hz) / Gain (dB) / Q (log2)
+ bool glMoving_[kBands] = {};
+ int ctrl_ = 0; // samples to the next glide step
// Meters (audio thread) and their published values.
float inPk_ = 0.0f, outPk_ = 0.0f;
diff --git a/tests/Nota.SmokeTest/FilterGlideTests.cs b/tests/Nota.SmokeTest/FilterGlideTests.cs
new file mode 100644
index 00000000..4b175505
--- /dev/null
+++ b/tests/Nota.SmokeTest/FilterGlideTests.cs
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.
+//
+// Filter knob glide (.specify/bugs/filter-param-zipper): a sudden Freq / Morph / Gain step on
+// Auto Filter, EQ-8 and Dynamic EQ-8 must not click. Steady tones (100 Hz + 1 kHz, a
+// deterministic WAV) play through the device, one knob jumps at a block boundary, and the
+// peak 4th difference of the output (a high-pass that a click lights up and the tones barely
+// do) right after the jump is compared with the device's settled sound before and after.
+// The tones are quiet so a resonance sweeping across them stays clear of the ±1 clip.
+// Also runnable alone: `dotnet run --project tests/Nota.SmokeTest -- --glide`.
+
+using Nota.Infrastructure;
+
+namespace Nota.SmokeTest;
+
+internal static class FilterGlideTests
+{
+ private const int Chunk = 512, Chunks = 100, StepAt = 50;
+ // Before the fix such jumps measured ×400 – ×17 000 over the settled sound (a standalone
+ // render); with the glide they stay within ~×20 — what is left is a resonant cutoff
+ // sweeping across the 1 kHz tone, not a click.
+ private const double MaxOvershoot = 150.0;
+
+ public static IEnumerable<(bool Ok, string Label)> Run()
+ {
+ string wav = Path.Combine(Path.GetTempPath(), "nota_smoke_glide_" + Guid.NewGuid().ToString("N") + ".wav");
+ WavWriter.WriteTones(wav, seconds: 3.0, freqs: new[] { 100.0, 1000.0 }, amp: 0.05, sampleRate: 44100);
+ try
+ {
+ // Auto Filter (kind 7, params 0..1): Freq 0 · Res 1 · Morph 4.
+ yield return Case(wav, "Auto Filter Freq jump", 7,
+ new() { [1] = 0.5f, [0] = 0.2f }, (0, 0.8f));
+ yield return Case(wav, "Auto Filter Morph jump", 7,
+ new() { [1] = 0.3f, [0] = 0.5f }, (4, 1.0f));
+ // EQ-8 (kind 0, raw units, 5 per band): band 8 high cut at Q 4; band 2 bell at Q 8.
+ yield return Case(wav, "EQ-8 high cut Freq jump", 0,
+ new() { [35] = 1f, [37] = 600f, [39] = 4f }, (37, 8000f));
+ yield return Case(wav, "EQ-8 bell Freq jump", 0,
+ new() { [5] = 1f, [6] = 2f, [7] = 1000f, [8] = 15f, [9] = 8f }, (7, 4000f));
+ yield return Case(wav, "EQ-8 48 dB low cut Freq jump", 0,
+ new() { [0] = 1f, [1] = 0f, [2] = 40f, [4] = 6f, [40] = 2f }, (2, 300f));
+ // Dynamic EQ-8 (kind 13, 10 per band): band 1 high cut at Q 4; band 2 bell gain.
+ yield return Case(wav, "Dynamic EQ-8 high cut Freq jump", 13,
+ new() { [0] = 1f, [1] = 5f, [2] = 600f, [4] = 4f }, (2, 8000f));
+ yield return Case(wav, "Dynamic EQ-8 bell Gain jump", 13,
+ new() { [10] = 1f, [11] = 2f, [12] = 3000f, [13] = 0f, [14] = 8f }, (13, 15f));
+ }
+ finally { try { File.Delete(wav); } catch { } }
+ }
+
+ private static (bool, string) Case(string wav, string name, int kind, Dictionary<int, float> setup, (int Param, float Value) jump)
+ {
+ using var e = new NotaEngine();
+ e.SetBpm(120);
+ int t = e.AddAudioTrack();
+ e.AddAudioClip(t, wav, startBeat: 0.0);
+ int d = e.AddBuiltinDevice(t, kind);
+ if (d < 0) return (false, $"{name}: device added");
+ foreach (var (p, v) in setup) e.DeviceSetParam(t, d, p, v);
+
+ var outL = new float[Chunk * Chunks];
+ var buf = new float[Chunk * 2];
+ e.Seek(0); e.Play();
+ for (int k = 0; k < Chunks; k++)
+ {
+ if (k == StepAt) e.DeviceSetParam(t, d, jump.Param, jump.Value);
+ e.RenderOffline(buf, Chunk);
+ for (int i = 0; i < Chunk; i++) outL[k * Chunk + i] = buf[i * 2];
+ }
+ e.StopTransport();
+
+ double Peak4(int fromChunk, int toChunk)
+ {
+ double m = 0;
+ for (int i = Math.Max(4, fromChunk * Chunk); i < toChunk * Chunk; i++)
+ m = Math.Max(m, Math.Abs(outL[i] - 4.0 * outL[i - 1] + 6.0 * outL[i - 2] - 4.0 * outL[i - 3] + outL[i - 4]));
+ return m;
+ }
+ double settled = Math.Max(Peak4(StepAt - 20, StepAt), Peak4(Chunks - 20, Chunks));
+ double jumpPk = Peak4(StepAt, StepAt + 10);
+ bool finite = outL.All(float.IsFinite);
+ double ratio = jumpPk / Math.Max(settled, 1e-9);
+ return (finite && settled > 0 && ratio <= MaxOvershoot,
+ $"{name} glides without a click (jump ×{ratio:F1} the settled sound, limit ×{MaxOvershoot:F0})");
+ }
+}
diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.cs
index 8dfcbd16..04c7f428 100644
--- a/tests/Nota.SmokeTest/Program.cs
+++ b/tests/Nota.SmokeTest/Program.cs
@@ -215,6 +215,14 @@ if (args.Length >= 1 && args[0] == "--tap")
Console.WriteLine(failures == 0 ? "TAP PASSED" : $"TAP FAILED ({failures})");
return failures == 0 ? 0 : 1;
}
+// Filter knob glide alone: `--glide`. Also part of the full run.
+if (args.Length >= 1 && args[0] == "--glide")
+{
+ Console.WriteLine("-- filter knob glide --");
+ foreach (var (ok, label) in FilterGlideTests.Run()) Check(ok, label);
+ Console.WriteLine(failures == 0 ? "GLIDE PASSED" : $"GLIDE FAILED ({failures})");
+ return failures == 0 ? 0 : 1;
+}
// Snap grid alone: `--grid`. Also part of the full run.
if (args.Length >= 1 && args[0] == "--grid")
{
@@ -14524,6 +14532,9 @@ foreach (var (ok, label) in TapTempoTests.Run()) Check(ok, label);
Console.WriteLine("-- snap grid --");
foreach (var (ok, label) in SnapGridTests.Run()) Check(ok, label);
+Console.WriteLine("-- filter knob glide --");
+foreach (var (ok, label) in FilterGlideTests.Run()) Check(ok, label);
+
// --- command palette: descriptors, golden queries, context table, undo, speed ---
Console.WriteLine("-- command palette --");
foreach (var (ok, label) in PaletteTests.Run()) Check(ok, label);