-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
audioAudio processing related tasksAudio processing related tasksbugSomething isn't workingSomething isn't workingcoreCore functionalityCore functionalitycriticalCritical bugs that block core functionalityCritical bugs that block core functionalitymicrophoneMicrophone input relatedMicrophone input relatedperformancePerformance optimizationPerformance optimization
Description
Description
The tuner's frequency detection algorithm is not correctly calculating the played frequency. Audio input is being captured and processed (confirmed by visible frequency updates and gauge movement), but the detected frequency does not match the actual input frequency.
Impact
- Core tuning functionality is unreliable
- Users cannot accurately tune their instruments
- App shows incorrect frequency readings
- Affects all instruments and tunings
Dependencies
- Related to The gauge doesn't move smoothly #23 (The gauge doesn't move smoothly) - gauge responds but with wrong values
- Possibly related to closed Bug: App Shows 'Listening...' But Doesn't React to Guitar Input #20 (App Shows 'Listening...' But Doesn't React to Guitar Input)
- May be affected by Optimize Audio Buffer Configuration #8 (Audio Buffer Configuration changes)
Expected Behavior
When a known frequency is played:
- Audio input is captured ✓ (confirmed working)
- Frequency detection algorithm processes the signal
- Calculated frequency matches the input frequency ✗ (currently broken)
- Visual gauge and UI display the correct frequency and tuning state
Current Behavior
- App shows "Listening..." status ✓
- Frequencies are displayed on screen ✓
- Gauge moves in response to audio ✓
- Displayed frequency does NOT match the actual played frequency ✗
Steps to Reproduce
- Open the app and grant microphone permissions
- Generate a known test frequency electronically (verified reference)
- Observe that the displayed frequency does not match the generated frequency
- Test with multiple known frequencies - all show incorrect values
Testing Method
Electronically generated test frequencies with known, precise values were used to isolate the issue and confirm that the frequency detection algorithm itself is calculating incorrectly (not a microphone or audio capture issue).
Investigation Areas
- Frequency detection algorithm (likely in AudioProcessor or pitch detection module)
- Check FFT implementation and configuration
- Verify sample rate handling
- Check windowing function
- Verify bin selection and interpolation logic
- Autocorrelation or YIN algorithm if used for pitch detection
- Frequency smoothing implementation (Implement Frequency Smoothing #3) - may be over-smoothing or incorrectly averaging
- Verify audio buffer size effects on frequency resolution
- Check for off-by-one errors in frequency bin calculations
- Verify correct sample rate is being used throughout the pipeline
Possible Root Causes
- Incorrect FFT size or sample rate assumptions
- Wrong frequency bin mapping
- Faulty interpolation between bins
- Buffer size mismatch affecting resolution
- Integer overflow or floating-point precision issues
Environment
- Device: [To be specified]
- OS Version: Darwin 24.6.0
- App Version: Latest from main branch (commit 14065f6)
Metadata
Metadata
Assignees
Labels
audioAudio processing related tasksAudio processing related tasksbugSomething isn't workingSomething isn't workingcoreCore functionalityCore functionalitycriticalCritical bugs that block core functionalityCritical bugs that block core functionalitymicrophoneMicrophone input relatedMicrophone input relatedperformancePerformance optimizationPerformance optimization