How the virtual piano works
Every key is synthesised live with the Web Audio API. Pressing a key starts two oscillators — a triangle wave for the body of the note and a quieter sine an octave above for a little brightness — through a low-pass filter. The volume jumps up over 15 milliseconds, drops quickly, then fades over about 1.6 seconds. There are no recorded samples and no audio files to load.
With Sustain on, a note holds at a steady level while you keep the key down and fades over a quarter of a second when you let go; holding Shift does the same. With Sustain off, notes decay like a plucked string even if you keep holding.
The board holds two octaves at a time, 15 white keys and 10 black ones. Octave −/+ moves the starting note between C2 and C5, so the full range is C2 to C7. The two octaves sit side by side on a wide screen and stack into two rows on a narrow one. Browsers block audio until you interact with the page, so the first tap also switches the sound engine on. If you leave the tab, every sound stops.
Keyboard, touch and mouse
The computer keys follow the layout used by trackers and digital audio workstations: A W S E D F T G Y H U J K O L P ; ' play the notes from C upwards. The letters are printed on the keys, and keys without a letter have to be clicked. Multi-touch uses Pointer Events, so each finger gets its own note and sliding a finger plays the keys it crosses. A mouse click and drag works the same way.
Frequently asked questions
Why is there no sound?
Most browsers won't start audio until you click or tap something, which is why the first key press may be silent — try once more. Also check the tab isn't muted, the device volume is up, and headphones aren't plugged in somewhere else.
Can I play chords and more than one note at once?
Yes. Fingers on a touchscreen and several keys on a computer keyboard can sound together. How many depends on the device and the browser, but five or six is normal. Slide with one finger and you get one note at a time, as on a real keyboard.
What do the letters on the keys mean?
They're the computer keys you can press instead of clicking. The pattern runs A W S E D F T G Y H U J K O L P ; ' from the lowest white key upwards, with the black keys on the letters in between.
How do I play higher or lower notes?
Use Octave − and Octave +. The readout next to them shows the two octaves currently on screen; the buttons stop at C2 and C5 so the board never goes below C2 or above C7.
Does it work on a phone or tablet?
Yes. Tap the keys, or slide a finger across them. Turn the phone sideways to get wider keys on the two stacked rows.
Is anything recorded or uploaded?
No. The notes are made on your device and the page doesn't record, save or send your playing anywhere.