๐ Live Demo
Try it now! Click the link above to start playing piano with your computer keyboard instantly - no installation required!
A beautiful, interactive web-based piano application that lets you play music using your computer keyboard or mouse. Perfect for learning piano, practicing songs, and exploring musical creativity.
- 88-key piano interface with realistic white and black keys
- Visual feedback with purple highlighting when keys are pressed
- Mouse interaction - click keys to play notes
- Multiple octaves spanning from C3 to C6
- Play with your keyboard - no MIDI controller needed!
- Customizable key mapping - assign any keyboard row to any octave
- Three keyboard rows for different octaves:
- QWERTY row (default: Octave 3-4)
- ASDF row (default: Octave 4-5)
- ZXCV row (default: Octave 5-6)
- Modifier keys:
- Hold Shift for sharps (#)
- Hold Ctrl for flats (โญ)
- 5 built-in songs:
- Happy Birthday
- Twinkle Twinkle Little Star
- Mary Had a Little Lamb
- Ode to Joy
- Jingle Bells
- Listen Mode: Hear songs play automatically
- Practice Mode: Interactive learning with note-by-note guidance
- Musical Score Display: See notes in standard musical notation
- Progress Tracking: Visual progress bar and note counter
- Auto-scroll: Keeps current note centered in the score view
- Volume Control: Adjustable audio volume
- Keyboard Settings: Fully customizable key-to-note mapping
- Audio Engine: Web Audio API for high-quality sound synthesis
- Responsive Design: Works on desktop, tablet, and mobile devices
- Node.js (version 16 or higher)
- Modern web browser with Web Audio API support
-
Clone the repository
git clone https://github.com/seehiong/noteflow cd noteflow
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:5173
to start playing!
- Use your keyboard: Press Q, W, E, R, T, Y, U, I for a C major scale
- Click the piano: Use your mouse to click virtual piano keys
- Adjust volume: Use the volume slider to control audio level
- Select a song: Click any song button in the left sidebar
- Choose mode:
- Listen Mode: Click "Play" to hear the song
- Practice Mode: Click the mute button to enter interactive practice
- Follow along: In practice mode, play the highlighted red notes to progress
- Stuck on a note? Click the bouncing red note to see which keyboard keys to press
- Need different mapping? Click "Keyboard Settings" to customize your layout
- Click "Keyboard Settings" button
- Set octaves for each keyboard row:
- QWERTY row โ Choose base octave (1-7)
- ASDF row โ Choose base octave (1-7)
- ZXCV row โ Choose base octave (1-7)
- Preview mapping - see exactly which keys play which notes
- Save settings or reset to defaults
- Standard notation: Uses traditional note names (C, D, E, F, G, A, B)
- Solfege support: Shows do, re, mi, fa, so, la, ti for educational purposes
- Octave range: Covers multiple octaves for full musical expression
- Web Audio API: High-quality, low-latency audio synthesis
- Sine wave oscillators: Clean, pure tones perfect for learning
- Real-time processing: Immediate audio feedback with no delay
- Note-by-note learning: Progress only when you play the correct note
- Visual guidance: Clear highlighting of current note to play
- Audio feedback: Hear your playing to develop ear training
- Completion tracking: See your progress through each song
- React 18 with TypeScript for robust component architecture
- Vite for fast development and building
- Tailwind CSS for beautiful, responsive styling
- Lucide React for crisp, modern icons
- Web Audio API for professional audio synthesis
- ESLint for code quality and consistency
- Apple-level aesthetics: Clean, sophisticated visual design
- Intuitive UX: Natural interactions that feel familiar
- Responsive layout: Optimized for all screen sizes
- Accessibility: High contrast ratios and keyboard navigation
- Performance: Smooth animations and responsive audio
- Chrome/Chromium: Full support
- Firefox: Full support
- Safari: Full support
- Edge: Full support
Note: Requires Web Audio API support (available in all modern browsers)
- Start with simple songs like "Twinkle Twinkle Little Star"
- Use practice mode to learn note by note
- Click notes for hints when you're stuck
- Customize keyboard mapping to match your comfort level
- Try complex songs like "Ode to Joy"
- Use different octaves by customizing keyboard rows
- Practice with sharps and flats using Shift and Ctrl modifiers
- Challenge yourself by turning off auto-scroll
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLint
src/
โโโ components/ # React components
โ โโโ Piano.tsx # Virtual piano interface
โ โโโ MusicalScore.tsx # Musical notation display
โ โโโ KeyboardSettings.tsx # Keyboard mapping configuration
โ โโโ KeyboardHint.tsx # Practice mode hints
โ โโโ SampleSongs.tsx # Song selection (removed in compact layout)
โโโ utils/ # Utility functions
โ โโโ AudioEngine.ts # Web Audio API wrapper
โ โโโ noteMapping.ts # Keyboard-to-note mapping logic
โโโ data/ # Static data
โ โโโ sampleSongs.ts # Song definitions
โโโ App.tsx # Main application component
To add your own songs, edit src/data/sampleSongs.ts
:
export const sampleSongs = {
"Your Song Name": {
notes: ['C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4', 'C5'],
durations: [1, 1, 1, 1, 1, 1, 1, 2] // In beats
}
};
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
- Web Audio API for enabling browser-based audio synthesis
- React community for excellent development tools
- Tailwind CSS for rapid, beautiful styling
- Lucide for clean, consistent icons
Happy Playing! ๐นโจ
Transform your computer into a musical instrument and start your piano learning journey today!