Play Piano With Your Computer Keyboard
Did you know you can play a fully sampled grand piano using nothing more than your standard computer keyboard? Octype maps physical computer keys directly to notes on the piano, giving you a highly responsive, zero-install musical instrument directly inside your web browser.
How Keyboard Input Works
Octype listens to document-level key events. When you press a key on your computer keyboard, the engine instantly translates the key code into a MIDI note number, matches it to the corresponding concert grand sample layer, and triggers playback using the Web Audio API. Because the audio scheduling runs independently from the React render cycles, latency is kept under 10 milliseconds, making it feel like a real physical instrument.
Octype Key Mappings
Octype offers two default presets and a fully custom editor to map keys according to your comfort:
- Default Mapping (3 Octaves): Covers middle range C4 to C6. White keys are mapped to QWERTY, UIOP, and ZXC rows. Black keys map to number row digits and home-row keys. Ideal for two-handed melodies and simple harmonies.
- Max Mapping (5 Octaves): Spans from bass C2 all the way to treble C7. It utilizes the
Shiftkey to play accidental/black keys, allowing you to access a massive range without run-out space constraints. - Custom Mappings: Create your own layout. Open Settings, click Custom Mapping, and select your preferred octave count. Arm any key and press the physical button to bind it.
Playing Chords
You can play multiple keys simultaneously to sound chords (such as major/minor triads). Since Octype has unlimited polyphony (capped only by your browser capabilities, with a default cap of 24 voices), you can build complex harmonic layers.
Keyboard Rollover (NKRO) Limitations
If you try to play certain complex chords and notice some notes fail to register, you are likely experiencing a hardware limitation known as keyboard ghosting or rollover. Most standard laptop and office keyboards share electrical traces between keys. If you hold down 3 or more keys in the same matrix row/column, the keyboard controller blockages the signal.
To work around this hardware limitation, Octype provides a sustain pedal feature. By holding Space or toggling sustain on, you can let played notes ring out naturally, allowing you to layer complex chords one note at a time without bottlenecking keyboard matrix limitations.
How to Start Playing
- Open the Octype homepage.
- Click the ▶ start piano button to warm up the browser AudioContext.
- Make sure your browser window is focused.
- Press keys on your computer keyboard to play notes, and hold
Spacefor sustain.