Pitch Detection

Microphone picks up every note you play — highlighted live on an interactive harmonica diagram.

Pitch DetectionPitch Detection

What problem does it solve?

The biggest frustration for harmonica beginners: “I’m playing a note — but is it the right one?” HarpMaster gives you instant feedback every time you blow or draw. What note did you play? Which hole is it? Is it in tune? All visible at a glance.

Core capabilities

How it works

The core uses the industry-standard YIN pitch detection algorithm, running as WebAssembly (aubio yinfast) with automatic fallback to a pure JS implementation for compatibility. Samples at 44.1 kHz, FFT size 2048, with a confidence threshold of 0.7 to filter out noise.

iOS microphones tend to be quieter, so we add RMS normalization and automatic gain compensation — quiet playing still detects reliably.

Why this design

All audio processing stays on your device — no recording ever leaves your phone. Detection results are throttled to 30 ms (~33 fps) to keep the 60 fps UI smooth. A hole-matching engine sits between raw pitch and visual feedback, mapping notes onto the harmonica based on your current key + position + tuning settings — so even non-C harmonicas map correctly.

Try it now