Problem
hasValidPitch (source/PluginProcessor.h:52) is set to true when a valid pitch is first detected (PluginProcessor.cpp:138) and never set back to false during processing (only reset in prepareToPlay).
Once pitch tracking succeeds once, ring modulation continues forever, even during silence or when the player stops. The oscillator keeps running at the last detected frequency. This may produce unexpected artifacts -- the ring mod stays active with a stale frequency instead of bypassing.
Corroborated by: 4/8 audit agents (dsp-algorithm, pitch-detection, realtime-safety, stability-edge)
Suggested Fix
Consider one of these approaches:
- Timeout reset: Reset
hasValidPitch = false after N consecutive low-confidence frames
- Confidence gating: Scale the wet signal by confidence so the effect fades naturally during silence
- Hold with decay: Keep the last frequency but fade out the wet signal over time when confidence drops
Option 2 is the most musical -- wet * confidence provides a natural gating behavior.
Also consider resetting PitchSmoother::hasValue after extended silence so the next valid pitch snaps immediately rather than sliding from a stale value.
Impact
- Audio quality: Unwanted ring modulation artifacts during silence/pauses
- Severity: Medium -- behavioral issue that affects musical usability
Problem
hasValidPitch(source/PluginProcessor.h:52) is set totruewhen a valid pitch is first detected (PluginProcessor.cpp:138) and never set back tofalseduring processing (only reset inprepareToPlay).Once pitch tracking succeeds once, ring modulation continues forever, even during silence or when the player stops. The oscillator keeps running at the last detected frequency. This may produce unexpected artifacts -- the ring mod stays active with a stale frequency instead of bypassing.
Corroborated by: 4/8 audit agents (dsp-algorithm, pitch-detection, realtime-safety, stability-edge)
Suggested Fix
Consider one of these approaches:
hasValidPitch = falseafter N consecutive low-confidence framesOption 2 is the most musical --
wet * confidenceprovides a natural gating behavior.Also consider resetting
PitchSmoother::hasValueafter extended silence so the next valid pitch snaps immediately rather than sliding from a stale value.Impact