The Lo-Fi Rain Piano is a relaxing music generator that plays itself. Press play and raindrops fall at random across the screen; whenever one hits a key at the bottom, that note sounds. The result is a piano melody that never repeats yet never sounds harsh, ideal for studying, coding, unwinding before bed or simply watching the rain.
It always sounds harmonious because all 12 keys come from the A minor pentatonic scale, A, C, D, E and G, spanning A3 (220 Hz) to C6 (about 1047 Hz). A pentatonic scale contains no notes a semitone apart, so any two notes played together avoid obvious dissonance. That is why folk music, blues improvisation and lo-fi tracks use it so often. A minor adds a gentle, slightly melancholic color that suits a rainy day.
The rain density slider (10%–100%) controls how many drops fall. Low density gives sparse notes, like a light drizzle outside the window, good for deep focus; high density makes a flowing melody, like an afternoon downpour. You can layer two ambient sounds underneath: rain made from filtered white noise, and a campfire built from low brown noise with random crackles. Use either one or both.
Every sound is synthesized live with the browser’s Web Audio API. The piano uses a soft triangle wave with a quick attack and a natural decay of about two seconds, close to an electric piano. No audio files are downloaded and nothing is uploaded. Browsers only allow sound after a user action, so click the play button first; on some phones, silent mode also mutes web audio.