A web-based music practice application that provides real-time pitch feedback while you play along with recordings.
- 🎤 Real-time Pitch Detection: Uses advanced DSP algorithms (YIN) to detect the pitch you're playing
- 📊 Visual Feedback: Scrolling pitch chart shows the target melody and your performance
- 📈 Accuracy Tracking: Get instant feedback on whether you're on pitch, sharp, or flat
- 🎛️ Practice Tools:
- Tempo control (50%, 75%, 100%)
- Loop sections for focused practice
- Silent mode to play from memory
- 🔧 Microphone Diagnostics: Built-in tools to troubleshoot microphone setup
- 🎨 Beautiful UI: Modern design with automatic dark mode support
- Node.js 16+ and npm
- A modern web browser (Chrome, Firefox, Safari, or Edge)
- A microphone for pitch detection
# Clone the repository
git clone https://github.com/YOUR_USERNAME/musiccoach.git
cd musiccoach
# Install dependencies
npm install# Start the development server
npm run devThe app will be available at http://localhost:3000
# Create optimized production build
npm run build
# Preview the production build
npm run preview- Choose a Practice Piece: Select a built-in demo or upload your own audio file
- Start the Microphone: Click "Play" to begin - the app will request microphone access
- Play Along: The gold line shows the target melody, your pitch is drawn on top in color
- Get Feedback: Watch the tuning meter and accuracy percentage in real-time
- Practice Tools: Adjust tempo, loop difficult sections, or turn off sound to practice from memory
- 🎧 Wear headphones while the recording plays, so the microphone only hears your instrument
- 🎻 Works best with solo violin or another single-line instrument
- 🎯 A note counts as on pitch within 40 cents and about a sixth of a second
- Frontend: React 18 with TypeScript
- Build Tool: Vite 5
- Audio Processing: Web Audio API
- Pitch Detection: YIN algorithm implementation
- Canvas Rendering: Real-time visualization using Canvas 2D
musiccoach/
├── src/
│ ├── components/ # UI components
│ │ ├── Header.tsx
│ │ ├── SourceSelector.tsx
│ │ ├── PitchCanvas.tsx
│ │ ├── Transport.tsx
│ │ ├── Readout.tsx
│ │ ├── Diagnostics.tsx
│ │ ├── PracticeTools.tsx
│ │ └── Tips.tsx
│ ├── hooks/ # Custom React hooks
│ │ ├── useAudioEngine.ts
│ │ ├── useMicrophone.ts
│ │ └── usePitchDetection.ts
│ ├── utils/ # Utility functions
│ │ └── pitch.ts # DSP algorithms
│ ├── App.tsx
│ └── main.tsx
├── package.json
├── vite.config.ts
└── README.md
- YIN Pitch Detection: Accurate fundamental frequency estimation
- Decimation: Sample rate conversion for efficient processing
- Median Filtering: Removes octave errors from pitch detection
- Time-stretching (WSOLA): Planned feature for tempo control
Works best in modern browsers with Web Audio API support:
- ✅ Chrome/Edge (recommended)
- ✅ Firefox
- ✅ Safari
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the Unison violin practice app
- YIN pitch detection algorithm by Alain de Cheveigné and Hideki Kawahara
- Built with modern web technologies and best practices
For questions or feedback, please open an issue on GitHub.
Made with ❤️ for musicians who want to practice smarter, not harder.