Summary: In this mini-project you will learn about musical intervals, and discover the reason behind the choice of frequencies for the tuning system called "equal temperament."
![]() |
This module refers to LabVIEW, a software development environment that features a graphical programming language. Please see the LabVIEW QuickStart Guide module for tutorials and documentation that will help you: |
| • Apply LabVIEW to Audio Signal Processing | |
| • Get started with LabVIEW | |
| • Obtain a fully-functional evaluation edition of LabVIEW |
In this mini-project you will learn about musical intervals, and also discover the reason behind the choice of frequencies for the equal-tempered musical scale.
Spend some time familiarizing yourself with the piano keyboard below. Enter the pitch (letter) and its octave number to display the corresponding frequency. For example, middle C is C4, and C2 is two octaves below middle C. The frequency 440 Hz is an international standard frequency called concert A, and is denoted A4. Concert A is exactly 440 cycles per second, by definition.
The black keys are called sharps and are signified by the hash symbol #. For example, G#1 indicates the sharp of G1, and is located to the right of G1.
Download LabVIEW Source
Try the following exercises to make sure that you can properly interpret the keyboard:
What is the frequency of the leftmost black key?
29.14 Hz
What is the name and frequency of the white key to the immediate left of C7?
B6, 1976 Hz
What is the name of the key that has a frequency of 370.0 Hz?
F#4
One aspect of the design of any scale is to allow a melody to be transposed to different keys (e.g., made higher or lower in pitch) while still sounding "the same." For example, you can sing the song "Twinkle, Twinkle Little Star" using many different starting pitches (or frequencies), but everyone can recognize that the melody is the same.
Download and run tone_player.vi, a that VI accepts a vector of frequencies (in Hz) and plays them as a sequence of notes, each with a duration that you can adjust. Listen to the five-note sequence given by the frequencies 400, 450, 500, 533, and 600 Hz (it should sound like the first five notes of "Do-Re-Mi").
Now, transpose this melody to a lower initial pitch by subtracting a constant 200 Hz from each pitch; write the frequencies on your mini-project worksheet:
Modify tone_player.vi by inserting an additional front-panel control so that you can add a constant offset to the array of frequencies. Be sure that you keep the "Actual Frequencies" indicator so that you always know to which frequencies you are listening.
Set the offset to -200Hz, and listen to the transposed melody. How does the transposed version compare to the original? Does it sound like the same melody? Enter your response on the worksheet:
Transpose the original melody to a higher initial pitch by adding 200 Hz to each pitch; write the frequencies on your worksheet:
Set the offset to 200Hz, and listen to the transposed melody. How does the transposed version compare to the original? How does it compare to the version that was transposed to a lower frequency? Enter your response on the worksheet:
Draw a conclusion: Is a constant frequency offset a good way to transpose a melody?
In music theory, an interval is a standard distance between two pitches. For example, if you play middle C, and then the G above that, you have played a perfect fifth. If you start with an F#, then a perfect fifth above that is a C#. The first note you play is called the fundamental.
Refer back to the piano keyboard diagram at the top of this page. Each step to an adjacent key is called a half step (also known as a semitone).
If you play middle C (C4 on the diagram), how many half steps up do you need to go in order to play a perfect fifth interval? Enter answer on your worksheet:
If you begin on A4, which note is a perfect fifth above? Enter answer on your worksheet:
More intervals are listed below; the musical mnemonic may be helpful to hear the interval in your mind:
Listen to each of these intervals by entering the frequencies from the keyboard diagram. Remember to set your offset to zero. Also, you can silence a note by entering zero frequency. For example, if you want to hear a perfect 6th interval beginning at B3, you should use the frequencies 246.9 Hz and 415.3 Hz (G#4).
Use C4 as the fundamental. Enter its frequency on your worksheet:
What is the frequency of a major 3rd above the fundamental? Enter its frequency on your worksheet:
What is the frequency ratio of the interval? Express your result in the form "a : 1", where "a" corresponds to the higher of the two frequencies. Enter the ratio on your worksheet:
Repeat the previous three questions using C5 as the fundamental (remember, C5 is one octave above C4). Enter the three values on your worksheet:
Try this again using A#2 as the fundamental; enter the three values on your worksheet:
Try this again using several different fundamental pitches for another type of interval.
Now, draw a conclusion: Based on what you have experienced about musical intervals so far, can you develop at least part of an explanation for why the frequencies have been selected as they have? Enter your comments on the worksheet:
A variety of scales or tuning systems have been devised for musical instruments, some dating back several millennia. Scales include Pythagorean tuning, just-tempered, mean-tempered, well-tempered, (have you heard of Bach's "Well-Tempered Clavichord"?), and equal-tempered. For example, a just-tempered scale uses the following ratios of whole numbers for the intervals:
Complete the table above to show each interval as a ratio of the form "a : 1"; enter these ratios on your worksheet:
Modify your VI so that you can enter a single fundamental frequency (in Hz) and an array of interval ratios to play. Be sure to keep the "Actual Frequencies" indicator so that you always know to what frequencies you are listening!
Listen to the scale formed by the following sequence of ratios, and use A4 (440 Hz) as the fundamental: 1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8, 2. Comment on how well this scale sounds to you (enter your comments on your worksheet):
Transpose the same scale to G4 as the fundamental, and then F4 as the fundamental. Comment on well this scale transposes to different keys (the differences may be rather subtle); enter your comments on the worksheet:
The frequencies on the keyboard diagram above show the piano tuned using the equal-tempered scale. An equal-tempered scale sacrifices the pure whole number ratios scheme for intervals, but offers the advantage that a melody transposed to any other key will sound the same. Thus, an equal-tempered scale is a "global compromise" -- a given melody will be the same level of out of tune no matter which key is used for the fundamental. The other scales mentioned above will cause a given melody to sound quite nice in some keys, and quite out of tune in other keys.
Derive a mathematical function to calculate the frequencies used by the equal-tempered scale, i.e., given a fundamental frequency and a semitone offset, calculate the frequency. For example, when your formula is presented with the frequency 440 Hz and an offset of 2 (i.e., two semitones above concert A), it should return 493.9 Hz. Be sure to show your complete derivation process on your worksheet, and not simply the end result.
"This online course covers signal processing concepts using music and audio to keep the subject relevant and interesting. Written by Prof. Ed Doering from the Rose-Hulman Institute of Technology, […]"