File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ Test files are located in `Stay TunedTests/`:
3333- ` TuningTests.swift ` - Tuning and GuitarString models
3434- ` AudioTests.swift ` - Pitch detection and spectrum analyzer sensitivity
3535- ` TunerViewModelTests.swift ` - ViewModel business logic
36+ - ` BeatDetectorTests.swift ` - Autocorrelation & BPM logic
3637
3738### Critical Audio Configuration (DO NOT CHANGE WITHOUT TESTING)
3839
@@ -99,6 +100,12 @@ Stay Tuned/
99100- ** Confirmed strings:** Persist green state until user taps to retune
100101- ** All-tuned celebration:** Quick flash + haptic when all strings confirmed
101102
103+ ### Beat Detection (BeatDetector.swift)
104+ - ** Algorithm:** Normalized Autocorrelation (172Hz resolution)
105+ - ** Harmonic Correction:** "Double-Time Check" favors 2x tempos (e.g., 120 vs 60 BPM) if detected strength > 50%
106+ - ** Buffer:** 3.5s circular buffer of RMS energy
107+ - ** Range:** 60-200 BPM
108+
102109### Audio Pipeline
1031101 . AudioEngine captures mic input with small buffer (low latency)
1041112 . PitchDetector accumulates samples and detects pitch
You can’t perform that action at this time.
0 commit comments