As the previous posts note, the desired frequency ratios for the first 3 partials of a xylophone are 1:3:6. However, I needed to know how accurate these frequencies had to be to yield a nice-sounding instrument. I couldn’t find comments on the web about the tuning accuracy requirements, so I set out to spectrally measure some instruments to serve as a guidepost. Specifically, I needed to know how accurate I needed to tune the fundamental and higher partials.
Finding Sound Samples On the Web
The web was pretty skimpy when it came finding sound clips of xylophones.
Here was the first clip that I found – basically a guy playing a C-major scale. There was no info on the type of xylophone he was playing, but it looked pretty decent.
Here is another video that I found of a DeMarrow instrument. He hits some notes at the end of the video.
Finally, at this site I found a third clip of a guy from the Oregon Symphony playing an xylophone. Again, the I couldn’t find the xylophone brand, but decided it must be a good one if it is used in the symphony.
So here is where the magic starts – I wrote some software in Matlab that analyzes these clips to determine how accurately tuned the xylophone is. The tool, called AnalyzeClip, performs the following steps:
- Read the WAV file.
- Delineate each discrete note (i.e., each time a bar is struck) into its own clip.
- For each clip, perform a windowed spectral analysis.
- Find the peaks in the spectrum (aka, the modes). This identifies the frequencies associated with the fundamental frequency and the higher partials.
- Find the fundamental. This is the lowest mode and typically has the most power (although not always – sometimes I found that the second partial had more power.)
- Associate the fundamental with the closest ideal note, assuming an equal-tempered scale with a 442 Hz reference pitch (Wikipedia has a nice description of equal temperament.)
- Compute the frequency error of the fundamental relative to the ideal desired pitch.
The “ideal pitch” noted in the last step is computed for a an equal tempered scale with a 442 Hz reference. The notes in an equal tempered scale have a ratio that is given by 2^(1/12) power, which is about 1.0595. So if you want to determine the frequencies associated with a note, just multiple the previous notes frequency by 1.0595. If you do this multiplication for 12 successive notes, the two bookending notes will have a ration of 2, or an octave apart. For my 3.5 octave xylophone, the following table gives the desired frequency for each note.
Notice that bar 5 (A4) has a pitch of exactly 442.00 Hz. This is because I referenced all of the other notes to this pitch.
In my next post, I will show some results form the spectral analysis of the sound bites that I found on the web.