Repository navigation
feat(audio): Vibe adopts silence gate (#2253) - #2312
Conversation
Vibe's MilkDrop self-normalization (imm/longAvg) drove getVol() toward 1.0 during silence (noise/noise → 1.0, plus the <0.001f clamp pinning to 1.0). LED effects driven by getVol()/getBass()/getMid()/getTreb() never calmed down when music stopped. Route each band's mImmRel and mAvgRel through a SilenceEnvelope (tau=0.3s → ~1s to fully gate) so when Context::isSilent() is true the values exponentially decay toward 0.0. Pass-through during audio preserves MilkDrop dynamics exactly. The <0.001f startup clamp stays intact — envelope handles silence downstream. All 8 user-visible getters now decay to near-zero in silence: getBass, getMid, getTreb, getVol, getBassAtt, getMidAtt, getTrebAtt, getVolAtt. Part 2/4 of #2253 silence-gate rollout. Builds on the Context::isSilent() + SilenceEnvelope plumbing in #2306. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR adds silence-gating functionality to the Vibe audio detector by introducing two new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Header Compilation PerformanceTotal Time: 753.96ms Top 5 Slowest Headers
Warnings
Full Report |
Summary
Fixes
Vibe::getVol()(and all 7 other user-visible getters) converging to 1.0 in silence. MilkDrop self-normalization (mImm / mLongAvg → noise/noise → 1.0, plus the< 0.001fclamp pinning to 1.0) was never gated by the silence flag. Route each of the 3 bands'mImmRel/mAvgRelthrough aSilenceEnvelope(tau=0.3s → ~1s to fully gate).Context::isSilent()is true< 0.001fstartup clamp stays intact (envelope handles silence downstream)Part 2/4 of #2253 silence-gate rollout. Builds on #2306 (Context::isSilent + SilenceEnvelope). Sibling PR #2309 (Reactive) landed independently.
Test plan
bash test fl_audio --debug— 211/211 test cases passbash test fl_audio_detector_vibe --debug— 34/34 vibe test cases pass including 3 new silence-gate testsbash linton all 3 modified files — cleangetVol() < 0.05fafter ~1s silence (90 frames @ 512/44100 Hz)isSilentstaysfalse(pass-through)Files
src/fl/audio/detector/vibe.h— 6 new lines (+include, +6 SilenceEnvelope members)src/fl/audio/detector/vibe.cpp.hpp— ~30 new lines (constructor seeding, Step 4b gate, reset)tests/fl/audio/detector/vibe.hpp— 3 new FL_TEST_CASE blocks160 insertions, 2 deletions.
🤖 Generated with Claude Code
Summary by CodeRabbit