Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Musical Note accuracy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Musical Note accuracy

    How accurate should a musical note be?
    The A below middle C should be 220.0Hz, but +/- what? For a monophonic instrument, it probably doesn’t matter too much, but for a polyphonic instrument, it does, especially when playing a chord. Matters are seriously screwed up when you look at the other fundamental note frequencies, as they are ALL numerically irrational values.
    I am trying to put together a 35-note keyboard that emulates other instruments that put out a continuous sound (organ, Mellotron, brass, etc) rather than a transient sound (piano, unprocessed guitar, etc). I am creating the sounds by storing a single cycle of the wave in an EPROM and applying a BCD count to it, then taking the 16-bit data into an AD629 DAC. The number of samples for each cycle depend on the accuracy I can generate by dividing down the output of a crystal oscillator by a whole number. I’m using Skinny-DIP 22V10 PALs as dividers, simply as they take up a small area on the PCB. I managed to get a maximum accuracy of 142 PPM (parts per million), but 2 crystal oscillators that were on sale by RS and Farnell have been taken off the market, which has seriously inconvenienced me. I don’t intend making many of these instruments, and any I do make will probably be given away, so I’m also trying to minimise costs.
    Has anyone got any idea what the accuracy should be?

  • #2
    Yep. It's been known for a long time.

    In the western musical scale in equal temperament, each note is the twelfth root of two times the lower note. The twelfth root of two is an irrational number approximately equal to 1.059463094. For tuning accuracy, each semitone is divided into 100 steps of the 1200th root of two, or about 1.00057779..., each of which is referred to as a "cent".

    Music researchers think that skilled, interested listeners can distinguish tuning down to 5-6 cents. Nearl all normal adults will notice errors in tuning of 25 cents. If I were you, I'd try to hit within 5 cents.

    That's 1.00057779 to the fifth power, or 1.002892288, which is 2892 ppm if I did the numbers right. That's actually pretty easy to hit. Try for better. Note that your *worst* note has to be within 2892 ppm for it to sound good proper with other equal tempered instruments.

    142ppm is less than a cent, so that one is OK.

    As a bit of design advice, never rely on specific frequency crystals that are not made in large quantity for something else. They have a way of disappearing.

    I have designed a note generator for implementation in PICs that generates all the octaves of a single even tempered note; the note is selectable and whole number dividers get within 5 cents on all notes, but it took a 19.6608MHz crystal to do it. Fortunately, there are a lot of those. 4.032MHz was close, just a bit worse, when used for generating any of the 12 tones.

    Notice that for extra credit, you would make your instrument play in Just Intonation too. There are musicians that would like that. They'd like it even better if you could make that switch selectable.
    Amazing!! Who would ever have guessed that someone who villified the evil rich people would begin happily accepting their millions in speaking fees!

    Oh, wait! That sounds familiar, somehow.

    Comment


    • #3
      There are probably more than a few members here that have experience with muic theory or computer-generated music, or both. I'm surprised not more have chimed in!

      The ear is pretty good at determining pitch differences in sequential note sequences (monophonic melodies) but even better at determining pitch variance in simultaneously-sounding groups (polyphony or chords). One of the methods our brain uses is to listen to the 'beat frequencies' that occur any time two notes sound together. If a 220Hz note in one instrument is off by ~8 cents and is played against a perfectly in tune A 220Hz, then a beat frequency ("wobble", or chorus effect) will be heard at a rate of about 1 per second. This is readily apparent by the listener, but is less than 1/2% variance in pitch. RG's 5 cent goal would cut this pitch error in almost half, but it would still be noticeable.

      The problem comes in when we go higher in pitch. At 880Hz, only 2 octaves higher, the 1 cycle per second beat frequency will be produced by an error of only 2 cents, and anything over 8 or 10 cents will be perceived as a kind of vibrato effect. One way around this is to add effects to the generated note like chorus or some other phase-shifting trick, to make the beat frequencies a moving target for our ear. This is exactly why singers and orchestral players develop their vibrato for group performance.

      Having said all that: pure, even-tempered tunings are a rarity, and almost all keyboard instruments are 'close but not quite' simply because they are tuned primarily by ear. Some non-perfectly equal intervals can be quite pleasing, and as RG mentions, there are performers (usually with a Baroque bent) that would appreciate the opportunity to try out these other temperments.
      If it still won't get loud enough, it's probably broken. - Steve Conner
      If the thing works, stop fixing it. - Enzo
      We need more chaos in music, in art... I'm here to make it. - Justin Thomas
      MANY things in human experience can be easily differentiated, yet *impossible* to express as a measurement. - Juan Fahey

      Comment


      • #4
        Many thanks for you response, R.G. I recall reading something about "cents" and the like in an academic article published by Boulder University, Colorado, about 8 or 9 years ago. I completely agree with your maths as well - 5 cents correspond to 2 to the power of 1/240, giving 2892 ppm, or 0.2892%. Even so, this seems an inordinately high figure. I can't trace the Boulder document - it may have been removed from the web, BUT if my memory serves me right, they did suggest an accuracy of no greater than 1500 ppm (0.15%), which I THINK is about 2.2 cents. IF this is the case, then I should be OK.
        The "142 ppm" accuracy I mentioned came from a set-up where each sound wave cycle was broken up into 380 samples, and the highest sound frequency possible was > 18KHz. However, RS (RadioSpares) and Farnell, both British component suppliers) have withdrawn their 125MHz crystal oscilators, which has seriously knackered me! Therefore, I'll have to do another re-design, but the lower accuracy expectation should help enormously.
        There are a few things that you have mentioned that are new to me (I don't do this sort of stuff all that often), such as "PIC" and "Just Intonation", but I can look them up on the 'net. One thing that did crop up when I discussed this with work colleagues was a technique that multiplied frequencies by any integer number that did NOT use a VCO. He told me the name of the technique, but I've forgotton it - "(something) Parameter"? - I can't remember.
        Anyway, thanks for you help.

        Comment


        • #5
          I'd have to do do a bunch of math before I could know this would work, but it's possible that the numerically controlled oscillator technique could do what you want. I'd have to look at the (in) accuracies in the technique at higher frequencies. It's remarkably accurate to fine subdivisions at low frequencies.

          One caveat: instruments do not have a fixed waveform that is simply repeated at higher frequencies. The same waveform from the bass end of the instrument's range is not necessarily what comes out of it at the treble end. For mechanical instruments, the oscillating mechanism and body form a certain frequency response that's impressed on top of the base waveform. This voicing technique is referred to as "formants", the word "formant" denoting one of the possibly many acoustic resonances of the instrument body and coupling to the air.

          This was one of the problems with the earliest sampled instruments - the samples only sounded good over a certain range of notes, and you needed many samples of the same instrument and had to pick the right one for the note being played.

          For what you're doing, I suggest you read Seashore's "The Psychology of Music" and Dorff's "Electronic Musical Instruments", both of which are quite old, but they give a good bit of the background you're going to need. They are long out of print, but should be available cheaply in the used-book sites.
          Amazing!! Who would ever have guessed that someone who villified the evil rich people would begin happily accepting their millions in speaking fees!

          Oh, wait! That sounds familiar, somehow.

          Comment


          • #6
            Originally posted by R.G. View Post
            Dorff's "Electronic Musical Instruments"
            I think I had a copy of that book. Dorf developed a divide by two circuit that used a pair of neon bulbs instead of a dual triode. It was used by Schober in their recital organs. The top octave had an oscillator for each note and the dividers produced the lower octaves. The dividers were tweeked to produce a nice sawtooth wave that had an even distribution of even and odd harmonics. After the notes were summed together, a format filter would give the waves the selected voice.

            Another unique thing in his book was a sort of strobe-o-scope that used a single speed motor and a single wheel with dots that would sync up when you tuned each note in the top octave. That would imply some kind of integer math, but I seem to remember that you had to detune some notes by allowing the dots to rotate slightly in one direction or another.

            The Hammond tone wheel mechanism would also suggest some kind of integer math was used. It's well known that there are slight errors in the pitchs of Hammonds that make strong discords impossible.
            WARNING! Musical Instrument amplifiers contain lethal voltages and can retain them even when unplugged. Refer service to qualified personnel.
            REMEMBER: Everybody knows that smokin' ain't allowed in school !

            Comment


            • #7
              Test your own pitch perception:
              Adaptive Pitch: Measure your pitch perception abilities

              Comment


              • #8
                Be aware that the concept of "Temperment" implies a fundamental de-tuning. As in the equally tempered scale.
                "Perfect" intervals are ratio's of frequency. That is.. octave = 2:1 ratio; a perfect 5th = 3:2; a perfect 4th = 3:4 a major third = 4:5; a minor third = 5:6. This is the source of the "Integer Math". These ratio's don't produce the exact same frequencies found by R.G.'s formula. But if you tune a scale to these exact frequency ratio's you will find that notes above the 5th will be out of tune (or that the exact ratio is not reproduced when using an alternate fundamental) when played against each other in different keys. The equally tempered scale itself is off by a few cents on each note.

                Comment


                • #9
                  Yep.

                  Tempering is what lets you have instruments that play in tune with one another in a mostly-OK way over a wide range.

                  Constructing a scale from fifths or any of the small-whole-number ratios produces a scale that's wonderfully in tune with itself, all the notes on the frequencies that the ear likes to hear as relationships, but which is not very adaptable. The even tempered scale intentionally diddles the notes of the twelve-tone scale a bit so that C# and Db are the same note (as a f'rinstance). Without tempering, each instrument can play in one key only, or must have several ways to produce the note that's represented by one note in the even-tempered scale. This quickly gets out of hand. Musicians with instruments that played perfectly in a just scale would have to switch instruments (in the day before everything being sampled and stored) to play in a different key.

                  Here's a quickie look at various scale building techniques, especially even tempered and just.

                  Here's an aside for guitarists (which is theoretically why we're all here) - guitars can't play very well in even tempered and can't do just at all, at least not as they're set up today. Not only are the fret positions somewhat imprecise due to the rounded tops of the frets, the gauge of strings and height of actions have the string pull sharper when they're pressed down behind the frets. That's without even thinking about bending.

                  Bridge intonation helps make up for the impreciseness of the string flexibility. What is that intonation system... Buzz Feiten?? is an attempt to make another correction by moving the nut closer to the first fret, something about correcting more for a string bend at the low frets than down in the middle at the 12th fret, something like that. But all of this adds up to a guitar note being an approximation, and worse yet six sets of approximation, the gauge, tension, flexibility, action height, fret placement, fret height, bridge and nut intonation all getting into it.

                  Good thing it's only rock'n'roll, eh?
                  Amazing!! Who would ever have guessed that someone who villified the evil rich people would begin happily accepting their millions in speaking fees!

                  Oh, wait! That sounds familiar, somehow.

                  Comment

                  Working...
                  X