|
| |
Musical Scales and Algorithms
From: Columbia University
| By:
David Birchfield |
EDITOR'S INTRODUCTION |
From Major and Minor to Whole Tone and Chromatic, scales are at the heart of both the simplest and most complex musical compositions. As Columbia University doctoral candidate and Mellon Fellow David Birchfield asserts, although scales may produce distinct melodic styles, they have strikingly similar structures. Throughout this essay, Birchfield uses flash animations of basic, recursive algorithms to generate a variety of scales, illustrating their potential to create intricate and beautiful pieces of music with unique personality and definition. |
usical scales wiggle their way into almost every musical experience, whether you are aware of it or not. When you sing "Happy Birthday" at a party, you utilize a Major scale; when you hum your favorite tunes from the radio, you use Major and Minor scales; when you hear commercial jingles on television, you hear Major, Minor, and Whole Tone scales; and when you listen to jazz and modern classical music, you hear Chromatic, Major, Minor, Octatonic, and Gapped scales. These different scales provide distinct foundations for these diverse musical styles; yet in their basic structure, these scales are not that different from one another. |
A musical scale represents the core pitch material of a given music. The scale shapes the sense of tonality of a piece of music, and provides a context in which the listener can place chords and pitches and other musical events. Scales represent a base reduction of the pitch materials of a given music and must therefore be unique, yet very simple. An examination of how simple recursive algorithms can be used to generate familiar scales reveals similarities between common scales and the simple elegance of these powerful structures. |
There are three components to a recursive algorithm: first, an input value; second, a set of computations which are repeatedly carried out; and third, a terminal condition which, when met, indicates the end of the repeated calculations. |
The piano keyboard is comprised of 88 keys. However, we recognize that there is a great deal of repetition wherein the C in the middle of the piano is abstractly equivalent to the C's to the far left and right of the keyboard. Thus, roughly seven and a half octaves divide the keyboard with twelve keys comprising each octave. Each key of the keyboard corresponds to a given pitch, yielding 88 unique pitches. A broader term, pitch-class, refers to any instance of a pitch regardless of the octave or register in which it occurs. For example, although the A at the bottom of the keyboard and the one in the middle are different pitches, both are instances of pitch-class A. |
The 12 pitch-classes are conventionally assigned alphabetical labels of C, C-sharp/D-flat, D, D-sharp/E-flat, E, F, F-sharp/G-flat, G, G-sharp/A-flat, A, A-sharp/B-flat, and B. To facilitate a computational approach, we will assign numeric labels. The 12 pitch-classes listed above are respectively identified as: |
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 |
This labeling system offers some advantages. This system clarifies the fact that the twelve pitch-classes are equidistant from one another. The smallest distance between two adjacent pitch-classes is a semitone and the numeric labeling system represents this distance as 1. A distance of two semitones, from F to G on the piano keyboard, is numerically indicated as 2. Additionally, just as the alphabetical labels wrap such that C is the pitch-class to follow B as one ascends the keyboard, here 0 will follow 11. If we allow 12 to follow 11, we arrive at the correct label by subtracting 12. Just as if we leap two semitones from 11, we arrive at the label of 1, by subtracting 12 from 13. Mathematically speaking, the pitch-classes are a modular system, specifically a modular-12 system. |
The three essential elements of the recursive algorithms that generate the Chromatic, Whole Tone, Octatonic, Gapped, and Major Scales, are detailed below. For each scale, you can click on a pitch-class to automatically generate the scale using a recursive algorithm. |
The Chromatic Scale
The Chromatic Scale is common to all musics that are based on a 12 pitch equal-tempered tuning system because it contains all 12 pitch-classes of the octave. Furthermore, all of the scales discussed in this article are subsets of this inclusive scale. Specifically, the 12-tone music of composers such as Arnold Schoenberg and Anton Webern utilizes the Chromatic Scale. |
To use a recursive algorithm to generate this scale, as described above, we must define three elements: (1) an input value, (2) a calculation which is repeated until, (3) a terminal condition is met. |
1. The input value is easiest. We just need one pitch-class on which to start, and any value 0-11 will work. |
2. In the chromatic scale, each pitch-class is just one semitone away from its neighbor. Thus only one calculation is required to determine the next highest pitch-class in the scale: |
This means that if the input pitch PITCH0 is 3, then the second pitch will be 3 + 1 = 4. Repeating the calculation to find the third pitch PITCH3 we get PITCH2 + 1 = 5. This process continues until the terminal condition is met. |
3. Finally a terminal condition must be specified. For this chromatic scale, we simply need to stop calculating once we arrive again at the input pitch-class. If the input pitch is 3, once we have used the above formula to calculate 11 pitch-classes, and arrive again at 3, further calculations would be redundant. |
We can use the above algorithm to generate the chromatic scale by hand.
PITCH0 = 3 (the input pitch-class)
PITCH1 = 4
PITCH2 = 5
PITCH3 = 6
PITCH4 = 7
PITCH5 = 8
PITCH6 = 9
PITCH7 = 10
PITCH8 = 11
PITCH9 = 0 (here we wrap the values as 12=0 in this modular-12 system)
PITCH10 = 1
PITCH11= 2 ( we stop here because the terminal condition has been met) |
To hear and see an automated version of how this algorithm can be used to generate a chromatic scale, click on either a numerical diamond or piano key below. That pitch-class will be taken as the input to the algorithm. |
Chromatic Scale
PITCHn = PITCHn-1 + 1 |
The Whole Tone Scale
Bela Bartok from Hungary and French composer Claude Debussy frequently use the Whole Tone Scale in their music. It is structurally similar to the Chromatic Scale in that each pitch is equidistant from its neighbors. However, in the Whole Tone Scale, each pitch is two semitones away from each adjacent pitch. The algorithm used to generate the Whole Tone Scale is quite similar to the algorithm which generates a Chromatic Scale. |
1. The input value is, again, any pitch-class 0-11. |
2. Only one repeated calculation is needed in order to generate the Whole Tone Scale. In this case the formula is: |
Here, if the input pitch-class is 6, PITCH1 = 6 + 2 = 8. Similarly, PITCH2 = PITCH1 + 2 = 10, and PITCH3 = PITCH2 + 2 = 0. Note that in the calculation of PITCH3, because the pitch-classes are modular 12, the value 12 wraps around to be 0. |
3. Like the Chromatic Scale, once enough pitch-class values have been calculated, the values will become redundant. Thus the terminal condition for this algorithm is, again, stopped when the input pitch-class is repeated. |
Click on either a pitch-class diamond or piano key below to execute the algorithm which generates a Whole Tone Scale. |
Whole Tone Scale
PITCHn = PITCHn-1 + 2
|
The Octatonic Scale
The Octatonic Scale, also called the Diminished Scale, is found in blues and jazz and in the music of Claude Debussy. The algorithm used to generate the scale is only slightly more complicated than those discussed above. |
1. As always, the input to the algorithm is any pitch-class. |
2. Two calculations are required to generate the Whole Tone Scale because here the pitch-classes are not equally spaced. The two calculations which are required are: |
PITCHn = PITCHn-1 + 1
PITCHn = PITCHn-1 + 2 |
If the input pitch-class is 9 (PITCH0), PITCH1 will be PITCH0 + 1 = 10. Given this algorithm, we now move to the second formula to find the third pitch such that PITCH2 = PITCH1 + 2 = 0 (again note that 0 is the modular-12 equivalent of 12). Now the set of calculations repeat so that PITCH3 = PITCH2 + 1 = 1 and PITCH4 = PITCH3 + 2 = 3. |
3. The repeated calculations continue to output new pitch-classes until the terminal condition is met. Just as in the Chromatic and Whole Tone scales, this algorithm will soon generate redundant pitches. Thus the terminal condition is met when the algorithm arrives again at the input pitch-class. |
Note that although each adjacent pitch is not equidistant from its neighbors, each pitch has a neighbor at a distance of three semitones away. This is the origin of calling the scale a Diminished Scale as the Diminished Seventh Chord is the skeleton structure. The two calculations subdivide the latent PITCHn = PITCHn-1 + 3 structure. |
Click a pitch-class diamond or piano key below to generate the Octatonic Scale. |
Octatonic Scale
PITCHn = PITCHn-1 + 1
PITCHn = PITCHn-1 + 2
|
The Gapped Scale
The Gapped Scale is so prevalent in the music of Hungarian composer Bela Bartok that it is often referred to as the Bartok Scale. The algorithms used to generate the Gapped Scale and the Octatonic Scale are very similar. |
1. Any pitch-class can be selected as the input. |
2. As in the Octatonic Scale, two calculations are repeated to generate the scale. These are: |
PITCHn = PITCHn-1 + 3
PITCHn = PITCHn-1 + 1 |
If the input pitch-class is 2, PITCH1 = PITCH0 + 3 = 5, and PITCH2 = PITCH1 + 1 = 6, and PITCH3 = PITCH2 + 3 = 9, etc. |
3. For this algorithm, the terminal condition is met when the input pitch-class is repeated. |
Click a pitch-class diamond or piano key below to indicate your preference for the input pitch-class and begin generation of the Gapped Scale. |
Grapped Scale
PITCHn = PITCHn-1 + 3
PITCHn = PITCHn-1 + 1
|
The Major Scale
The Major Scale is fundamental to many musics including European art music, jazz, folk, and rock. Although the pattern of the pitch-classes does not, at first glance, seem as regular as those of the scales described above, the algorithm used to generate this scale is quite similar. |
1. To generate the input to this algorithm TWO steps are involved. First, an input pitch-class is selected. For this example we will take 0 as the input. Secondly, we must calculate the input value for the algorithm which is the input pitch-class - 7. Here, that calculation yields a value of 5. (Since the modular-12 equivalent of 0 is 12, we subtract 7 from 12.) Thus PITCH0 is 5. |
2. One repeated calculation will generate the Major Scale. |
In understanding how this calculation can generate the Major Scale it is important to note again that pitch-classes are modular-12 such that a value of 13 is equal to 2, and pitch-class 40 is equivalent to 4. If we take, for example, an input value of 0, PITCH0 = 5 as described above, and PITCH1 = 5 + 7 = 0. Continuing, PITCH2 = 0 + 7 = 7, PITCH3 = 7 + 7 = 2 (the modular-12 equivalent of 14), and calculations continue as such. |
3. The terminal condition for this algorithm is slightly different from the other examples discussed. For the Major Scale, we stop the repeated calculations when the next pitch is one semitone away from the input pitch-class. Remember that this algorithm is slightly more complicated in that the input pitch-class differs from the input to the algorithm, and the terminal condition specifies that we are to reference the input pitch-class. Continuing with the calculations above, in which the input pitch-class was 0, we see that PITCH4 = 9 (3 semitones from 0), PITCH5 = 4 (4 semitones away), and finally PITCH6 = 11 (1 semitone away!). |
Note that if we order these pitch-classes as they were calculated, the result does not appear to be a major scale: 5, 0, 7, 2, 9, 4, 11. However, if we reorder the pitch-classes in ascending order, that is, 0, 2, 4, 5, 7, 9, 11, we clearly see the C-Major scale (C, D, E, F, G, A, B). |
Click a pitch-class diamond or piano key below to indicate your preference for the input pitch-class and begin generation of the Major Scale. |
Major Scale
PITCHn = PITCHn-1 + 7
|
Generate new scales
Having seen how recursive algorithms can be used to generate many common musical scales, you now have the opportunity to explore these principles and to use them to generate new scales. Using the menus items in the following Flash animation, configure your own algorithm and press the 'Generate' button to see and hear the results. The instructions below explain what each setting in the animation means. |
Generate New Scales
|
1. Set Modular Value: The input into the algorithm will be always be pitch-class 0. Though all of the scales discussed above are modular-12, here you can specify a different modular value from 1-24. Again, this modular value determines when the pitch-classes will begin to wrap. For the modular-12 examples discussed above, pitch-class 11=11, 12=0, 13=1, etc. When configuring your algorithm here, if you specify for example a modular value of 15, the output from the calculations will be such that 13=13, 14=14, 15=0, and 16=1, etc. |
Important as well is that this modular value has an impact on when the terminal condition is met. Again, for this example the input pitch-class will always be 0. If the modular value is set to 12, pitch-class 0 is reached again when the calculations reach 12. However, if the modular value is set to 17, the input pitch-class 0 will not be achieved until the calculations reach 17. |
2. Set Calculations: The algorithms discussed above use either one or two repeated calculations, but here you may specify up to three calculations. To set a given calculation simple scroll to the desired number. Any boxes that you leave as 'No Calculation' will not be used. Thus, if you specify '+3' for the first of the calculation menus, '+2' for the second calculation menu, and 'No Calculation' for the third calculation menu, the resulting calculations will be: |
PITCHn = PITCHn-1 + 3
PITCHn = PITCHn-1 + 2 |
3. Set Terminal Condition: You can also specify the terminal condition for the algorithm you create. |
'Stop when input value is reached' is the same terminal condition as was used in the algorithms which generated the Chromatic, Whole Tone, and Octatonic Scales. In this case the specified calculations will continue until the calculations yield a redundant result. |
'Stop when input pitch-class within smallest interval' is similar to the terminal condition of the algorithm which yielded the Major Scale. If this terminal condition is selected, the specified calculations will continue until the input pitch-class (which is always 0 in this case) is closer to the previous pitch-class than the smallest interval. For example, if the modular value is set to 15, and two calculations '+3' and '+2' are selected, when pitch-class '13' is reached, the terminal condition will be met. |
'Stop when input pitch-class within next interval' is similar to the previous terminal condition, except that with this condition, the ordering of the calculations is taken into consideration. For example, if the modular value is set to '15' and three calculations are set to '+3', '+2', and '+1', the terminal condition will be met when pitch-class '12' is reached because '0' (remember that because the modular value is set to '15' in this example, 15=0=INPUT PITCH) is within '+3' which would be the next calculation. |
Once you have configured the parameters as you like, press the 'Generate' button to hear and see the results of the algorithm. Press the 'Generate' button again to review the results, or reconfigure the parameters to explore different scale possibilities. |
Note as well that all of the recursive algorithms that generate the common scales discussed above can be generated by properly configuring the parameters. For example, setting the modular value to '12', with one calculation of ,'+2' and any of the terminal conditions will yield the Whole Tone Scale. |
Conclusion
Musical scales are powerful structures. They define the character of a piece of music and lay the foundation from which melodies and chords are derived. However, using recursive algorithms to generate common scales reveals that diverse scales are structurally similar. All the pitch-classes of the Chromatic Scale and Whole Tone Scale are all equidistant from their neighbors. Both the Octatonic Scale and Gapped Scale have a large step (2 or 3) followed by a semitone (1). The Major Scale, Chromatic Scale, and Whole Tone Scale are ostensibly quite different, yet each can be generated using only one calculation. |
In a piece of music the harmonic scope is embellished and enriched by pitch-classes which are not necessarily members of the fundamental scale. Nonetheless, the scale is strong enough that its identity is salient despite constant harmonic tugging. The scales which are most common to our musical experience, and perhaps the Major Scale is the prime example, have simple, elegant structures yet have the potential to yield complex and intricately detailed music. |
|
| |