The universal reference
- Input
- A4 (Lá central, MIDI 69)
- Expected output
- 440 Hz
It is the zero point of the formula: n = 0 semitones away from A4 itself, so f = 440 × 2 raised to the power 0, which is 440.
online piano and audio synthesis
An online piano does not store a separate recording for each of the 88 keys: it calculates the exact frequency of every note from a fixed mathematical formula and uses that frequency to generate or pick the matching sound in real time.
It is the zero point of the formula: n = 0 semitones away from A4 itself, so f = 440 × 2 raised to the power 0, which is 440.
MIDI 60 sits 9 semitones below A4, so f = 440 × 2 raised to the power (-9/12), which gives about 261.63 Hz, the classic middle C used as a reference in sheet music.
MIDI 72 sits exactly 12 semitones above MIDI 60 (C4), a full octave, so the frequency doubles: 261.63 Hz becomes 523.25 Hz.
Because samples were downloaded on demand, only after the first key press. Now the samples are preloaded and decoded as soon as you start, so the piano sound is there from the very first key. If the network fails, a synth fallback keeps you playing.
f = 440 × 2 raised to the power (n/12), where 440 Hz is the middle A (A4) frequency and n is the number of semitones from that note to A4, positive for notes above it and negative for notes below it.
Because 440 Hz for A4 was adopted as the international standard by ISO 16 in 1955, unifying tunings that had varied between orchestras and countries up to that point.
It is browser audio latency: the signal passes through the `AudioContext` and the operating system audio driver before reaching the sound output, a path that typically adds 10 to 50 ms, varying by hardware and system.
12, in the equal temperament used by the standard Western piano; moving up all 12 semitones of an octave exactly doubles the starting note frequency.