About Virtual Piano Keyboard with Sustain
Work out a melody, check a chord, find a note to tune to or just play. The keyboard shows two octaves and the C above them, anywhere from C1 to C8, and plays as many notes at once as you press, by mouse, by touch (several fingers at a time) or from your computer keyboard.
The home row plays the white keys and the row above it the black keys, the way many music programs lay them out; Z and X move an octave, and the space bar works as a sustain pedal. Choose a piano, an electric piano, an organ or a soft synth. Every sound is synthesised in your browser from sine waves, with no recordings to download.
How it works
- Each note is tuned in equal temperament with A4 at 440 Hz and built from sine-wave partials, each with its own level and decay: a piano’s stretched, fading overtones, an electric piano’s bell, an organ’s steady pipes or a sawtooth’s full set of harmonics.
- Your browser’s Web Audio engine plays the partials, and a limiter keeps loud chords from distorting. Up to 24 notes sound at once; past that the oldest note that is not held makes room.
- Computer keys are read by their position, not the letter printed on them, so the layout works the same on QWERTY, AZERTY and other keyboards.
Questions
Why is there no sound?
Browsers keep a page silent until you interact with it, so the first key you press starts the sound. Check that your device is not muted; on an iPhone the ring/silent switch can mute web audio.
How do I play it with my computer keyboard?
Select the keyboard (click it or move to it with Tab), then type. A, S, D, F, G, H, J, K, L, semicolon and apostrophe play the white keys; W, E, T, Y, U, O and P play the black keys between them. Z and X shift an octave, and holding the space bar sustains.
Can I play chords?
Yes. Hold several computer keys, or touch several keys with different fingers. Some computer keyboards cannot report more than a few keys held at once, which limits chords typed on them.
Does it record what I play?
No. It plays live and keeps nothing. Nothing you play is sent anywhere.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.