Strobe Tuning Instruments For Free WIth Audacity

In this post I will be showing how to tune musical instruments using audio processing. It was my great pleasure to work on this with my brother-in-law Nick Pope, who is a tremendously skilled instrument builder.

Whilst tuning string instruments like guitars is fairly simple using an electronic tuner, there are some significant limitations to this technique. The basic one being that a normal electronic tuner will only 'pick up' a sustained note. During the constructions of a musical instrument, there is a requirement to tune the individual components (sounding board etc). A normal electronic tuner will not achieve this because the tone produced by these components is not sustained.

The perfect example is the sounding board of a guitar or octave mandolin. These should be tuned to the base frequency of the instrument. Whilst tapping the sounding board produces a note that is very clearly of a particular pitch (well, as long as the instrument is a hand made model, if it is a mass produced instrument, all bets are off). However, and electronic tuner will not pick up which pitch it is.

Traditionally complex and dedicated piece of electronic wizardry called a 'strobe tuner' would be used. This machine is able to pick up the frequency components of a transitory or fleeting sound. However, such a dedicate machine is rather pricey and limited. With the technique shown here, a standard computer (Windows, Mac or Linux) a free piece of software (Audacity - see below) and a cheap microphone is all you require. What is more, you can glean much more information from this technique than from a strobe tuner, and tune other instruments. My interest is in if my embouchure is correct to get the proper pitch on the Saxs - this technique will show me this as well!

We were using the following piece of software: Audacity 1.2.6

http://audacity.sourceforge.net/

The first step (once you have plugged your microphone into your computer's microphone in socket) is to open Audacity and set it up correctly. There are two things to watch for (see diagram)

1) Make sure the sample rate for the project is 96000, this can be set by clicking the bottom left had corner of the main window (as shown).

2) Make sure the sound source is set to microphone (as shown).

To start recording, press the 'record' button on the main window.

Below is a recording of me saying 'blar'. If there is very little signal being received (you don't see much of the blue 'fizz') the you should use the microphone controls to increase the input level or move the instrument closer. If the signal is clipping (over running on the top and bottom) reduce the microphone level or move the instrument away.

Right, not to looking at the octave mandolin. For the rest of this post I will talk about stringed instruments, but the if you replace pluck and tap with blow then you have converted over to wind!

The picture below is of a recording of the tapping of the sounding board of an octave mandolin. The taps were done before the bridge and strings were attached to see what the natural resonance of the instrument was. The first three taps (of which the middle was really a bit too quiet) are in the bridge area. The second three on the treble area (above the bridge) and the last three on the base area (below the bridge).

To do the 'strobe tuner' analysis, you drag over the sounds you are interesting in using the mouse (as shown)

Then click on 'Analyse' then 'Plot Spectrum'.

Above is the popup screen that is produced. You must make sure that the settings in the four drop down boxes in the bottom left of the screen are as show. Also, if the screen does not work properly, make sure you have set the same rate to 96000 on the main screen as shown earlier (we had fun figuring this one out!).

This is just the most fabulous screen. As you move the mouse cursor over the plot area it skips the indicator line from one peak to the next. Not only does it show the frequency of each peak in the information bar, it shows the note as well!

In the above image I have selected the highest peak on the graph. This is the peak that represents the note at which the sounding board is sounding. It is 123 which is approx B2.

The second highest peak is the first harmonic of the sounding board frequency, it is shifted slightly by interference from other components of the sound, so it comes in at A#3, that being a semitone off.

Now, when one first looks at these graphs, it is easy to think that there is not much difference between the heights of the peaks. How can we be so sure that the principle pitch of the sounding board is 123Hz? Well, the graph shows the power of the different frequencies as relative decibels. This is correct has this is a log scale and is approximately how the ear hears volume. But the energy of the different frequencies is very different. Below is a graph showing the relative energies which I produced using the 'export' function from Audacity and MS Excel.

You can clearly see in the above graph that the 123Hz tone totally dominates the energy/frequency spectrum. The first harmonic being the next (but tiny) biggest signal. So, pick the highest peak - it is the principle every time!

OK - let us have a look at the sounds created by tapping the base section of the sound board. We can see from the spectrum below that the principle note is exactly the same. This is actually what Nick was aiming for as the instrument is supposed to by symmetrical!

The next two images show us checking out the treble section of the sound board, with similar results. Note how easy it is to check different parts of the instrument by simply tapping each place and noting the order in which it was tapped, then doing the analysis all in one chunk.

We were interested in the sound spectrum of the back of the octave mandolin. Apparently (according the Nick) the resonance of the back of the instrument should be at a different frequency to the front. To test this we recorded three taps on the back of the mandolin. These can be seen on the trace below:

The spectrum shows the familiar peek at 123Hz, but we have a higher one at C#4. This is indicating that the back is indeed resonating at a different frequency. At this point I would like to point out the peak at around 18,000Hz (18KHz). This is caused by the fact that the sound was recorded digitally, and has nothing what so ever to do with the instrument. If you are fortunate enough to have exceptionally excellent hearing you might be able to hear 18KHz, for the rest of us, and all music, it is irrelevant :-)

OK, now that we have had a good look at tuning the body of the instrument, lets check out if the strings on a hand made guitar are tuned correctly. This is an excellent chance to check our now system against the digital string tuner that Nick uses to set the strings.

He first plucked the open A string and produced the trace below:

In the resulting spectrum, we can see our now familiar 123Hz sound board resonance, but the peak at 441Hz - A is the highest. This peak is what we hear as the note. Whilst A is technically 440Hz, a 1Hz variance is so small the human hear cannot (without listening for beating with other notes etc) detect it. So we are happy that our technique and the tuner are in agreement.

Are, you say 'The 441Hz peak is so close in height to the others, how can you say it is the principle note?'. The answer is, remember the decibels! In this final graph below we can see in the power spectrum that 441Hz totally dominates every other frequency. All the other frequencies just add to the colour of the note. The others are critical, they make the difference between a fabulous sound and a dull sound, but they do not alter our perception of pitch.

We can use this technology to go further. We can record these sounds as .wav files. For example, if you come across and instrument that has a particularly fabulous sound, maybe you could make a recording of the taps for it and then match an new instrument to the same spectrum? Nothing will replace the ear of an instrument builder, but this technology cam massively aid it!