Skip to content

instruments filters

Aisjam edited this page Nov 15, 2026 · 1 revision

Instrument filters

Home · Section index

Working manual · 0.0.1-alpha · source snapshot 16 November 2026

The reusable library is ContourFilters, currently under core/audio/filter. FilterProcessor is a mono, allocation-free processor; AcidFilter is independently usable with arbitrary input. AcidControl supplies optional note modulation. The engine continues to use SynthRouting, VoicePool, Inst_Synth, prepared immutable definitions, the four modulation generators and ProjectSerializer. There was no oscillator backend, V-register bank or general DSP model registry in the inspected checkout. The existing instrument filter catalogue now exposes the new processors; the existing FX registry carries V1–VF controls. This does not implement a new synth backend or synth preset format.

The device renders 48 kHz stereo, in chunks of at most 512 frames, through the existing frame-based voice API. Filter state is allocated once in the sampler backend constructor; note handling, processing and switching allocate nothing. Sample loading, project decoding and benchmark timing remain outside the callback. Sampler filters are included in the existing Tracker CPU stage. Future synth backends can own the same processor in their existing Synth stage.

Models and modes

Kernel initialization is lazy: only COMB clears the large delay and only ACID prepares its coefficient solver. Zero MIX skips a child's DSP; fully dry DUAL preserves series/parallel LEVEL gains without evaluating either child. Bypass freezes histories. Secondary smoothing/control runs only while DUAL is active or fading out. See INST processing cost (repository reference: instrument-filters.md#inst-processing-cost).

Model Modes Implementation and limits
SVF LP/HP/BP/notch/all-pass/peak Trapezoidal two-integrator state-variable filter
LADDER LP Four TPT stages, implicit linear feedback estimate, stage tanh; transistor-style approximation
DIODE LP Equal-capacitor coupled stages, backward Euler, saturated excitation/feedback; diode-style approximation
K35 LP/HP Two low-pass stages and high-pass positive feedback; Korg-inspired approximation
SEM LP/HP/BP/notch More damped SVF response; not a circuit reconstruction
ACID LP Unequal-capacitor coupled ladder and feedback high-pass; detailed below
COMB resonator Fractional 8192-sample delay, feedback capped at .95; frequency floors at internal-rate/8190
FORMANT BP bank Three resonators; morph interpolates two vowel frequency sets; cutoff scales the bank
MODAL BP bank Four resonators at 1, 2.01, 3.9, 5.4 times cutoff
SHP held LP Samples the input and quantizes filter-control frequency; no anti-aliasing claim
MORPH continuous LP/BP/HP Equal-amplitude adjacent-output interpolation, not equal-power
DUAL child-dependent Independent state, series or weighted parallel; recursive DUAL rejected

Unsupported modes fall back to LP. FORMANT and MODAL always return their bank output. filterModels() exposes stable IDs, modes and nonlinear classification. The legacy instrument IDs 0–2 retain their previous processing and cutoff curve.

Parameters

V1–V8 map to logical ACID A1–A8. They are also a reusable filter adapter for the sampler. All values use existing byte FX lanes. Static INST CUTOFF and RES retain their existing fields. A1 uses 20 * 1000^(byte/255) Hz. A4 uses 0.01 * 400^(byte/255) seconds. A2/A3/A5/A6/A7 use byte/255; A8 is byte/128. Default envelope, accent, drive and tracking are zero; default level is unity. DRIVE/TRACK/LEVEL are modern extensions, not historical circuit components.

V9 is morph, VA wet mix, VB mode (LP, HP, BP, notch, all-pass, peak), VC quality (0=1x, 1=2x, 2=4x), VD/VE child model IDs, VF route/balance. A future synth may bind these logical parameters without reserving new global registers.

The floating API also accepts four custom resonator ratios (0 selects model default; otherwise 0-16 times cutoff) and normalized gains (0-1). The byte adapter retains the built-in bank tunings.

The floating API accepts cutoff 20 Hz–.45*sampleRate, resonance/drive/morph/mix 0–1, envelope -1–1, decay .01–4 seconds, accent/tracking 0–1, level 0–2. ACID additionally caps its geometric pole frequency at .2 of its internal rate. NaN/Inf parameters use safe defaults; invalid input is treated as silence. Tiny histories flush to zero; safety bounds limit runaway excitation.

All new modulation destinations reuse ModulatorRuntime. Cutoff offsets the normalized logarithmic frequency; resonance, drive, envelope, morph, mix, accent, tracking and level add the lane output; decay multiplies by 2^(4*output). Final values clamp at the DSP boundary. Parameters use a 5 ms one-pole smoother. The block API optionally accepts per-sample cutoff values, bypassing cutoff smoothing for intentional audio-rate modulation. It never reconstructs objects.

ACID control note-on starts a unit exponential decay. Explicit legato updates pitch/accent without retrigger while gated; gate-off allows decay to continue. Envelope excursion is four octaves, plus up to two accent octaves. Tracking is referenced to MIDI 60. This is a useful musical approximation, not a measured 303 accent/slide circuit. The standalone filter requires neither note events nor an oscillator. Normal sampler gate/release behavior remains authoritative.

Routing and transitions

DUAL has independent kernels and accepts separate floating parameters for B. The current byte adapter applies the same controls to both children; callers of the standalone API can modulate them independently. Parallel output is (1-balance)A + balanceB, avoiding an automatic doubling of level. No external feedback loop is exposed. Model/mode/child/routing/quality changes crossfade independent banks over 128 samples; requests received during a fade coalesce to the latest configuration. Reset and prepare deliberately clear histories.

ACID references and interpretation

Stinchcombe's diode-ladder analysis distinguishes the half-sized first capacitor and unbuffered stage coupling. Contour uses that coupled linear system, with normalized denominator s^4 + 2^(11/4)s^3 + 10*sqrt(2)s^2 + 2^(13/4)s + 1 at zero feedback. The cutoff parameter denotes geometric pole frequency, not the -3 dB corner. The transition is broad; the high-frequency asymptote remains fourth order. The five-state system includes a 100 Hz feedback high-pass and uses a bounded trapezoidal solve. Its input tanh and emergency state bounds are phenomenological; they do not solve individual semiconductor currents. The full coupling-capacitor network, tolerances, VCA and output amplifier are not modelled.

Open303 TeeBeeFilter was inspected, including both coefficient paths. The active TB_303 path uses coupled updates, doubles the first update, applies a fitted cutoff coefficient, frequency-dependent feedback calibration and resonance-dependent output gain. Its constructor selects a 150 Hz feedback high-pass. The active TB_303 branch does not call the commented nonlinear shaping routine. Contour uses implicit integration rather than its sequential updates and does not copy its fitted coefficient polynomials. Consequently identical knob values are not calibrated to identical sound. Contour maps resonance linearly to feedback 0-16 and lets that feedback determine amplitude loss; it does not reproduce Open303's gain compensation. Contour permits a 20 Hz geometric pole setting, whereas the inspected Open303 cutoff setter floors at 200 Hz. These are deliberate range and calibration differences, not hardware accuracy claims. Open303 is MIT licensed; its notice is retained in Open303-MIT.txt (repository reference: licenses/Open303-MIT.txt). No rosic/plugin SDK dependencies are linked.

a1k0n's hardware-informed work describes x0xb0x measurements and a roughly 100 Hz feedback high-pass. It also distinguishes filter response from later bass-loss effects. No source/data was copied from this repository; a licence grant was not established for reuse. DiffAPF/TB-303 supplies MPL-2.0 research code for time-varying all-pole modelling, with a Python/ML dependency tree. It is a research reference, not a runtime dependency or proof of circuit accuracy.

What should be here

Documentation still to add
Annotated current-build screenshots and a recorded controller walkthrough for this topic.

Evidence and verification

Repository sources used for this page:

  • docs/dsp-filters.md

This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.

Clone this wiki locally