Play piano and five other instruments directly in your browser. Click the keys, use your computer keyboard, or tap on a touch screen. HD instrument samples load automatically for studio-quality sound.
—
C3 – B4
120 BPM
Use your computer keyboard: Z–M for white keys, S–K for black keys
Advertisement
About This Tool
This virtual keyboard uses the Web Audio API (W3C standard) to generate instrument sounds in real-time directly in your browser.
It features a dual sound engine: instant synthesis for immediate playback, and HD instrument samples from the FluidR3 General MIDI soundfont for professional-quality sound. All frequencies follow 12-tone equal temperament with A4 = 440 Hz as defined by ISO 16:1975.
Choose an instrument from the selector buttons above the keyboard
Click keys, tap on touch devices, or use your computer keyboard (Z–M row for white keys, S–K row for black keys) to play notes
Adjust octave range, volume, and sustain to suit your needs. Press Record to capture your performance.
How to Use
Choose an instrument from the selector buttons above the keyboard
Click keys, tap on touch devices, or use your computer keyboard (Z–M row for white keys, S–K row for black keys) to play notes
Adjust octave range, volume, and sustain to suit your needs. Press Record to capture your performance.
Methodology
All sounds are generated using the Web Audio API (W3C standard). Frequencies follow 12-tone equal temperament (12-TET) where each semitone is a frequency ratio of 2^(1/12) ≈ 1.05946, with A4 = 440 Hz (ISO 16:1975 standard).
Piano uses additive synthesis with 8 harmonics and inharmonicity modeling to simulate the stretched partial tones of real piano strings. Electric Piano uses frequency modulation (FM) synthesis with a carrier-to-modulator ratio inspired by the Yamaha DX7 synthesizer (1983). Organ uses drawbar synthesis based on Hammond tonewheel organ principles, with 9 harmonics at footage ratios (16', 5⅓', 8', 4', 2⅔', 2', 1⅗', 1⅓', 1').
Synth Lead uses subtractive synthesis with detuned sawtooth oscillators through a resonant low-pass filter. Strings use detuned oscillators with slow attack envelopes. Marimba uses percussive synthesis with harmonic ratios characteristic of tuned bar instruments.
HD samples from the FluidR3 General MIDI soundfont load in the background for professional-quality playback. Each instrument has proper ADSR (Attack, Decay, Sustain, Release) envelopes for realistic dynamics.
The note display above the keyboard shows the currently playing note in scientific pitch notation (e.g., C4 for middle C) along with its frequency in Hertz. This helps you identify notes as you play and can serve as an ear training aid.
When HD samples are loaded, you will see an "HD" badge on the active instrument button, indicating that playback has switched from synthesis to high-quality recorded samples. Synthesis mode is indicated by the absence of this badge.
Velocity (how loud a note plays) is determined by where you click on a key — clicking near the top produces a softer sound, while clicking near the bottom plays louder. On computer keyboard input, notes play at a consistent medium velocity.
Practical Examples
Example 1: C Major Scale — Play the white keys in sequence from C4 to C5 (computer keyboard: Z, X, C, V, B, N, M, then shift up one octave and press Z). Each note's frequency doubles every octave: C4 = 261.63 Hz, C5 = 523.25 Hz.
Example 2: C Major Chord — Press C4 (261.63 Hz), E4 (329.63 Hz), and G4 (392.00 Hz) simultaneously. On the computer keyboard, press Z, C, and B together. Enable sustain first for a richer sound. Try the same chord with different instruments to compare timbres.
Playing Tips
Start with the Piano instrument and 2 octaves to learn the key layout. The note labels can be toggled on to help identify keys while learning.
Try playing a C major chord by pressing C, E, and G simultaneously. On the computer keyboard, that's Z, C, and B together.
Use sustain mode when practicing arpeggios — notes will ring together even after you release each key, creating a fuller sound.
Switch between instruments to hear how the same melody sounds with different timbres. The Organ has an instant attack, while Strings have a slow fade-in.
Adjust the octave range to focus on the register you need. For bass practice, shift down to octave 1–2. For treble melodies, shift up to octave 5–6.
More on AmazonAs an Amazon Associate I earn from qualifying purchases.
Frequently Asked Questions
How do I play the virtual piano?
You can play in three ways: click the keys with your mouse, tap them on a touch screen, or use your computer keyboard. The bottom row (Z, X, C, V, B, N, M) plays white keys, while the row above (S, D, G, H, J) plays black keys. You can play multiple notes at once to form chords.
What instruments are available?
Six instruments are available: Piano (additive synthesis with realistic decay), Electric Piano (FM synthesis inspired by the Yamaha DX7), Organ (drawbar synthesis based on Hammond tonewheel principles), Synth Lead (dual detuned sawtooth oscillators with filter), Strings (ensemble pad with slow attack), and Marimba (percussive mallet instrument). HD samples also load automatically for each instrument.
What keyboard shortcuts can I use?
White keys are mapped to the bottom row of your keyboard: Z (C), X (D), C (E), V (F), B (G), N (A), M (B). Black keys use the row above: S (C#), D (D#), G (F#), H (G#), J (A#). Hold keys down for sustained notes. The mapping follows one octave at the current octave position — shift the octave up or down to access different ranges.
How does the sound generation work?
The tool uses a dual sound engine. When you first play a note, it uses real-time Web Audio API synthesis — oscillators with ADSR (Attack, Decay, Sustain, Release) envelopes generate the sound instantly with zero loading time. Meanwhile, HD instrument samples from a professional General MIDI soundfont (FluidR3 GM) load in the background. Once loaded, playback automatically switches to the high-quality samples for studio-grade sound. All frequencies follow 12-tone equal temperament with A4 = 440 Hz (ISO 16:1975).
Can I record and play back my performance?
Yes. Press the Record button to start recording, then play your notes. Press Record again to stop. Your recorded sequence can then be played back using the Play button. The recording captures note timing, velocity, and duration, so it reproduces your performance faithfully. Note that recordings are stored in memory during your session — refreshing the page clears them.
Does it work on mobile phones and tablets?
Yes. The keyboard is fully touch-enabled and responsive. On smaller screens, the keys automatically resize to fit. You can use multi-touch to play chords. The keyboard also scrolls horizontally on narrow screens so you can access all keys. For the best mobile experience, use 1 or 2 octaves.
What does the sustain button do?
The sustain button acts like a piano sustain pedal. When enabled, notes continue to ring after you release the key, simulating the effect of lifting the dampers from the strings. This allows notes to overlap and blend together, creating a richer sound. Toggle sustain off to return to normal note behavior where sounds stop when you release the key.
Is my audio data private?
Yes. All sounds are generated entirely in your browser using the Web Audio API. No audio data is recorded, transmitted, or stored on any server. HD instrument samples are fetched from a public CDN (jsDelivr) as static audio files, and your playing data never leaves your device. The recording feature stores note data only in your browser's memory during the current session.
My Favorites
Drag to reorder
No favorites yet
Tap the ☆ on any tool page to bookmark it for quick access.