View Full Version : [queued] guitar tuner with FFT and Yin

05-08-2020, 03:14 PM
Here a tuner and frequency logger project I just completed.

The tuner uses yin algorithm from the teensy audio library, fft frequency estimation from here (https://forum.pjrc.com/threads/36358-A-New-Accurate-FFT-Interpolator-for-Frequency-Estimation) (had to edit cpu defines for T4), a bubble-display library from here (https://github.com/DeanIsMe/SevSeg), serial command library from here (https://github.com/scogswell/ArduinoSerialCommand) and my own led (https://github.com/jpk73/LEDsimple) and button (https://github.com/jpk73/debouncetm/) libraries. Also I put together some code for reading a wacky mechanical rotary encoder, similar to this code (https://www.mikrocontroller.net/articles/Drehgeber#Dekoder_f.C3.BCr_Drehgeber_mit_wackelige n_Rastpunkten), with polling, so no interrupts (see attached files), it debounces fine.

The tuner can act as a device for musicians (it also has a metronome) and measures battery voltage: as soon as voltage drops it writes it's settings to eeprom. Various settings can be tuned via the serial interface and saved into eeprom. See screen shots for details and serial output of yin and fft.

left: first version with T3.6, middle T3.6 without display (will be used as a frequency logger for a project musicians and physicians are working on), right T4 with speaker, rotary encoder and lipo-charger.

voltage = 4.1V

T4 with transparent plastic cover

PCB designed in kicad

serial output of yin and fft

tuning the settings via serial

code files: 20034

05-09-2020, 09:23 PM

Today I completed the wooden housing for the T3.6 tuner...

05-11-2020, 11:55 AM
Are you Data? :) reading the guitar tuner in counts of Hz, not notes and off-cents? Super cool project, thanks for sharing.

05-12-2020, 10:20 PM
Thanks! Thats exactly one of the reasons I did this project: available tuners with notes and cents give the impression you are in tune even if you arent at all by lighting green etc., so if a musician sees Hz he will take care as never before :-)

Also he needs some knowledge to actually tune and decide for the frequency first (i.e. decide which tuning system to use and how to calculate the desired freq). If this is not of interest: well I guess a note/cent tuner with green lights suits better ;-)