Overview
The concept of how a guitar is tuned should be simple to understand: each of the six strings of a guitar emits a sound at a specific frequency when played open (that is when no fret is pushed). Tuning a guitar means tightening the string until a specific frequency is emitted. This is the list of frequencies each string should emit to be standard tuned:
The digital process of tuning a guitar will follow these steps:
- Record a live sample of the frequencies captured through the device's microphone.
- Find the most prominent frequency in that sample.
- Calculate what is the closest frequency in the preceding table to detect what string is being played.
- Calculate the difference between the frequency emitted and the standard tuned frequency for that string, so we can let the user correct the string tension.
There are also some pitfalls we need to overcome, like ignoring low volumes so that we don't confuse the user by detecting frequencies from sounds which are not coming from the strings.
For much...