hello dear all good day.
i want to create a guitar tuner:
This project might not be as easy as you think, once we have got the signal in. We can get the note easy enough but not the octave. Most of those projects are for a simple waveform frequency measurement and a guitar produces a complex evolving waveform that messes up the measurement.
to begin with the beginning: i am pretty new to the Arduino. And i think i just have to give it a test, and really will learn a lot. okay - you say - we buy a guitar tuner for less than 30 Dollars, but thats not that reason i want to do a guitar tuner myrself
i guess that it is pretty important to understand the principle behind the build. There are 7 major musical notes denoted by the alphabets; A, B, C, D, E, F, G - see more below:
The range allowed by the Arduino Audio frequency library spans from 60 to 1500 Hz.
so we have a Guitar string frequencies are (standard tuning) :
329.63 Hz (E),
246.94 Hz (B),
196.00 Hz (G),
146.83 Hz (D),
110.00 Hz (A)
82.41 Hz (E)
The project; what needs to be done: we convert the sound signal generated by the guitar to a frequency then compare with the exact frequency value of the string being tuned.
The frequency detection/conversion involves 3 main stages;
- Amplifying: here we use a o-amp
- Offsetting: here we take care for the ofset
- Analog to Digital conversion(sampling): here we take care for the conversion of the signal
In detail - we have the following steps in the chart:
- Signal input
- Analysis
- Comparison
- Presentation
(* Operation / ON-OFF / change of mood etc.)
first of all: we need to get the sound signal: The sound signal being produced will be much much too weak for the Arduino’s ADC. We have (for sure ) to amplify this - this is very important.
After amplification, to keep the signal within the range recognizable by the Arduino’s ADC - this is the Analog Digital converter. Another OpAmp between guitar and Arduino (maybe also a low pass) — the signal is tooo weak - for the ADC.
well we need to prevent clipping of the signal; doing so we need to offset the voltage of the signal.
After offsetting, the signal is then passed to the Arduino ADC; Thats just fine: Now we can go ahead where it is sampled and the frequency of that sound is obtained.
How we then turn the read-in values into "too high / too low"; There should be enough examples on the internet but in the end it will probably be not to difficult i guess here
Frequency analysis, plus filtering the strongest signal or the desired main tone. well - are there any Libs out there : this would be great Otherwise I could imagine that we first have a fixed table of frequency values, I'm going to start with the normal mood on E.
So, frequency table as assignment of tone constants to frequency. Then the tolerance-range from which the analysis recognizes the approximate tone,
Well the recogition is pretty important: If the system will recognice:
the user would definitely like to tune the E string, so I'll show him the range"
You would then have to define whether you would then assume 10% down or up, or whether you would enter that or whatever. In the end it is a pure comparison of numbers.
( we could also have the reference tone output to check whether you are totally wrong ...)
So let's separate the partial programs:
- Signal input
- Analysis
- Comparison
- Presentation
(* Operation / ON-OFF / change of mood etc.)
If we encapsulate it in this way, we can certainly make the representation as LED patterns, pointers, LCD display, the main thing is that the basic data is correct. To the signal input: Is it enough to simply fish the electrical signal at the jack socket, or do you place a piezo? Or both? Then connect high and low pass in hardware before going into the ANALOG-IN, or let the ARDi do it?
analysis: There are definitely ready-made libs out there:
Comparison: as I said, I would do it using a table, first prototype only for E-tuning.
A further development would then be to have a global table for the usual tones and then refer to them via whatever
this leads to the final stage - to the Presentation
Well - what do you say - which Arduino to take for this project?