Commit Graph
2 Commits
Author SHA1 Message Date
Claude 132392fd9b JIANT 0.9.9-snd1: FILTER TYPE MS20 (a 2-pole low-pass screaming through a diode clip)
The owner: "a more aggressive filter type in the style of the Korg MS-20: a 2-pole
Sallen-Key-style low-pass with diode-like soft clipping in the resonance feedback,
screaming but controlled at high reso, the same knobs". TYPE 5, MS20 (voice.c tf_ms20):
the trapezoidal SVF (dsp.c) held at damping 2 (no resonance of its own: the MS-20's
soft knee at RES 0), its band-pass fed back into the input through softclip at half
full scale, a sample late (the linear part stable, the clip bounded: bounded however
it is driven). Its small-signal damping 2 - kn, RES exponential to it (2 x 2^-(6 RES /
127): Q 0.5 .. 33): soft in most of the travel, a scream at the top that still dies out
when the part is silent (no whistle on its own); a hot input clipped in the loop growls
instead of ringing louder. Out at 3/4 through a knee at 16000 (under full scale).

CUT moves with LFO / ENV DEST FILTER as the SVF's (tf_run's sweep kept where it is
heard); KNOB 4 drives as ever (ANALOG's DRIVE, the others' DIST). On ANALOG and LOFI the
MS20 is the part's filter after the voices (their own open, as under the combs), at
ANALOG's CUT RES (E4 E5: tf_run takes the cut it is given, P_FCUT for the others as
before). TYPE crossfades in and out as the combs do (its state from the input, tf_ms).
LP HP BP untouched (goldens). DRUM's IMAGE narrowed under it (the mono sum). The FILTER
page draws it as a low-pass with a higher peak. Web editor: MS20.

tests/filter_test.c: MS20 bounded and dying out at RES 0 / 100 / 127, CUT 0 / 64 / 127,
C1..C8 (3 engines); its ring longer as RES rises; a full-scale saw at RES 127, every CUT,
C1..C7: peak 31577, x0.99 .. x2.84 RES 0's level. The lockup check now about the mean
(the SVF's fixed point holds a DC at CUT 0: no sound): every TYPE passes it, the old
three too. Demo build/filter_demo/ms20_sweep.wav (a riff, CUT swept, RES 40 .. 127).

CPU: tf_ms20's loop 94 instructions a sample (the SVF's in tf_run ~ the same), only on a
part with MS20; tf_run 121 -> 126 (the branch; budgets added to target_budget.txt).
Image 577496 -> 578116 B; RAM .data+.bss 88740 -> 88804 B (its state, 78 B); pool
unchanged. Goldens 157 unchanged. MANUAL (EN, ES): MS20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-10-24 01:48:56 +00:00
Claude 3abacab85f JIANT 0.9.9-snd1: COMB made musical, COMB- (the negative comb)
The owner: "improve the COMB: tuned to the note, feedback up to near self-oscillation
with a soft clip inside the loop, a damping low-pass in the loop, positive / negative
feedback, no zipper when CUT moves". voice.c track_comb, still one line a part (the
pool unchanged):
  tuned     the newest note + CUT (64: the note, +-32 semitones) as before; the line
            shortened by the damping's delay (in tune: noise through it peaks at the
            note's period within 0.33 %, C2..C6)
  RES       the ring's length, the same on every note: T60 25 ms x 2^(8.5 RES / 127)
            (25 ms .. ~9 s), fb = e^(-6.9 per / T60) per block (2^-x linear between
            octaves, e^-a by its (2,2) Pade), at most 0.998: near self-oscillation at
            the top, most of the travel where it rings (was fb 0.49 + RES linear: a C1
            rang 20x longer than a C6)
  the loop  a soft clip inside it (soft_knee 20000: however long the ring, bounded),
            a damping one-pole in it (RES opens it, ~3.5 .. ~12 kHz: the highs die first)
  no zipper the line's length (Q16) and the feedback glide over the block (were a step
            a block: a buzz sweeping CUT); interpolated between samples as before
  COMB-     TYPE 4 (new, after COMB): the feedback negative over half the line: the odd
            harmonics of the note, hollow, at the same pitch; COMB <-> COMB- in the one
            line (its feedback glided, no crossfade)
  level     the wet by 1 - fb as before, at least a quarter (the clipped ring heard),
            the output knee 16000 (under full scale: was 24000, ~40000 peaks)
The part-filter TYPEs (FT_POST: COMB, COMB-) open every engine's own filter (ANALOG,
LOFI: eng_analog.c ft_voice); a TYPE stored past the last is clamped (ft_of; was & 3: it
read as another TYPE). DRUM's IMAGE narrowed under both combs. The FILTER page draws
COMB-'s teeth between COMB's. Web editor: COMB-.

tests/filter_test.c (new, in run_tests.sh): every TYPE at RES 0 / 100 / 127, CUT 0 / 64
/ 127, C1..C8, on PHASE ANALOG LOFI: bounded, never at full scale, the combs dying out;
COMB and COMB- in tune with the note (COMB-'s half period negative); CUT swept over a
sine: the second difference at the blocks' edges as inside them (14.4 / 14.6; the old
comb: 27.9 / 9.3); the ring longer as RES rises, still ringing a second on at 127.
Demos build/filter_demo/comb_sweep.wav, comb_neg_sweep.wav.

CPU: tests/target_budget.py now watches track_comb and tf_run: track_comb's loops 79 ->
122 instructions (+43 a sample, only on a part with a comb: ~1.9 M instructions / s, a
fraction of a percent of a core); tf_run 122 -> 121. lofi_byte_render 152 -> 153.
RAM .data+.bss 88660 -> 88740 B (the glide's and damping's state, 72 B); pool unchanged.
Goldens 157 unchanged (no render uses a COMB). MANUAL (EN, ES): COMB / COMB-.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
2026-10-24 01:43:36 +00:00