Skip to content

Add the overdrive kernel — LGW-voiced feedback soft clipper#22

Merged
tap merged 2 commits into
mainfrom
claude/attachment-review-cft2qc
Jul 23, 2026
Merged

Add the overdrive kernel — LGW-voiced feedback soft clipper#22
tap merged 2 commits into
mainfrom
claude/attachment-review-cft2qc

Conversation

@tap

@tap tap commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

The spiritual successor to Jamoma's TTOverdrive — not a port. Both legacy modes were memoryless odd-function waveshapers applied to the full spectrum; this is a voiced feedback soft clipper chasing the class of TS-lineage pedals (Mad Professor Little Green Wonder as the listening reference), per the overdrive handoff brief.

include/taptools/overdrive.h (tap::tools::od):

  • The nonlinearity sits inside a lowpass feedback loop solved zero-delay (the svf.h driven-circuit / ladder.h solver_fast one-pass scheme). The naive one-sample-delay loop limit-cycles at high drive (|J| > 1 above drive ≈ 0.9); the implicit solve is stable at any loop gain.
  • The LF loop gain is pinned (g_fb = G/k_lf_gain − 1) so bass stays tight and near-clean at any drive while mids take the full gain — the frequency-dependent clipping a static curve cannot produce.
  • shape(u) = u/√(1+u²): C∞ (no curvature seam to alias), monotonic, rsqrt-vectorizable, LUT-able for a future fixed-point port.
  • asymmetry bias for even harmonics; unity clean-through so the transfer never flattens; always-on DC blocker (R = 0.9997, the TTDCBlock constant — load-bearing this time); body voicing (pre-clipper HP corner slide + CW upper-mid push + CCW treble lift, all linear EQ); 1/2/4/8× oversampling (default 4×); normalized 0..1 parameters (Q15/Q31-friendly for embedded targets); ramped click-free setters; multichannel frame protocol.
  • The k_voice_* constants are by-ear placeholders pending the in-Max voicing pass against LGW demos — labeled as such in the header, the notebook, and the book.

Verification layer (per house rules):

  • tests/overdrive_test.cpp — 11 Catch2 cases pinning the design goals: gain-tilt-grows-with-drive, even-harmonic emergence/absence, DC blocking, never-flat slope, alias-floor improvement, body tilt, decay to silence, determinism, clamping.
  • tools/capi + taptools_py.pytaptools_od_* C ABI and the Overdrive ctypes class.
  • notebooks/overdrive.ipynb — committed executed: tilt +5/+16.3/+17.2 dB (drive 0/0.5/0.9, 80 Hz→4 kHz); H2 −151 dB → −26 dB across asymmetry; folded H7 −22 → −36 dB at 4×; DC means ~1e-10.
  • Book: Distortion with a memory (new Part VII — The pedalboard) + The clipper in the loop: overdrive.h (machine part, renumbered to VIII after tune's Part VI); README/introduction updated.

Rebased on latest main (integrates cleanly beside the tune.h work: shared SUMMARY/capi/ctypes merge points resolved keep-both; submodules/dsptap pin untouched vs main).

Testing

  • Full kernel suite green via ctest (including the new overdrive cases: 652k assertions).
  • capi builds standalone; binding smoke-tested; notebook executed end-to-end against the shipping DSP.
  • clang-format clean on all touched files.

The consuming TapTools-Max PR bumps the submodule pin to this branch's head.

🤖 Generated with Claude Code

https://claude.ai/code/session_01S3twSGfwUK8jnUhp5Qx6wx


Generated by Claude Code

claude added 2 commits July 22, 2026 20:42
The spiritual successor to Jamoma's TTOverdrive, per the overdrive handoff
brief: not a port of the old memoryless odd-function curves, but a voiced
feedback clipper chasing the class of TS-lineage pedals (Mad Professor
Little Green Wonder as the listening reference).

- Nonlinearity inside a lowpass feedback loop, solved zero-delay with the
  house fast one-pass scheme (svf/ladder pattern): LF loop gain pinned so
  bass stays tight while mids take the full drive — the frequency-dependent
  clipping a static shaper cannot do.
- shape() = u/sqrt(1+u^2) (smooth, rsqrt-vectorizable, LUT-able for a
  future fixed-point port); asymmetry bias for even harmonics; unity
  clean-through so the transfer never flattens; always-on DC blocker
  (Jamoma R = 0.9997) since asymmetry generates DC.
- body voicing control: pre-clipper HP corner slide + CW upper-mid push +
  CCW treble lift, all linear EQ; voicing constants are by-ear
  placeholders pending the in-Max pass.
- 1/2/4/8x oversampling (default 4x), normalized 0..1 parameters (Q-format
  friendly), ramped click-free setters, multichannel frame protocol.
- Catch2 tests pin the design goals: gain-tilt-vs-drive, even-harmonic
  emergence, DC blocking, never-flat slope, alias-floor improvement, body
  tilt, decay to silence, determinism, clamping.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3twSGfwUK8jnUhp5Qx6wx
Completes the house treatment for the new overdrive kernel:

- tools/capi: taptools_od_* functions (create/prepare/set/oversample/
  smooth/clear/process) over tap::tools::od::overdrive, mirroring the
  other parameter-indexed kernels; taptools_py.py gains the Overdrive
  ctypes class.
- notebooks/overdrive.ipynb (executed): drives the shipping kernel via
  the C ABI and measures the design goals — the feedback loop's gain
  tilt growing with drive (+5/+16.3/+17.2 dB at drive 0/0.5/0.9 between
  80 Hz and 4 kHz), the never-flat transfer, even harmonics vs asymmetry
  (H2 -151 dB at 0, -26 dB at 0.6), the alias floor at 1x vs the default
  4x (folded H7 -22 -> -36 dB), the body voicing shape, and DC blocking
  (means ~1e-10 at full drive/asymmetry).
- book: 'Distortion with a memory' (new Part VI — The pedalboard) and
  the machine deep-dive 'The clipper in the loop: overdrive.h' (the
  zero-delay solve derivation, why the unit-delay loop limit-cycles, the
  shaper choice, oversampling-vs-ADAA rationale, and the honestly-
  labeled voicing placeholders); machine part renumbered to VII;
  introduction and README updated.

Every number in the chapters is an executed notebook cell or a kernel
suite assertion.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3twSGfwUK8jnUhp5Qx6wx
@tap
tap merged commit 492cfe9 into main Jul 23, 2026
12 checks passed
tap pushed a commit to tap/TapTools-Max that referenced this pull request Jul 23, 2026
The kernel PR (tap/TapTools#22) merged via rebase — main's tree is
identical to the branch tip this PR previously pinned. Repointing keeps
the pin reachable after kernel branch cleanup, per the kernel repo's
release flow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3twSGfwUK8jnUhp5Qx6wx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants