How the Tuning Fork and Tuner Work
AnyTool generates tones and tunes instruments entirely in the browser with the Web Audio API. One persistent AudioContext drives a pool of OscillatorNodes through per-note gain (with short attack/release ramps for click-free play), so notes and chords sound instantly; every frequency is computed from the chosen A4 by equal temperament (f = A4 × 2^((n-69)/12)), keeping 432/440/442/415 Hz correct. The mic tuner takes getUserMedia input into an AnalyserNode and runs the McLeod Pitch Method each frame, gated by a clarity score, to show the nearest note and cents on a needle/strobe meter — all locally, with no audio uploaded. Reference tones are rendered with an OfflineAudioContext and exported as WAV via Web Audio encodeWav, or MP3/M4A/OGG/FLAC through a self-hosted single-threaded ffmpeg.wasm engine (bundled core, no CDN).
- Runs client-side — tones and mic analysis stay on the device
- Persistent Web Audio engine with click-free envelopes
- Adjustable A4 (432/440/442/415 Hz) via equal temperament
- Mic chromatic tuner (McLeod Pitch Method) showing note + cents
- Self-hosted ffmpeg core (bundled) — no CDN
- Export reference tones as WAV/MP3/M4A/OGG/FLAC
