|
| WaveWarp 2.0 Example DrawingBoard

LiveGuitarTuner
Description
Live Guitar Tuner
Demonstrates the use of WaveWarp's live input functionality combined with the spectrum analysis components to build a
guitar tuner from scratch. Plug an electric guitar into the "input" of your soundcard and hit "Play". Now proceed to tune
your guitar as follows:
Starting, say, with the first string, pluck the open (i.e. unfretted) string repeatedly. You will see a number appearing in the
Simple Control Display. This corresponds to the dominant spectral component in the signal (in units of Hz).
You can also visually observe this spectral peak in the display of the Spectrum Analyser where it shows up as a distinct
"spike". Actually, you will see many more than just one spike. These correspond to the many "partials" present in the
signal emanating from a plucked string --- it is precisely this collection of partials and their relative importance which
distinguishes one guitar from another, and, moreover, distingushes one musical instrument from another when playing the
same note!). By observing the dominant spectral component --- which corresponds to the fundamental frequemcy of the
string --- you may now tune the string to any desired frequency. For example, the fundamental frequency of the first guitar
string is usually tuned to the note E4 with a frequency of 329.63 Hz. Adjust the tuning peg of the first string until the value of
329.63 appears in the Simple Control Display. In order to suppress the effects of the other partials, the lowpass
filter is set to have a cut-off frequency somewhere slightly above 330 Hz. Apart from suppressing all frequencies above
its cut-off setting, the filter has no adverse effect on the measured signal frequencies by virtue of the fact that the IIR
filtering operation is a linear process and therefore does not cause frequency distortion.
You can tune each string in succession using the aforementioned technique (taking care to adjust the low pass filter
settings for each string). Furthermore, you may tune the guitar to any desired scale. The conventional guitar tuning uses
the "tempered scale" as summarised below (also shown in parentheses are the suitable settings for the lowpass filter in
terms of its normalised pass and stop frequencies for a sample rate of 44100 Hz):
First string: E4, 329.63 Hz (lowpass filter settings: pass 0.016, stop 0.045)
Second string: B3, 246.94 Hz (lowpass filter settings: pass 0.012, stop 0.037)
Third string: G3, 196.00 Hz (lowpass filter settings: pass 0.01, stop 0.035)
Fourth string: D3, 146.83 Hz (lowpass filter settings: pass 0.008, stop 0.033)
Fifth string: A2, 110.00 Hz (lowpass filter settings: pass 0.006, stop 0.031)
Sixth string: E2, 82.407 Hz (lowpass filter settings: pass 0.005, stop 0.03)
Note that you may modify the tuning strategy in any desired manner (e.g. using fretted instead of open strings, or "playing
the harmonics" etc) as long as you know the appropriate frequencies corresponding to the chosen strategy.
Since the guitar fundamental modes are typically relatively low in frequency (e.g. maximum of approx. 330 Hz for E2 in
conventional tuning), considerable computational efficiency can be realised by downsampling the signal before performing
the spectral analysis. See the "LiveGuitarTunerWithDownsampling" Example Drawing Board to see how this can be
achieved taking advantage of WaveWarp's multirate functionality.
Components used:

|
|