gizmobench

Virtual Piano

Two octaves of keys that sound the moment you press one, because there is no sample library to download first: every note is synthesised in the page at the equal-tempered frequency for its letter, measured from A4 = 440 Hz. Play with the mouse, with a finger, or with the computer keys under your hands, where Z X C V B N M runs up the lower octave and Q W E R T Y U runs up the one above it. Hold a key and the note holds, press several and they sound together, and turn Sustain on to let each one ring after you let go. The readout names the note, its frequency to three decimals and how far it sits from concert A in semitones, the octave control moves the whole keyboard between C3 and B6, and the score view writes down what you played as note names you can copy. Turn on Quiz and the letters leave the keys: it asks you to find a note on the board, or lights a key and asks you to name it, and the name comes back only once you have answered. Nothing is uploaded, no audio is recorded and no account is asked for.

A4 = 440 HzSine
Note
C4
Frequency
261.626 Hz
Interval from A4
-9 semitones
Octave

Nothing playing. Click a key, or press Z X C V B N M for C4 upwards and Q W E R T Y U for the octave above it.

  • Middle CC4, the reference every method book starts at
    261.626 Hz
  • Concert AA4, the tuning fork itself
    440.000 Hz
  • An octave upA5, exactly double, by definition
    880.000 Hz
Nothing to load. Every key is the equal-tempered frequency for its note at A4 = 440 Hz, computed rather than sampled, so the pitches are exact. It cannot know your instrument's tuning, and a browser's audio latency varies by a few milliseconds, so it is not a timing reference. The notes you play and the quiz score live in this browser and in this visit only: leaving the page forgets them, and the octave and the key labels are the only settings kept.

Common questions

Which computer keys play which notes?
The bottom row of letters is the lower octave, and the row above it carries that octave's sharps: Z is C, X is D, C is E, V is F, B is G, N is A and M is B, with S, D, G, H and J as C sharp, D sharp, F sharp, G sharp and A sharp. The octave above sits on the two rows further up: Q, W, E, R, T, Y and U are its white keys and 2, 3, 5, 6 and 7 are its sharps. Press Labels and every key on screen shows the computer key that plays it. Holding a key holds the note, and several keys at once sound together as a chord. The letters are the ones a US QWERTY keyboard sends, so on another layout the two rows sit in the same place but send different letters, and clicking or tapping a key always works.
Is anything downloaded or uploaded?
No. There is no sample library and no audio file: each note is generated by the browser's own audio engine from the frequency this page computes for it, which is why the first key sounds at once rather than after a download. Nothing you play leaves the page, there is no account, and after your first visit the page is cached so it still plays with no connection. The only things kept between visits are the octave you chose and whether the key labels are on, stored in this browser and nowhere else.
Why is it tuned to A4 = 440 Hz, and what if my instrument is not?
440 Hz for the A above middle C is the modern concert-pitch standard, and it is the one reference every note here is measured from: each semitone up multiplies the frequency by the twelfth root of two, each octave doubles it, and middle C comes out at 261.626 Hz. Plenty of ensembles sit elsewhere, at 442 or 443, at 415 for early music, or wherever an old upright has drifted to. This page plays 440 and nothing else, so if you are tuning to another standard, use it for the intervals rather than the absolute pitch: the distance between two keys is the same wherever the reference sits.
Can it record or export what I played?
It does not record audio and there is no file to save. What it does instead is the score: press Score and every note you play is written down by name in the order you played it, up to the last 200, and the list can be copied as text or cleared. That list lives in the page for this visit only, so a reload starts an empty one. It holds the notes and their order and nothing about timing: how long you held each key is not written down.
Can I quiz myself on the note names?
Yes. Press Quiz and the letters leave the keys, so there is nothing to read off. Find the note shows a letter and you press that key on the board, or type its computer key, and either octave counts. Name the key lights one key, plays it, and you pick its name from the row of letter chips. Either way the asked key lights up with its name once you have answered, right or wrong, and the readout fills in, so a mistake shows you the answer rather than just marking it. It starts on the seven white keys, and Sharps too adds the ten black keys to the questions and to the chips. The same note is never asked twice running. The score is right out of asked for this visit only: it is not saved, so leaving the page forgets it, and there is no account to keep it in.
Can I play it on a phone or a tablet?
Yes. Tap a key and it sounds, hold it and the note holds. On a narrow screen the keyboard keeps all fourteen white keys and scrolls sideways rather than shrinking them below the size of a fingertip, so you swipe along the board to reach the top of the range. Browsers will not play any sound until the page has been touched once, which is why the very first tap both wakes the audio and plays its note.
Why does it sound like a tone rather than a real piano?
Because that is what it is: each key plays one sine wave at the note's frequency, with a short attack and a fade when you let go, not a recording of a hammer hitting a string. A piano's sound is that hammer, the strings and the soundboard together, and reproducing it means shipping a sample library that has to load before the first note sounds. The trade here is deliberate, and the page says which side of it you are on: the pitch is exact and immediate, and Sustain holds each note ringing for about a second and a half after release, the way the right pedal does.

Every key is the equal-tempered frequency for its note at A4 = 440 Hz, computed rather than sampled, so the pitches are exact. It cannot know your instrument's tuning, and a browser's audio latency varies by a few milliseconds, so it is not a timing reference.