From e990c21e944c193cea810cfb016b5cacbf08e921 Mon Sep 17 00:00:00 2001 From: Matiq Date: Fri, 21 Aug 2026 00:52:44 +0300 Subject: [PATCH] fix: framed_test parse every comma band (was first-arg only); comb tests were single-band --- dsp/framed_test.cpp | 13 +++++++------ handoff/NOTES_LEVEL.md | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dsp/framed_test.cpp b/dsp/framed_test.cpp index b67d593..555846e 100644 --- a/dsp/framed_test.cpp +++ b/dsp/framed_test.cpp @@ -65,12 +65,13 @@ int main(int argc, char** argv) { if (!load_wav(argv[1], x, sr)) { fprintf(stderr, "cannot load %s\n", argv[1]); return 1; } std::vector bands; if (argc >= 4 && strchr(argv[3], ',')) { - // comma form: "fc,q,sens[,scale]" - float fc, q, sens, scl = 1.0f; - // parse first 3 - int n = sscanf(argv[3], "%f,%f,%f,%f", &fc, &q, &sens, &scl); - DetectorBand b; b.fc = fc; b.q = q; b.sens = sens; b.level_scale = scl; - bands.push_back(b); + // comma form: one or more "fc,q,sens[,scale]" args, each parsed separately + for (int i = 3; i < argc; i++) { + float fc, q, sens, scl = 1.0f; + if (sscanf(argv[i], "%f,%f,%f,%f", &fc, &q, &sens, &scl) < 3) continue; + DetectorBand b; b.fc = fc; b.q = q; b.sens = sens; b.level_scale = scl; + bands.push_back(b); + } } else { for (int i = 3; i + 2 < argc; i += 3) { DetectorBand b; diff --git a/handoff/NOTES_LEVEL.md b/handoff/NOTES_LEVEL.md index 6de6706..0e16b63 100644 --- a/handoff/NOTES_LEVEL.md +++ b/handoff/NOTES_LEVEL.md @@ -1163,3 +1163,22 @@ were NOT the reference config. Even with corrected fc/q/sens the model still ove - per-band mode 0/3 (peak vs shelf/tilt band types, M10) not dispatched. No code change; investigation only. These require the structural combine/acc + per-band type before 4-band comb can close. + +## ============ UPDATE 2026-08-21: multi-band parser fix + combine/sens experiments ============ +### infra FIX: framed_test comma form only parsed argv[3] -> multiband comb tests actually +ran a SINGLE band (first comma-arg ignored the rest). Now parses every comma-arg from +argv[3..]. With correct 4-band params and faithful min(), honest comb = mean 10.15 (over-cut +-7..-15 dB). Single-band corpus unchanged (t1kq 0.226, dual 0.726) => parser fix is safe. + +### combine/sens experiments (reverted, doc only) +Tried closing comb via additive dB-sum (red=sum_i red_i) and signed sens-weight +S=sign(sens)*min(1,|sens|/12) applied to C. Neither reproduces comb_ref neutrality (~0 dB): + min() comb mean 10.15 (baseline) + additive comb mean 15.68 (worse: all bands cut, no compensation) + additive+S comb mean 15.68 (neg-sens band2 at fc=1778 doesn't counter band1 @1000) +Real soothe2 comb is neutral DESPITE band1 (fc=1000 sens+12) active. band2 sens=-12 at +fc=1778 has res~1.9 on the 500..3000 tones, so its naive compensation is tiny vs band1's +cut. => Naive additive/sens formulas CANNOT model the negative-sens band interaction; it +lives in the structural combine/acc 0x5407c8 (per-bin weights kRTAtt/kRTRel + negative +sens entering the level path with opposite sign), which requires the real exp2-domain +chain, not the bridge. comb stays OPEN (structural combine/acc, P4/P5).