Published test method

The number behind the needle.

TuneToy does not ask you to trust an accuracy badge without context. This page documents the browser pitch engine's repeatable synthetic tests, the current result, and the real-world factors a laboratory signal cannot reproduce.

Method and result verified July 31, 2026

<0.6¢Worst observed frequency error across the complete deterministic browser battery.
0.04¢Worst observed error in the 30-case pure and detuned string sweep.
48k / 8,192Sample rate and analysis-frame size, matching the live browser tuner.

What the test actually measures

The test extracts the same YIN pitch-detector source used by the live tuner. It feeds that detector generated sample buffers whose intended frequencies are known exactly, then converts the detected-frequency difference into cents. One cent is one hundredth of a semitone.

This isolates the calculation from room acoustics and hardware. It answers a narrow but useful question: when a clean or deliberately difficult periodic signal reaches TuneToy's detector, does the algorithm identify its fundamental accurately?

01 / Pitch sweep

Pure and detuned strings

Standard-guitar targets are tested below pitch, at pitch, and above pitch. This checks the frequency estimate across the instrument's range rather than at a single convenient note.

02 / Instrument shape

Plucked-string harmonics

Deterministic harmonics, a decaying envelope, and low-level noise create a harder signal whose upper partials compete with the fundamental.

03 / Octave trap

Missing fundamentals

The fundamental component is removed while harmonics two through six remain. Their shared repetition still implies the true fundamental, testing whether the detector jumps an octave.

04 / Rejection

Silence and noise

Digital silence must produce no frequency. Deterministic white noise must remain below TuneToy's live clarity threshold rather than masquerading as a stable musical note.

Reproducible process

  1. Read tuner.html and extract the code between its PITCH ENGINE markers.
  2. Generate deterministic 48 kHz buffers so the same input is tested on every run.
  3. Run the detector with the same 8,192-sample frame size used in the browser.
  4. Compare detected and intended frequencies with 1200 × log₂(detected ÷ target).
  5. Fail the regression test if pitch error, missing-fundamental handling, silence rejection, or noise clarity crosses its documented limit.
PASS · below 0.6¢ The checked-in browser engine measures 0.04¢ worst-case error on the pure-tone sweep, 0.52¢ on the plucked-string model, and 0.18¢ with the fundamental removed.

What this result does not prove

A synthetic result is not a promise that every microphone reading will be within six tenths of a cent. A real string changes pitch during its attack, contains body and room resonances, and may excite neighboring strings. Phone and laptop microphones add their own frequency response, noise reduction, gain behavior, and physical placement.

That is why the live tuner also uses a level gate, a clarity threshold, several recent estimates, and practical instructions: work in a quiet room, pluck one string at a time, keep the microphone reasonably close, and let the sharp initial attack settle. On a real instrument, those conditions dominate the last fraction of a cent.

Why TuneToy targets a string

A general chromatic display centers whichever semitone is closest. That is useful for identifying an unknown note, but a badly flat guitar string can therefore look almost correct for the wrong note. TuneToy's instrument modes instead compare the signal with the strings in the selected tuning. The display continues to point toward the intended string, and a manual target lock handles strings that begin far away.

Source, review, and corrections

The regression test lives with the site source as tests/tuner-engine.test.mjs. The detector is based on the published YIN fundamental-frequency method. Test failures block an accuracy claim from being updated without a corresponding code or documentation change.

Questions about the method, reproducibility reports, and corrections can be sent to hello@tunetoy.com. Include the browser, operating system, input device, target note, and enough detail to repeat the observation. Audio recordings are not required.

Open the tunerAbout TuneToyReport a correction