β™ͺ

Hum to Fly

Hum higher to go up. That's the whole control scheme.

Audio never leaves this tab arrow keys Source β†—
Playable now Use the ↑ / ↓ keys β€” no microphone needed. Then switch to your voice and find out how steady you really are.
?

How it works

Why not just take the biggest FFT bin?

Because a hummed vowel is rich in harmonics, and the second harmonic is often louder than the fundamental. A spectral peak detector reports one octave too high, constantly, and the bird jumps.

YIN works in the time domain instead

Four steps, and the second one is the entire algorithm:

  1. the squared difference function d(Ο„) β€” how unlike itself the signal is when shifted by Ο„ samples
  2. the cumulative mean normalised difference β€” dividing by the running mean suppresses the dips at multiples of the true period, which is exactly what causes octave errors
  3. take the first dip below a threshold, not the global minimum β€” again, because the global minimum is often an octave down
  4. parabolic interpolation around that dip, for sub-sample precision

Measured against synthetic waveforms

This is the rare case where ground truth is exact: generate a 220 Hz sawtooth and the answer is 220 Hz, so any deviation is the detector's.

TestResult
10 sine tones, E2 to A5worst 0.6 cents
sawtooth and square waveswithin 15 cents
second harmonic louder than the fundamentalno octave error
fundamental removed entirelyrecovered at 180.0 Hz
443 Hz (a non-integer sample period)443.01 Hz β€” 0.05 cents
20% additive noisewithin 0.5 cents
silence and white noiserejected

Without step 4, the detector can only report whole-sample periods β€” at 443 Hz that's a choice between 441 and 445.5 Hz, a permanent error of about ten cents.

Your range, not a fixed one

A bass and a soprano do not share a comfortable octave, so the game measures yours: hum low, slide high, and it takes the 10th and 90th percentiles β€” not the min and max, because one squeak at the top would compress everything else into a sliver.

The mapping is in note space, not Hz. An octave is a doubling, so a linear map in Hz gives you almost no control at the bottom of your range and far too much at the top.

Two small mercies