The Web Audio API creates an audio processing graph. This piano uses an `OscillatorNode` (wave generator) connected to a `GainNode` (volume control). The gain follows an ADSR envelope: fast attack, gentle decay, and long release, imitating the behavior of an acoustic piano.
Online Piano
Play real notes directly in your browser
Real audio synthesis with Web Audio API
This piano uses an `OscillatorNode` with an ADSR (attack, decay, sustain, release) envelope to simulate acoustic piano sound. The triangle oscillator produces natural harmonics. The QWERTY physical keyboard maps keys A–; to notes C4–E5, allowing you to play without using the mouse.
Play with keyboard or mouse
- Click any white or black key to play the note.
- Use physical keyboard keys (A, W, S, E, D, F, T, G, Y, H, U, J, K...) to play octave 4 notes.
- The active note is displayed at the top and the key lights up during the sound.
Sources and references for this tool
These references help contextualize formulas, standards, APIs and limitations used on this page. They do not replace professional validation when a result has legal, financial, medical or operational impact.
- AudioContextMDN Web Docs — Main audio context for synthesizing piano notes.
- OscillatorNodeMDN Web Docs — Wave oscillator for note synthesis.
- GainNodeMDN Web Docs — Amplitude envelope (ADSR) for note volume control.
- Web Audio API — W3CW3C — Web Audio API specification used for in-browser audio synthesis.
- MIDI Note Number ReferenceInspired Acoustics — Reference for musical note frequencies and MIDI numbering.