Skip to content

Piano

Music

How about playing the piano right here?

Play a two-octave piano with the mouse, touch, your computer keyboard or a MIDI keyboard, with sustain and note names.

Keyboard

Normal view. Keep-awake is off.

Computer keys: Z–M play the lower octave (S, D, G, H, J the black keys), Q–U the upper (2, 3, 5, 6, 7). Hold Space for the pedal; − and + change the octave.

Sound

Instrument

MIDI keyboard

This browser does not support MIDI keyboards.

Note

C4

261.63 Hz · MIDI 60

Sound stays below a safe ceiling. Start with low volume on headphones.

Sponsored Links

Play a two-octave piano with the mouse, touch, your computer keyboard or a MIDI keyboard, with sustain and note names.

How to use

  1. Press the keys with the mouse or your fingers; several fingers play a chord, and sliding along the keys plays them one after another.
  2. On a computer keyboard, the bottom letter row plays the lower octave from Z (C) to M (B), with S, D, G, H and J as the black keys; Q to U play the octave above, with 2, 3, 5, 6 and 7.
  3. Hold Space (or turn on Sustain) to keep notes ringing like the piano's pedal. Change the octave with − and + or the buttons.
  4. Choose the instrument and volume under Sound. To play from a MIDI keyboard, press Connect and allow access.

How it works

Each key is a note one semitone above the key to its left: twelve keys, seven white and five black, make an octave, where the frequency doubles. Notes are named by letter and octave number, and middle C is C4. In Finnish and German the note B is called H, and B flat is called B.

The pitch of every key follows equal temperament: f = 440 Hz × 2^((n − 69) / 12), where n is the key's MIDI number (A4 = 69, middle C = 60) and 440 Hz is the standard tuning note A4 (ISO 16). For example, middle C is 440 × 2^(−9/12) ≈ 261.63 Hz.

The sounds are made in your browser from a few pure tones per note, each fading at its own rate. A piano string's overtones are slightly stretched, while a marimba bar is tuned so its first overtone is two octaves up and a xylophone bar's an octave and a fifth up (HyperPhysics). They are simple imitations, not recordings.

The computer keys follow the layout of music trackers such as ProTracker and FastTracker 2, which turned the letter rows into two piano octaves. Speakers, the browser and Bluetooth add a small delay; wired headphones are quickest.

Sponsored Links

Frequently asked questions

Why is there a delay before the sound?

Every device needs a moment to turn a key press into sound. Wired headphones or speakers add the least; Bluetooth headphones can add a clearly noticeable delay.

Can I play chords with the computer keyboard?

Yes, hold several keys at once. Some keyboards cannot report every combination of three or more keys, so a note may now and then stay silent.

Which MIDI keyboards work?

Most USB and Bluetooth MIDI keyboards work in browsers that support Web MIDI, such as Chrome and Edge. The keys, their strength and the sustain pedal are read on this device only.

Why do notes keep ringing after I release a key?

Sustain may be on. Release Space or the MIDI pedal and turn off the Sustain button. A sound’s natural fade can still continue briefly.

Do the computer keys work on AZERTY or QWERTZ keyboards?

Yes. The keys follow physical positions rather than the letters typed. The on-screen labels use US keyboard letters, so the labels on your keys may differ.

Sponsored Links

Sponsored Links