@chordbook/tuner
A web-based library for pitch detection of stringed instruments. It uses the Web Audio API to capture audio from the microphone, and uses the pitchy to detect the predominant pitch.
Features
- ✅ Uses your devices microphone to detect the pitch of stringed instruments
- ✅ Filters noise from low and high frequencies outside the range of stringed instruments
- ✅ Does not try to detect when the volume is too low
Installation
npm install @chordbook/tuner
Usage
import { createTuner } from '@chordbook/tuner'
const tuner = createTuner({
onNote: note => {
console.log('Note:', note)
},
})
tuner.start()
tuner.stop()
When a pitch is clearly detected, the onNote
callback is called with an object containing the following properties:
{
"frequency": 612.2498364209699,
"name": "D♯",
"value": 75,
"cents": -29,
"octave": 5,
"clarity": 0.9656978357299373
}
Contributing
Contributions are welcome!
- Clone this repository:
git clone https://github.com/chordbook/tuner.git
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:5173/ in your browser
License
This project is licensed under the GPLv3.0 license.