Guitar Tuner With Raspberry and Python
Karol, 27 September 2020
As one of projects on the university I've made my own guitar tuner using Raspberry Pi. Everything was coded in Python 3. The tuner is packed up in 3d printed enclosure (but it's only a prototype, needs to be polished :) ).
The program responsible for tuning is written in python. The audio is collected using pyaudio lib. Then audio signal is filtrated and transformed with Fourier Transformation. With finding the peaks in Fourier transform of a signal, the program matches string frequency with musical notes.
In the midlle of the screen, the current note and arrow(tune up, or down) is displayed. On the left we have string frequency and on the right there is an octave of the played note.
The tuners accuarcy is about +/-0.3 Hz. But the accuarcy can be easily increased with zero-padding in Fourier Transformation. Anyway 0.3Hz is quite good and makes the tuner very fast (I didn't try increasing accuarcy more than 0.3 Hz, but I think it won't strongly affect the speed of tuner).
Some more photos below:
Things I used to build guitar tuner
- Raspberry Pi 3B+,
- USB sound card,
- Tie clip microphone,
- LED diode,
- 2x buttons,
- 2x16 LCD display,
- 10k potentiometer
The program responsible for tuning is written in python. The audio is collected using pyaudio lib. Then audio signal is filtrated and transformed with Fourier Transformation. With finding the peaks in Fourier transform of a signal, the program matches string frequency with musical notes.
In the midlle of the screen, the current note and arrow(tune up, or down) is displayed. On the left we have string frequency and on the right there is an octave of the played note.
The tuners accuarcy is about +/-0.3 Hz. But the accuarcy can be easily increased with zero-padding in Fourier Transformation. Anyway 0.3Hz is quite good and makes the tuner very fast (I didn't try increasing accuarcy more than 0.3 Hz, but I think it won't strongly affect the speed of tuner).
Some more photos below:
I will post the code if there will be request - email me with the form on the main page ;)