Your keyboard plays piano notes. Hold several keys for a chord; a note rings while its key is down and fades when you let go.
Keys
The bottom two letter rows are the lower octave, the top two are the upper octave. White keys sit on the Z and Q rows, black keys on the row above each.
| Notes | White keys | Black keys |
|---|---|---|
| C3 to E4 | Z X C V B N M , . / | S D G H J L ; |
| C4 to G5 | Q W E R T Y U I O P [ ] | 2 3 5 6 7 9 0 = |
| Key | Does |
|---|---|
| Space | Sustain pedal. Notes released while it is held keep ringing until you let it go. |
| Left, Right | Shift every key down or up an octave, one octave either way. |
| F9 | Plays the chosen song by itself, both hands. Press it again to stop. The keys stay live, so you can play along. |
| F8 | Piano off or on. While it is off the keys type normally. |
Those five keys, the note volume and the damper time are configurable. Restart the script after changing a key.
Chords that include Ctrl, Alt or Cmd/Win are left alone, so shortcuts keep working while the piano is on.
The game
Starting the script opens http://localhost:47800 in your default browser. Blocks fall toward a piano, each printed with the key that plays it. Press that key as the block lands on the line.
- Hits within 70 ms score Perfect, within 160 ms Early or Late, and anything else is a miss. A combo multiplies the score and a wrong key breaks it. Each run ends with a grade, and the page keeps your best score per song and speed.
- The piano plays the left hand while you play the melody. Watch it played has it play both hands.
- Three speeds: slow, medium and full.
Five songs, easiest first: Twinkle, Twinkle, Little Star; Ode to Joy; Jingle Bells; Minuet in G; Für Elise. All are in the public domain, and every melody fits the upper key row without an octave shift. The song you pick on the page is the one F9 plays.
The package declares two permissions. net serves the page and makes no outbound connection. exec is used once, to open the page in your browser; turn off "Open the game page when the script starts" under Game to skip it. The page is served on localhost only. The WebSocket that feeds it, port 47801, accepts connections from your local network; it sends the notes being played and accepts only a song choice, play and stop. Turn off "Serve the game page" and restart the script to open no ports at all.
Sound
The notes are synthesized, not recorded from an instrument: one Ogg Vorbis file per note under samples/, from C2 to G6, at 48 kHz. The model stacks the stretched partials of stiff strings, shapes them by where and how hard a felt hammer strikes, lets each one decay in two stages, and gives every note two or three slightly mistuned strings and a short hammer knock. tools/synth.py regenerates the samples with Python's standard library and ffmpeg.
Limits
- The note keys are captured system wide while the piano is on. Press the on or off key before you type.
- Every key plays at the same loudness. A computer keyboard cannot tell how hard you press.
- Many keyboards cannot report some combinations of three or more keys at once. A chord that drops a note is the keyboard's limit, not the script's.



