Virtual piano
Press the keys with the mouse or your finger, or play them from the computer keyboard: the Z row is the lower octave and the Q row the upper. Several notes can sound at once. The sound is generated by your browser, there are no recordings.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Press the keys with the mouse or finger, or use the computer keyboard (the letters are printed on the keys).
- Change the Octave with the minus and plus buttons or the arrow keys.
- Pick a Sound and set the Volume.
- Slide the keyboard sideways on a narrow screen to reach the other keys.
How it works
Each key is an oscillator at the frequency of its note, 440 Hz × 2^((n - 69)/12) for MIDI note n, with a short attack and a release. The keyboard shows 24 semitones, from C to the C two octaves above, starting at the octave you choose; middle C is C4.
Worked example
A is note 69 and sounds at 440 Hz. Middle C (note 60) is 261.63 Hz. Playing Z, C and B together at octave 4 gives a C major chord: C4, E4 and G4.
Tips
- Soft and pure sounds suit melodies, while square and sawtooth cut through better.
- Use headphones for low octaves: small speakers cannot reproduce them.
Frequently asked questions
Which computer keys play which notes?
Z, X, C, V, B, N, M are the white keys C to B of the chosen octave, and S, D, G, H, J the black keys between them. Q, W, E, R, T, Y, U and I continue an octave higher with 2, 3, 5, 6 and 7 as the black keys. The key labels on the piano show them.
Can I play chords?
Yes. Hold several computer keys, or touch several keys on a touch screen, and all of them sound together.
How are the sounds made?
With Web Audio oscillators and a smooth volume envelope, so they are synthesised in your browser. They resemble electronic keys rather than a recorded grand piano.
Why is there no sound at first?
Browsers only start audio after you press or click something. The first press on a key unlocks the sound, and the keys then play normally.