A terminal-based piano application that lets you play music right in your command line! Built with TypeScript, React, and Ink.
- π΅ Play piano notes using your computer keyboard
- π¨ Visual piano interface with real-time feedback
- πΌ Multiple octave support with easy switching
- πΉ Pre-generated high-quality piano tones
- π» Cross-platform compatibility
# Clone the repository
git clone https://github.com/yourusername/tPiano.git
cd tPiano
# Install dependencies
npm install
# Generate piano sounds
npm run generate-notes
# Build the application
npm run build
# Start playing!
npm startOnce running, you can play the piano using your keyboard:
- White Keys: A S D F G H J K
- Black Keys: W E T Y U
- Octave Control: β/β arrows
- Display Size: β/β arrows
The interface shows:
- Current octave and display settings
- Visual feedback for pressed keys
- Octave boundaries with color coding
# Start in development mode
npm run dev
# Run tests
npm test
# Lint code
npm run linttPiano/
βββ src/
β βββ app.tsx # Main application component
β βββ cli.tsx # Entry point
β βββ scripts/ # Utility scripts
β βββ test.tsx # Test suite
βββ assets/
β βββ piano-sounds/ # Generated WAV files
βββ docs/ # Documentation
tPiano uses several key technologies:
- Ink: For terminal UI rendering
- React: For component-based architecture
- TypeScript: For type safety
- tonegenerator: For waveform generation
- play-sound: For audio playback
- Terminal limitations prevent true key-up event detection
- Basic sine wave synthesis for sounds
- No simultaneous note (or chord) playback
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Consider cross-platform compatibility
This project is licensed under the MIT License
- Ink for the amazing terminal UI framework
- tonegenerator for sound generation capabilities
- All contributors who have helped shape this project
Made with