Frequency Accuracy in a musical instrument.

Thread Starter

Trapper John

Joined Oct 12, 2018
3
It’s not purely a Maths matter, but it has (hopefully) a numeric answer.

For reasons too complicated to mention here, I designed a musical instrument that used a small array of crystal oscillators to produce frequencies that was 1520 times the fundamental note pitches. As you may know, the ‘A’ note below middle ‘C’ fundamental pitch is exactly 220.000000Hz, but all other pitches of their exact value are irrational figures. (An Irrational Figure is a number that cannot be expressed as a fraction, e.g. pi) The factor that relates the pitches of any adjacent note is “2 to the power of one twelfth”, which works out as 1.0594631. Crystal frequencies usually have nice, round frequencies, Therefore, I have to divide them down to a frequency close to what I need. So how close should I be?

For a monophonic instrument, it doesn’t matter too much, but if you’re playing chords on a polyphonic, then it does. I did have a scheme that gave a maximum error of 142 ppm (parts per million), corresponding to 0.0142%, but one of the crystal oscillators came off the market, which rendered that figure as invalid. Someone in my place of work reckoned that up to 1500 ppm (0.15%) was perfectly OK. Dunno where he got that figure from, but it seems high.

Anyone in the know got any ideas?
 

WBahn

Joined Mar 31, 2012
32,891
I have no idea, but I would imagine that this is a topic that has been well and truly researched long ago. You might contact someone at Moog Music or someone else that makes music synthesizers. I imagine it wouldn't be too hard to find someone that would be happy to talk to you and that would be knowledgeable enough to determine and answer the questions you should be asking in the event they don't match the ones that you are asking.
 

MrChips

Joined Oct 2, 2009
34,837
An octave is 1200 cents. There are 100 cents in one semitone.
Aiming for 5 cents accuracy ought to be a reasonable goal.
For example 1000HZ to 1003Hz is 5 cents increase, i.e. 0.3% or 3000 ppm.

Crystal oscillators at 10ppm or better are easily achievable. What you have to consider is the lost of accuracy owing to quantization when you have to divide a fixed frequency by an integer. Starting out at a high crystal oscillator frequency will help to reduce the error.

You may want to look at the data sheet for MOSTEK MK50240 Top Octave Generator (which I assume is no longer being manufactured).

Reference: https://en.wikipedia.org/wiki/Cent_(music)
 

crutschow

Joined Mar 14, 2008
38,533
From Wikipedia:
"Although JND varies as a function of the frequency band being tested, it has been shown that JND for the best performers at around 1 kHz is well below 1 Hz, (i.e. less than a tenth of a percent (Ritsma, 1965; Nordmark, 1968; Rakowski, 1971)." (JND is just-noticeable difference) so I would expect an accuracy in that neighborhood would be sufficient.
 

ArakelTheDragon

Joined Nov 18, 2016
1,366
An octave is 1200 cents. There are 100 cents in one semitone.
Aiming for 5 cents accuracy ought to be a reasonable goal.
For example 1000HZ to 1003Hz is 5 cents increase, i.e. 0.3% or 3000 ppm.

Crystal oscillators at 10ppm or better are easily achievable. What you have to consider is the lost of accuracy owing to quantization when you have to divide a fixed frequency by an integer. Starting out at a high crystal oscillator frequency will help to reduce the error.

You may want to look at the data sheet for MOSTEK MK50240 Top Octave Generator (which I assume is no longer being manufactured).

Reference: https://en.wikipedia.org/wiki/Cent_(music)
Although Mr. Chips has decided to share these information, normally noone would tell you, these are things you will have to learn with practice(beg the master to teach you).
 

bogosort

Joined Sep 24, 2011
696
The simplest case is if your instrument is purely electronic and uses pure sinusoidal tones. Since your instrument is using equal-tempered tuning (each pitch is a twelfth-root of 2 above the previous), then you can just design for, say, a linear 0.01 Hz error at 220 Hz (so 0.1 Hz at 2.2 kHz, etc.) and be confident that its chords will sound in tune with any other standard instrument. However, if your instrument generates harmonic content -- and you'll want it to, otherwise it'll sound like a gaggle of sad flutes -- then intonation becomes much trickier. The overtones generated by each note will not have equal temperament and so chords will sound either rich or cacophonous, depending on the relative amplitudes of the various harmonics. This is a big reason why designing musical instruments is really difficult! The greater the harmonic content of any single note (think of a piano), the more likely that chords will sound mushy and ugly (think jazz chords played on a heavily distorted guitar). The challenge is finding a balance between tones that sound interesting on their own, yet can blend with other tones in chords.

Complicating matters is the human perception of pitch, which is a nonlinear function of frequency, context, timing, and loudness (which itself is a nonlinear function of frequency; see the Fletcher-Munson curve). It's a big subject and there's a lot of research out there. But for a personal project, you can simply rely on your ears. Do you have a good ear? If not, get with a musician friend and let them guide your tuning decisions. Playability is also a really important aspect of any instrument: how it responds to touch, how easy it is to finger chords, how expressive is it, etc.

Good luck, and let us know how it goes. Pics and audio samples would be great!
 

MrChips

Joined Oct 2, 2009
34,837
@bogosort brings up a very important point that I overlooked.

Fixed tuned instruments such as keyboards and fretted stringed instruments can never be perfectly tuned for all musical keys. They are a compromise at best.

For example, you can have a triad in the key of C with the notes C, E, G in perfect harmony. Go to another key such as E and the triad (E, G#, B) will not be in tune.

Fretless instruments do not have this limitation because the musician with a trained ear can make subtle adjustments.
 
Top