Skip to content

fix(harmony): bounded Music guide key retarget under moderate confidence - #503

Closed
masarray wants to merge 6 commits into
integration/asio4all-harmony-d4-compat-20261109from
fix/harmony-p0-bounded-music-retarget-20261110
Closed

masarray wants to merge 6 commits into
integration/asio4all-harmony-d4-compat-20261109from
fix/harmony-p0-bounded-music-retarget-20261110

Conversation

@masarray

@masarray masarray commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

P0 Harmony Reliability Recovery — RT bounded guide + prepared clickless bypass (DRAFT)

Authoritative head: f3a29d66f95edd103e76d2fc94ba624b6ce0d450; base: #499 draft QA c717be02. Never merge #499 or this PR to main until Windows exact-SHA FAT and physical ASIO/singer listening gates pass. #504 is a second main-based draft for the exact-SHA FAT dispatcher ONLY; it must NOT be merged.

Audited defects and corrections

  1. Stuck Music key at moderate confidence: the prior Music candidate counter saturated at 12 but a previously accepted key could be replaced only above 0.10 confidence. Stable new evidence between 0.045 and 0.10 never retargeted. New policy commits strong evidence at 8 × 100ms, moderate evidence after 20 consecutive windows, and resets on oscillation; manual fallback preserved.
  2. Music-guide CPU spikes: the detector previously scored 24 key candidates and normalized 36 rotor bins all in one decimated sample; now bounded to 2 key candidates + 3 oscillator normalizations per decimated sample, snapshot-based scoring completes within 2ms at the 6kHz detector rate and does not depend on ASIO callback partitions. No allocation, mutex, worker, network, or second PCM authority.
  3. 8ms bypass envelope could run at incorrect rate: the native Harmony processor was directly prepared without populating JUCE AudioProcessor rate metadata. FxInstance prepares its bypass envelope from processor->getSampleRate(), which JUCE may return as 0 when not explicitly initialized; a zero rate clamps envelope to 64 frames (1.33ms @48k instead of intended 8ms). Harmony now calls setRateAndBufferSizeDetails() OFF RT when prepared, before FxInstance captures the rate. No latency or rendered harmony tone changed; fix(harmony): P0 clickless warm bypass and continuous Music-key retuning #502's warm bypass remains authoritative.

Regressions

  • Standalone DSP real music PCM: C Major → A Minor → silence/disconnect → C Major reacquisition for 64/127/256 callback partitions; stable 48/96k and nonfinite/antiphase fixtures retained.
  • New per-sample work-budget assertions on native Music detector.
  • Actual JUCE ChannelHarmonyProcessor → FxInstance::render() → DynamicChannelFxLeaseBank: 9 WET/Space combinations (0/50/100% × 0/60/100%), 48/96k, 64/128/256 frames; sustained vowel, silence/room tail, rack/slot OFF/ON, exact PDC and after-reenable PCM parity vs always-on reference; verify captured 8ms fade duration, not an isolated envelope dummy.
  • Existing fix(harmony): P0 clickless warm bypass and continuous Music-key retuning #502 native live-bypass A/B vs previously skipped-state behavior retained.

Evidence at exact SHA

Isolation

Do not merge into main, force-push, alter the .smix contract, reintroduce Recover/Monitor/Remap flows, or destabilize ArSon Player, Compressor, ASIO4ALL, WIRE, Vocal Throw or updater.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: f3a29d6
Status: ✅  Deploy successful!
Preview URL: https://930dd0bc.arsonmix.pages.dev
Branch Preview URL: https://fix-harmony-p0-bounded-music.arsonmix.pages.dev

View logs

Copy link
Copy Markdown
Owner Author

Harmony integration checkpoint (2026-11-10): Main is now 6bcf88af after #487/#499 merged. #503's original f3a29d66 key/score improvements are already represented in main; its older QA lineage must not be remerged or force-pushed. The missing 8ms bypass rate and fresh-guide timeout fixes have been surgically forward-ported to current-main draft #509, coordinated by #510.

Copy link
Copy Markdown
Owner Author

Final source-equivalence reconciliation (2026-11-10): this former P0 Harmony branch is now superseded by current main. Compared exact Git blob SHA: engine/builtin_fx/HarmonyMusicKey.h and tests/harmony_music_key_test.cpp are byte-identical between this PR and main@70cd7604; those retain the 20-window moderate-confidence key retarget and bounded temporal work. The differing ChannelHarmonyProcessor.h is explained by the later approved Harmonice brand plus one-shot 2s guide reset/real sample-rate bypass forward-port in merged #517/#518; the bypass test is evolved in main. No older plugin identity/name may be restored by merging this stack. Closing without direct merge, preserving code/history and keeping physical ASIO/singer listening explicitly unverified in #412.

@masarray masarray closed this Nov 10, 2026
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.

1 participant