Music and Maths Investigation. Sine waves and harmony on the piano.
by
jojopovilasgmailcom (student)
Page
EXPLORATION OF THE RELATIONSHIP BETWEEN MATHEMATICS AND MUSIC
________________
INTRODUCTION
I have chosen to investigate the mathematical properties of music; to be more precise, the piano. Since an early age I had a great interest and appreciation for music, in addition, I had decided to play the piano and now I have been playing it for 11 years. I enjoy listening to various types of composers and musical artists varying from classical pieces to modern pieces. However, during my last year in my piano classes, I’ve got a spark of interest in figuring out how composers manage to compose pieces that are appealing to me and the public, especially, when some composers had health problems, which made the journey of creation quite hard for them, in this case, Beethoven created wonderful musical pieces while being deaf. After some personal research, I’ve found out that mathematics has a huge role in determining how it appeals to the public, as mathematics is related to the production of harmony. Thus, the aim of my exploration is to explore and understand how mathematics are related to harmony of music.
All of the aspects of mathematics in relation to harmony will be focused on my main instrument – the classical piano. Although music is made out of all of the aspects such as melody, harmony and rhythm, however, harmony is very intricate and requires an exploration of its own.
This exploration will be split into three parts: the first one will comprise of the graphical representation of the notes and chords and which combinations of notes produce harmonic sound; the second part will explore how the Greek philosopher Pythagoras had contributed to music with ratios that later developed the harmonic series; the third part will delve into the probability of achieving harmony.
PART 1: THE GRAPHING OF NOTES AND CHORDS USING SINE WAVES
The piano is built on the foundation of an octave, which is comprised of 12 semitones ending on a note twice the frequency of the first note’s tone. A semitone is the smallest interval in western classical music. Each tone inclusive produces a unique sound. As a result, each semitone has a representational letter in an octave. The octave the note is located in is represented by a subscript number, for example, C4. On the piano, the scale range of the white notes are C, D, E, F, G, A, and B going from the left to the right. The black notes are named according to what key the music is in and what white note they are related to. They are given the symbols of ♯, which means sharp and ♭, which means flat. Here is an image with the keyboard and its representational letters:
Image Source: http://www.piano-keyboard-guide.com/piano-keyboard-layout.html
Each semitone, or note, will produce a sound that has its own frequency. This frequency is a measure of pitch and is recorded in Hertz (Hz) or cycles per second. Each frequency can be graphed in a two-dimensional plane as a sinusoidal wave. We will observe a pattern in harmonic notes and chords through the ratio of periods of each graph. To visualize these frequency patterns, we will graph a single note, in this case, we will use A4, the most commonly used note for a general tuning standard for musical pitch, which has a frequency of 440 Hz. The equation for A4 is:
The graphing of a sine function allows us to visualize the oscillation of the string. 2 gives us the period interval which represents one second, 440 represents Hz and is our variable for time. To observe the important aspects of the graph and to find the correct period ratios, we must scale down each equation by the same factor.
We have divided the Hz value (let R = Hz) in the sine function by 440 in order to create the function for note A scale to . I have chosen A4 as my main function as it will be used to build the harmonic chords of the A4 note. We will use the same transformation for each note’s equation in order to graph and observe the proper ratios.
Thus here is the graph of the equation of note A4:
https://i.gyazo.com/7d24a08832e0e4545b7043f1efbdf4c5.png
Before measure and explore our first harmonic chord, we must write down a few basic clues about the wavelengths. The wavelength or period of the function is directly related to pitch: the shorter the wavelength is, the higher the pitch is and vice versa.
Here is a graphical representation of A major. The notes are A4, C♯, E and A5
https://i.gyazo.com/d462a57e0921f6bc1fe71d21c2c3b852.png
Here are the equations used to create the graph of A major. They were determined by using the pitch (Hz) values in the general equation of .
A4: C♯: ...
This is a preview of the whole essay
https://i.gyazo.com/7d24a08832e0e4545b7043f1efbdf4c5.png
Before measure and explore our first harmonic chord, we must write down a few basic clues about the wavelengths. The wavelength or period of the function is directly related to pitch: the shorter the wavelength is, the higher the pitch is and vice versa.
Here is a graphical representation of A major. The notes are A4, C♯, E and A5
https://i.gyazo.com/d462a57e0921f6bc1fe71d21c2c3b852.png
Here are the equations used to create the graph of A major. They were determined by using the pitch (Hz) values in the general equation of .
A4: C♯:
E: A5:
We can see in the graph that all of the functions intersect at the origin and are close to intersecting with each other at t=1, 2, 3 and 4. To have a better view of the relationship between the notes, we can look at the relative ratios of periods compared to the first note of A4, as is shown in the following table.
Note
Semitones from the A note
Frequency
Period
Ratio to note A (1.00/period)
Ratios to A as fractions
A4
0
440
1.00
1.00
1/1
C♯
4
554.37
0.794
1.26
63/50
E
7
659.25
0.667
1.50
3/2
A5
12
880
0.500
2
2/1
In this harmonic chord we can see that each note that has harmony with A has relatively simple whole number fraction ratio, except for C♯, which has a ratio to A4 very close to 1.25 that gives another simple fraction ratio of 5/4. We can make this exception as the graph of C♯ is very close to the intersection at intervals 2 and 4. These distinctions are important to observe in mathematical representations of music as values are not exact, in which case, it makes the proximity very relative. Now we’ll take another harmonic chord and check if similar patterns emerge. This time we will examine the A minor chord, which notes are A4, C, E and A5.
https://i.gyazo.com/2bc0e0b9150ccee7467ddcbfd79d8fb5.png
A4: C:
E: A5:
Note
Semitones from the A note
Frequency
Period
Ratio to note A (1.00/period)
Ratios to A as fractions
A4
0
440
1.00
1.00
1/1
C
3
523.25
0.840
1.19
119/100
E
7
659.25
0.667
1.50
3/2
A5
12
880
0.500
2
2/1
In the A minor chord we can see very similar results as in the A major chord. Harmonic notes tend to have simpler period ratios. The note of C, which is similar to C♯, has a period ratio very close to 1.20 or a fraction ratio of 6/5.
To test the truth of the assumption that the harmonic chords have simple whole number ratios when comparing period values, we will test the opposite, the dissonant chord, which will be made out of notes A4, B, D♯ and F. (Take note, this chord isn’t used frequently, hence it doesn’t have a name.)
https://i.gyazo.com/eb96e70a4a44ad73dd41246ce69662ea.png
A4: B:
D♯: F:
Note
Semitones from the A note
Frequency
Period
Ratio to note A (1.00/period)
Ratios to A as fractions
A4
0
440
1.00
1.00
1/1
B
2
493.88
0.890
1.12
28/25
D♯
6
622.25
0.707
1.41
141/100
F
8
698.46
0.630
1.59
159/100
In the dissonant chord, we don’t get the simple whole number fraction ratios like we do in the harmonic chords. We can’t justify rounding simplification of the fractions either because there is no common intersection of the waves in the graph. We can conclude that the period ratios of different frequencies are a telling sign of them being harmonic; simple is more harmonic, complex is more dissonant. For us human beings, this should make sense as we prefer simplicity and neatness over the complexity. Pythagoras had predicted this when he investigated the mathematics behind music and this had led to the creation of the western classical style.
To explain the case of the difference of C and C♯, we can assume that the note is less harmonic to A than other notes with simpler fraction ratios; although, it is very close to reaching harmony given its proximity to a simple fraction ratio and common intersect point on the graph. This may create a mark of uniqueness for the chord or the not that makes a chord stand out to its listener. While a perfectly harmonious chord may sound good to the ear, it doesn’t stand out the way as a slightly off chord may sound. This is unusual, dissimilar and it creates a feeling of uniqueness.
To conclude the first part of the exploration, harmonic notes in chords will generally have a simple period ratio to the fundamental note. Notes close to a simple period ratio can give the chord a harmonic character; however, if the chords are too complex and have periods far from the first note, they will have a dissonant sound.
PART 2: PYTHAGORAS AND THE HARMONIC SERIES
The exploration of the first part can be backed up by the statements by a famous Greek philosopher, Pythagoras (570 BC – 495 BC). Pythagoras, known widely for his theorem involving lengths of a right triangle, had a strong relationship with music. The philosopher was fascinated with the lyre, which at the time was a common string instrument in ancient Greece. First, he had observed that when two strings of the same length, tension and thickness were plucked, they produced a consonant sound. Secondly, Pythagoras found that strings of different lengths produced different pitches and generally dissonant sounds. Lastly, he realized that certain dissimilar string lengths produced a consonant sound in pair. The relationship between these notes he called an interval. The intervals can be seen as the harmonic note combinations from the previous part. The interval names are derived from the number of semitones they sit from the first note. From this he determined the octave, the perfect fifth, the fourth and so on. Each of these consonant pairs were so as the length of the strings was in a simple ratio like the octave (2 to 1), the fifth (3 to 2), the fourth (4 to 3) and etc. These ratios are reversible and apply to any type of string, hence they are relative ratios. Also, string length is related inversely to frequency that allows for the conclusion that frequency should have the same ratio of relationship to harmony. Although Pythagoras knew that he could keep using larger integers and continue the pattern, in addition, he wanted to keep his mathematics simple. The Greek philosopher believed the simpler is more correct. In these days, we have the harmonic series, modeled by Pythagoras’ observations, by which the formula of the series looks like this:
Firstly, we must make some observations. In this series we have n going up to infinity, which means that there isn’t any point to “complete” the series. The whole series begins with the fraction and increases by one in the denominator for subsequent fractions. What we don’t know yet is if this series is divergent or convergent. However, we can investigate this by writing out the first few terms.
We can see that every term is smaller than the previous one. However, is it small enough to converge? We can check this by building a new series. On that has each term less than or equal to the value of the corresponding term in the harmonic series. If each term is smaller than the sum, then the sum will be smaller as well. If our second series diverges, we can conclude, by the comparison test, that the harmonic series diverges as well. To build our new series, we will make each term the largest power of 12 less than or equal to the corresponding term in the harmonic series. The reason for picking one half is purely ease and simplicity, any other number less than one and greater than zero could have been used however, it is easiest to visualize a pattern 12. This proof variation was created by French mathematician, Nicole Oresme.
We can begin with the first term of the harmonic series, 1. The largest power of less than or equal to 1 is 0. Hence, the first term of our new series is 1. The second term of the harmonic series is . Again, the largest power of less than or equal to is 1. Hence, the second term of our new series is . The next term of the harmonic series is . The largest power of less than or equal to is 2. So, the next term of the new series is . We continue doing this to each term till we begin to see our series take form. Here is what the new series looks like:
As we constructed the series, each of the terms in our series is a positive value and less than or equal to its corresponding term in the harmonic series. Now we can check if the series diverges by simplifying the series.
If we continue to add terms of this new series, we will see that the sum of each part of the series adds to . 2 terms of add to , 4 terms of add to , 8 terms of add to , and so on. If a series adds the same value to itself an infinite amount of times than that series will diverge as such is the case for our new series. Therefore, since our new series is divergent and is less than the harmonic series, we can assume, from the comparison test, that the harmonic series diverges as well.
The harmonic series is used all over in music. It is constantly being studied in theory and used to improve systems of composition, performance and tuning. But what specifically does this divergence mean to music and harmony? In fact, its divergence shows us a lot about the world of music. We understand from it that simplistic relativity is a never ending pattern that can always find harmony. The idea that this series carries on without end may not seem of utmost importance in the real world but, it allows us to understand why all our finite patterns work. For example, it helps us understand why certain notes have special relationships with others well beyond what the human ear can recognize. It also allows us to understand why a piano can never truly be “perfectly” tuned. There are many other practical applications of the harmonic series and its properties of divergence in music and well outside of it and those deserve another entire paper of explanation. We know that this special series extends to well beyond what humans are even capable of thinking about and even its practical justifications do not define its reason. If we can take away anything, it is most interesting, philosophically, to know that at every extreme, one can still find harmony.
PART 3: THE PROBABILITY OF HARMONY
For the last part of the exploration we will go back to the piano. If you had no clue of piano or music and you decide to randomly play 3 notes in one octave, what is the probability that you might play a harmonic chord? At first, we must recognize that each three note combination, from A to G♯, can be played in a major or minor chord. These chords have the same top and bottom notes, but they only differ by 1 semitone in the middle. In addition, since the probability of playing any chord is theoretically equal, we want to measure the probability of playing a major or minor chord comparative and multiply that probability into the number of chords that are consonant. Lastly, we must understand that a single note can only be played once. Here is a table that represents how to find notes in a chord:
https://i.gyazo.com/37ad19a12ba4c854939b8066932126a1.png
Source of Image: http://www.jonweinberg.com/music/Alt_Chord_Finder_Chart.pdf
We start with the probability of playing the correct base note for any one specific chord. Since there are 12 semitones and only one is valid, our probability is . Next, the probability that we play the correct middle note for the chord. This time there are 2 valid notes since there are minor and major variations of each chord. Also since we have already played the base note, we now can only choose from 11 notes. Our middle note probability therefore becomes . The last probability we need is the top or final note. Since we have used 3 notes, only 9 remain which gives us nine in the denominator. Since there is only 1 valid top note we are given the final probability of . Since these events are dependent, we can do simple multiplication to find the probability of one specific minor or major respective chord:
Since this is the probability of attaining only 1 major or minor chord, we need to multiply this probability by the number of possible minor and major chords.
This probability shows that there is a small chance of randomly playing a correct harmonic 3 note chord. In theory, it should take about 50 tries to play a correct consonant combination as . This makes sense as new piano players have a hard time to improvise, however, when they manage to use the math system behind music such as octaves, perfect fifths and etc., their harmonic skills begin to improve gradually. This shows that appealing music is dependent on mathematics behind it.
CONCLUSION
We have briefly explored sine waves and how they model the frequencies produced by different tones on a normal 88 key piano. We observed that simpler ratios of periods between notes produced a more consonant sound. In addition, we observed in our graphical exploration that Pythagoras’ claims of simple being better resonate in the world of music. Not only do simple ratios allow us to enjoy music, they also appear in beauty, nature and the mathematics of everyday life. However, an important thing to consider about the model used in this investigation is that ideal sine waves were used. String imperfections of any other type of interference was not accounted for which likely yield a different set of results. It would be interesting to take a look at more realistic waves to see if they have the exact same harmonic behavior.
Adding on to our previously discussed patterns, we incorporated the idea of a series that models the relationship between frequency and period length. This we saw as the harmonic series. It helped us determine its properties, especially its divergence. From this property we understand that although seemingly simple in the finite world, basic patterns such as the Harmonic series can extend into more complex realms with logical reason. Also, the Harmonic series lends to the question of how many other natural phenomena are dictated by simple patterns in mathematics?
Finally, we explored probability. The likelihood that at random one could play a harmonic or consonant chord. We found this probability to be quite low, unsurprisingly. However, we note that if one truly understands the patterns behind the music, the probability can be greatly and consistently increased. We see this apparent in the many works of Beethoven, who although going deaf in his middle ages, he was still able to produce incredibly beautiful compositions that incorporated perfect harmony and a strong sense of emotion.
This exploration helped me to understand more about series and limits, probability and the behavior of sine graphs. In abstract, I have a new understanding of how mathematics relates to reality in simplicity and importantly, in imperfection. For one to further these mathematical investigations, need not look farther than music theory. This ever evolving science uses the power of patterns described in mathematics to achieve a deeper understanding of music. One could explore the area under our harmonic series if it was modeled in a curve using integrals. One could combine the psychology of piano note choosing and get a more realistic understanding of consonant probability. There are many facets in the mathematical regions of music which we have yet to scrape the surface of and they are only waiting to be discovered.
________________
BIBLIOGRAPHY:
GeoGebra Graphing Calculator program and Gyazo screenshot
* Graphs of frequencies;
https://en.wikipedia.org/wiki/Pythagorean_tuning
* Pythagoras’ theory;
https://en.wikipedia.org/wiki/Pythagorean_interval
* Pythagorean intervals;
http://scipp.ucsc.edu/~haber/archives/physics116A10/harmapa.pdf
* Divergence proofs of various harmonic series;
http://www.liutaiomottola.com/formulae/freqtab.htm
* Frequencies of all notes;
http://en.wikipedia.org/wiki/Octave
* Octave explanation
http://en.wikipedia.org/wiki/Semitone
* Semitone explanation and examples