Add Instruments

This commit is contained in:
2025-12-21 19:17:42 +01:00
parent 8caf775fe7
commit a8b6636cbf
6 changed files with 410 additions and 103 deletions

View File

@@ -62,12 +62,8 @@ export class PitchAnalyzer {
const pitch = this.detector(this.buffer);
// Guitar range filtering:
// Low E (E2) is ~82Hz. Drop D is ~73Hz.
// High E (E4) is ~330Hz. 12th fret E5 is ~660Hz.
// Harmonics can go higher, but unlikely above 1500Hz for fundamental training.
// 19kHz (user reported D#10) is definitely noise.
if (pitch && (pitch < 70 || pitch > 1500)) return null;
// Widen range for Bass (E1 ~41Hz) and Whistle (C8 ~4186Hz)
if (pitch && (pitch < 30 || pitch > 5000)) return null;
return pitch;
}