The importance of frequency stability in electronic musical instruments

The importance of frequency stability in
electronic musical instruments
Shantanu Prabhudesai - June 23, 2010
Since the invention of the semiconductor-based transistor, designers have been putting in great
efforts to create electronic musical instruments. Though such instruments may not be able to
completely substitute for the natural instrument, electronic instruments are popular due to their
portability, low maintenance, and ease of use - especially for new learners and the ability to produce
sound effects that are not possible using natural instruments.
The advancement of DSP technology furthers opens up new dimensions to add novel features to
electronic musical instruments.
The transistor-based astable multivibrator was the first effort to produce music based on generation
of square-waves or sawtooth-waves at different frequencies which were determined using resistorcapacitor networks. Even until a decade ago, some of the low-cost electronic musical instruments
used the IC555-based astable multivibrator to produce fixed notes.
These instruments were popular at the time of their creation, but the main shortcoming of such
instruments was poor tonal quality, and limited stability and accuracy of the frequencies produced,
so that when played in combination with other natural instruments in an orchestra they often
sounded out-of-tune or required constant fine-tuning.
As electronic technology has evolved, designers have used more advanced techniques to create highfidelity musical instruments. This article discusses the requirements, the constraints and the
challenges in creating high-quality musical instruments using electronic components (both analog
and digital) available today.
Frequency stability
Frequency stability
Taking the example of an 88-key piano as shown in Figure 1, the 49th key marked in orange called
A4 is required to produce a sound with fundamental frequency of 440 Hz.
Figure 1 - A standard 88-key piano
Similarly, the key marked in green is called the middle C and is a starting reference in many musical
compositions in Western classical music. This key is required to produce a fundamental frequency of
261.626 Hz. The fixed values of frequencies are valid for all musical instruments which would be
playing together in a concert.
Moreover, it is well known that the same notes (for example C) that are an octave apart are related
by a factor of 2. For example, the middle C (green) produces a tone of 261.626 Hz and the key C5
(blue), which is exactly one octave higher, produces a frequency of value 261.626 x 2 = 523.252 Hz.
They are separated by 12 notes (semitones) in between.
It is also well known that the tones are logarithmically spaced. Hence, to arrive at the fundamental
frequency of a key which is one semitone up, the factor of multiplication is the twelfth root of 2 - i.e.,
the notes are placed in a geometric progression with a ratio of 12√2.
When multiple instruments are to be tuned to exactly the same frequency for the purpose of playing
in synergy in an orchestra, the natural instruments such as string instruments are manually tuned or
rather fine-tuned at the time of the performance. Reed instruments are fixed in this regard and can
be tuned only through a sophisticated and skillful process. Hence once tuned, these instruments are
required to retain the frequency characteristics over long periods of time.
Electronic instruments, on the other hand, have a feature to tune the instrument using a knob which
varies the oscillator frequency or sometimes the sampling (output) frequency. This is achievable
using analog tuning components (variable resistors for example) or digital methods (frequency
shifting techniques).
Frequency Tuning in Electronic Music Instruments
Frequency Tuning in Electronic Music Instruments
Many early versions of electronic instruments were based on analog circuits such as the RC-based
astable multivibrator and IC555-based multivibrator as shown in Figure 2.
Figure 2 - Analog oscillator circuits (a) RC astable multivibrator (b) IC555 based astable
multivibrator
Toy pianos and the some early versions of the electronic tanpura (now widely popular with Indian
classical musicians) are examples. The frequency of the sound produced from such circuits could be
tuned by varying the resistor-capacitor network using potentiometers. However small random
variations in the frequency-determining components often produce a drift in frequency which is
audible to the trained ear.
Recent advances in DSP processor technology and storage interfaces have given rise to high-quality
musical instruments such as keyboards that store samples of pre-recorded sounds in memory, which
are then subjected to various DSP operations before being played out. The frequency of sound
generated by these systems is controlled by the crystal/crystal-oscillator used to clock the DSP
processor. Since most crystals have a higher accuracy than the resistor-capacitor networks, the
frequency drift from these instruments is inherently less.
For many electronic keyboards, a menu option is provided for fine-tuning the frequency outputs to
match those of other natural instruments being played along with the keyboard. One of the popular
processors that could be used in digital musical instruments is the "Dream Sound Synthesis" series
from Atmel®.
The constraint of frequency accuracy
The constraint of frequency accuracy
Once the frequencies of an electronic musical instrument are tuned, they are required to remain
constant during the performance. However changes in temperature, humidity, local heating effects
due to on-stage intense lighting, etc., cause the frequency-determining components (i.e., resistors,
capacitors, and crystal oscillators) to drift.
Some artists with a trained ear for music can perceive a frequency change of up to 1 in 1200 parts of
an octave (or 1 in 100 parts of a semitone), which is called 1 cent of frequency spacing (logarithmic
measure). Hence the drift in the frequency-determining components has to be less than the 1200th
root of 2 (since one octave is separated by a factor of 2). This works out to be about 0.057%
accuracy.
Any change in frequencies or tuning between different instruments that varies by more than 0.057%
is perceivable as a mis-tuned or "drifting" instrument. Hence in good quality musical instruments,
resistor-capacitor networks or crystals that drift by less than 0.057% with temperature and other
parameters are required to be chosen. Sometimes, temperature compensation could also be done by
separately measuring the ambient temperature and applying a correction factor in software. Figure
3 shows the diagram of a temperature-compensated frequency generating system.
Figure 3 - Block-diagram of a temperature-compensated
Correction techniques may involve the use of linear equations or look-up tables based on the thermal
characteristics of the frequency-determining components and the ability of the processor to perform
mathematical computations.
Conclusion
Based on the above discussion, it is obvious that frequency stability is a crucial factor in electronic
musical instruments, especially when being used in combination with other natural instruments in
an orchestra. These effects are also valid for audio players, where the pitch and the tempo of the
music played out may vary based on drift of processor frequency. However, the use of accurate
frequency-determining components can reduce the effects of frequency drift.
About the Author
Shantanu Prabhudesai is an electronics engineer with a passion for music. He holds a masters'
degree from the Indian Institute of Science, Bangalore, India specialising in the field of Electronics
Design and Technology. He has also trained in Indian music for several years and is keenly
interested in using his learnings of technology to contribute to the refinement in the quality of audio
in electronic musical instruments. The above article is an outcome of this quest. As a profesional,
Shantanu is engaged in the design of embedded systems with special focus on hardware and driver
development for these systems.
Credits
Mr. Devendra Deshpande and Mrs. Ashwini Deshpande, Pune, India for reviewing this article, and
sharing their knowledge and experience on the topic.
Related links:
DSP-based audio post processing enhances audio quality
My 6 biggest digital audio design blunders
Under the Hood: Robot Guitar embeds autotuning
Test your hearing (and other audio skills) online
Understanding superior professional audio design: A block-by-block approach
The art and technology of digital music performance