Music and Math

Pre-scriptum (dated 26 June 2020): These posts on elementary math and physics have not suffered much the attack by the dark force鈥攚hich is good because I still like them. While my views on the true nature of light, matter and the force or forces that act on them have evolved significantly as part of my explorations of a more realist (classical) explanation of quantum mechanics, I think most (if not all) of the analysis in this post remains valid and fun to read. In fact, I find the simplest stuff is often the best. 馃檪

Original post:

I ended my previous post, on Music and Physics, by emphatically making the point that music is all about structure, about mathematical relations. Let me summarize the basics:

1. The octave is the musical unit, defined as the interval between two pitches with the higher frequency being twice聽the frequency of the lower聽pitch. Let’s聽denote the lower and higher pitch by聽a and b respectively, so we say that b‘s frequency is twice聽that of a.

2. We then divide the [a, b] interval (whose length is unity) in twelve equal sub-intervals, which define eleven notes in-between a and b. The pitch of the notes in-between is defined by the exponential function connecting a and b. What exponential function? The exponential function with base 2, so that’s the function y =聽2x.

Why base 2? Because of the doubling of the frequencies when going from a to b, and when going from b to b + 1, and from b + 1 to b + 2, etcetera. In music, we give a, b, b + 1, b + 2, etcetera the same聽name, or symbol: A, for example. Or Do. Or C. Or聽Re. Whatever. If we have the unit and the number of sub-intervals, all the rest follows. We just add a number to distinguish the various As, or Cs, or Gs, so we write A1, A2, etcetera. Or C1, C2, etcetera. The graph below illustrates the principle for the interval between C4 and C5. Don’t think the function is linear. It’s exponential: note the logarithmic frequency scale. To make the point, I also inserted another illustration (credit for that graph goes to another blogger).

Frequency_vs_name

equal-tempered-scale-graph-linear

You’ll wonder: why twelve sub-intervals? Well… That’s random. Non-Western cultures use a different number. Eight instead of twelve, for example鈥攚hich is more logical, at first sight at least:聽eight intervals amounts to dividing the interval in two equal halves, and the halves in halves again, and then once more: so the length of the sub-interval is then 1/2路1/2路1/2 = (1/2)3聽= 1/8. But why wouldn’t we divide by three, so we have 9 = 3路3 sub-intervals? Or by 27 = 3路3路3? Or by 16? Or by 5?

The answer is: we don’t know. The limited sensitivity of our ear demands that the intervals be cut up somehow. [You can do tests of the sensitivity of your ear to relative frequency differences online: it’s fun. Just try them! Some of the sites may recommend a hearing aid, but don’t take that crap.] So… The bottom line is that,聽somehow, mankind settled on twelve sub-intervals within our musical unit鈥攐r our sound unit, I should say.聽So it is what it is, and the ratio of the frequencies between two successive (semi)tones (e.g. C and C#, or E and F, as E and F are also separated by one half-step only)聽is 21/12聽= 1.059463… Hence, the pitch of each note is about 6% higher than the pitch of the previous note. OK. Next thing.

3.聽What’s the similarity between C1, C2, C3 etcetera? Or between A1, A2, A3 etcetera? The answer is: harmonics. The frequency of the first overtone聽of a string tuned at pitch A3 (i.e. 220 Hz) is equal to the fundamental frequency of a string tuned at pitch A4 (i.e. 440 Hz). Likewise,聽the frequency of the (pitch of the) C4 note above (which is the so-called middle C)聽is 261.626 Hz, while the frequency of the (pitch of the) next C note (C5) is twice聽that frequency: 523.251 Hz.聽[I should quickly clarify the terminology here: a tone consists of several harmonics, with frequencies f, 2路f, 3路f,… n路f,… The first harmonic is referred to as the fundamental, with frequency聽f. The second, third, etc harmonics are referred to as聽overtones, with frequency 2路f, 3路f, etc.]

To make a long story short: our ear is able to identify the individual harmonics in a tone, and if the frequency of the first harmonic of one tone (i.e. the fundamental) is the same frequency as the second harmonic of another, then we feel they are separated by one musical unit.

Isn’t that most remarkable? Why would it be that way?

My intuition tells me I should look at the energy of the components. The energy theorem tells us that the total energy in a wave is just the sum of the energies in all of the Fourier components. Surely, the fundamental must carry most of the energy, and then the first overtone, and then the second. Really? Is that so?

Well… I checked online to see if there’s anything on that, but my quick check reveals there’s nothing much out there in terms of research: if you’d聽google聽‘energy levels of overtones’, you’ll get hundreds of links to research on the vibrational modes of molecules, but nothing that’s related to music theory.聽So… Well… Perhaps this is my first truly original post! 馃檪 Let’s go for it. 馃檪

The energy in a wave is proportional to the square of its amplitude, and we must integrate over one period (T) of the oscillation. The illustration below should help you to understand what’s going on. The fundamental mode of the wave is an oscillation with a wavelength (位1) that is twice聽the length of the string (L). For the second mode, the wavelength (位2) is just L. For the third mode, we find that 位3聽= (2/3)路L. More in general, the wavelength of the nth聽mode is聽位n聽= (2/n)路L.

modes

The illustration above shows that we’re talking sine waves here, differing in their frequency (or wavelength) only. [The speed of the wave (c), as it travels back and forth along the string, i constant, so frequency and wavelength are in that simple relationship: c = f路位.] Simplifying and normalizing (i.e. choosing the ‘right’ units by multiplying scales with some proportionality constant), the energy of the first mode would be (proportional to):

Integral 1

What about the second and third modes? For the second mode, we have two oscillations per cycle, but we still need to integrate over the period of the first mode T = T1,聽which is聽twice聽the period of the second mode: T1聽= 2路T2. Hence,聽T2聽= (1/2)路T1. Therefore, the argument of the sine wave (i.e. the聽x variable in the integral above) should go from 0 to 4蟺. However, we want to compare the energies of the various modes, so let’s substitute cleverly. We write:

Integral 2

The period of the third mode is equal to T3聽= (1/3)路T1. Conversely, T1聽= 3路T3. Hence, the argument of the sine wave should go from 0 to 6蟺. Again, we’ll substitute cleverly so as to make the energies comparable. We write:

Integral 3

Now聽that聽is interesting! For a so-called ideal聽string, whose motion is the sum of a sinusoidal oscillation at the fundamental frequency f, another at the second harmonic frequency 2路f, another at the third harmonic 3路f, etcetera, we find that the energies of the various modes are proportional to the values in the harmonic series 1, 1/2, 1/3, 1/4,… 1/n, etcetera. Again, Pythagoras’ conclusion was wrong (the ratio of frequencies of individual notes do not respect simple ratios), but his intuition was right: the harmonic series 鈭憂鈭1聽(n = 1, 2,…,鈭) is very聽relevant in describing natural phenomena. It gives us the respective energies of the various natural聽modes聽of a vibrating string! In the graph below, the values are represented as聽areas. It is all quite deep and mysterious really!

602px-Integral_Test

So now we know why we feel C4 and C5 have so much in common that we call them by the same name: C, or聽Do. It also helps us to understand why the E and A tones have so much in common:聽the聽third harmonic of the 110 Hz A2聽string corresponds to the fundamental frequency of the E4 string: both are 330 Hz! Hence, E and A have ‘energy in common’, so to speak, but less ‘energy in common’ than two successive E notes, or two successive A notes, or two successive C notes (like C4 and C5).

[…]聽Well… Sort of… In fact, the analysis above is quite appealing but聽鈥 I hate to say it聽鈥 it’s wrong, as I explain in my聽post scriptum聽to this post. It’s like Pythagoras’ number theory of the Universe: the intuition behind is OK, but the conclusions aren’t quite right. 馃檪

Ideality versus reality

We’ve been talking ideal聽strings. Actual tones coming out of actual strings have a quality, which is determined by the relative amounts of the various harmonics that are present in the tone, which is not聽some simple sum of sinusoidal functions. Actual tones have a waveform that may resemble something like the wavefunction I presented in my previous post, when discussing Fourier analysis. Let me insert that illustration once again (and let me also acknowledge its source once more: it’s聽Wikipedia). The red waveform聽is the sum of six sine functions, with harmonically related frequencies, but with different amplitudes. Hence, the energy levels of the various modes will not be proportional to the values in that harmonic series聽鈭憂鈭1, with n = 1, 2,…,鈭.

Fourier_series_and_transform

Das wohltemperierte Klavier

Nothing in what I wrote above is related to questions of taste like: why do I seldomly select a classical music channel on my online radio station? Or why am I not into hip hop, even if my taste for music is quite similar to that of the common crowd (as evidenced from the fact that I like ‘Listeners’ Top’ hit lists)?

Not sure. It’s an unresolved topic, I guess鈥攊nvolving聽rhythm聽and other ‘structures’ I did聽not聽mention.聽Indeed, all of the above just tells us a nice story about the structure of the聽language聽of music: it’s a story about the tones, and how they are related to each other. That relation is, in essence, an exponential function with base 2. That’s all. Nothing more, nothing less. It’s remarkably simple and, at the same time, endlessly deep. 馃檪 But so it is聽not聽a story about the structure of a musical piece itself, of a pop song of Ellie Goulding, for instance, or one of Bach’s preludes聽or聽fugues.

That brings me back to the original question I raised in my previous post. It’s a question which was triggered, long time ago, when I tried to read Douglas Hofstadter‘s聽G枚del, Escher and Bach, frustrated because my brother seemed to understand it, and I didn’t. So I put it down, and never ever looked at it again. So what is it really about that famous piece of Bach?

Frankly, I still amn’t sure. As I mentioned in my previous post, musicians were struggling to find a tuning system that would allow them to easily transpose musical compositions.聽Transposing music amounts to changing the so-called聽key聽of a musical piece, so that’s moving the whole piece up or down in pitch by some constant interval that is not equal to an聽octave. It’s a piece of cake now. In fact, increasing or decreasing the playback speed of a recording also amounts to transposing a piece: a increase or decrease of the playback speed by 6% will shift the pitch up or down by about one semitone. Why? Well… Go back to what I wrote above about that 12th root of 2. We’ve got the right tuning system now, and so everything is easy. Logarithms are great! 馃檪

Back to Bach. Despite their admiration for the Greek ideas around aesthetics聽鈥 and,聽most notably, their fascination with harmonic ratios! 鈥 (almost) all Renaissance聽musicians were struggling with the so-called聽Pythagorean聽tuning system, which was used until the 18th century and which was based on a聽correct聽observation (similar strings, under the same tension but differing in length, sound 鈥榩leasant鈥 when sounded together聽if聽鈥 and only if 聽鈥 the ratio of the length of the strings is like 1:2, 2:3, 3:4, 3:5, 4:5, etcetera) but a聽wrong conclusion聽(the frequencies of musical tones should also obey the same harmonic ratios), and Bach’s so-called聽‘good’聽temperament tuning system was designed such that the piece could, indeed, be played in most keys without sounding… well… out of tune. 馃檪

Having said that, the modern ‘equal temperament’ tuning system, which prescribes that tuning should be done such that the notes are in the above-described simple聽logarithmic relation to each other, had already been invented. So the true question is: why didn’t Bach embrace it? Why did he stick to ratios? Why did it take so long for the right system to be accepted?

I don’t know. If you聽google, you’ll find a zillion of possible explanations. As far as I can see, most are all rather mystic. More importantly, most of them do not mention many facts. My explanation is rather simple: while Bach was, obviously, a musical genius, he may not have understood what an exponential, or a logarithm, is all about. Indeed, a quick read of summary biographies reveals that聽Bach studied a wide range of topics, like Latin and Greek, and theology鈥攐f course! But math is not mentioned. He didn’t write about tuning and all that: all of his time went to writing musical masterpieces!

What the biographies do mention is that he always found other people’s tunings unsatisfactory, and that he tuned his聽harpsichords and clavichords himself. Now that聽is quite revealing, I’d say! In my view, Bach couldn’t care less about the ratios. He knew something was wrong with the Pythagorean system (or the variants as were then used, which are referred to as meantone temperament)聽and, as a musical genius, he probably ended up tuning聽by ear.聽[For those who’d wonder what I am talking about, let me quickly insert a Wikipedia graph illustrating the difference between the Pythagorean system (and two of these meantone聽variants) and the聽equal temperament聽tuning system in use today.]

Meantone

So… What’s the point I am trying to make? Well… Frankly, I’d bet Bach’s own tuning was聽actually equal temperament, and so he should have named his masterpiece聽Das gleichtemperierte Klavier. Then we wouldn’t have all that ‘noise’ around it. 馃檪

Post scriptum: Did you like the argument on the respective energy levels of the harmonics of an ideal string? Too bad. It’s wrong. I made a common mistake: when substituting variables in the integral, I ‘forgot’ to substitute the lower and upper bound of the interval over which I was integrating the function. The calculation below corrects the mistake, and so it does the required substitutions鈥攆or the first three modes at least. What’s going on here? Well… Nothing much…聽I just integrate over the length L taking a snapshot at t = 0 (as mentioned, we can always shift the origin of our independent variable, so here we do it for time and so it’s OK). Hence, the argument of our wave function sin(kx鈭捪塼) reduces to kx, with k = 2蟺/位, and聽位= 2L, 位聽= L, 位= (2/3)路L for the first, second and third mode respectively. [As for solving the integral of the sine squared, you can聽google聽the formula, and please do check my substitutions. They should be OK, but… Well… We never know, do we? :-)]

energy integrals

[…] No… This doesn’t make all that much sense either. Those integrals yield聽the same energy for all three modes. Something must be wrong: shorter wavelengths (i.e. higher frequencies) are associated with higher energy levels. Full stop. So the ‘solution’ above can’t be right… […] You’re right. That’s where the time aspect comes into play. We were taking a snapshot, indeed, and the mean value of the sine squared function is 1/2 = 0.5, as should be clear from Pythagoras’ theorem: cos2x + sin2x = 1. So what I was doing is like integrating a constant function over the same-length interval. So… Well… Yes: no wonder I get the same value again and again.

[…]

We need to integrate over the same聽time interval. You could do that, as an exercise, but there’s a more direct approach to it: the energy of a wave is directly proportional to its frequency, so we write: E 鈭 f. If the frequency doubles, triples, quadruples etcetera, then its energy doubles, triples, quadruples etcetera too. But 鈥 remember 鈥 we’re talking one string only here, with a fixed wave speed聽c =聽路f聽鈥 so f = c/位 (read: the frequency is inversely proportional to the wavelength)聽鈥 and, therefore (assuming the same (maximum) amplitude), we get that the energy level of each mode is inversely proportional to the wavelength, so we find that E聽鈭 1/f.

Now, with direct or inverse proportionality relations, we can always invent some new unit that makes the relationship an identity, so let’s do that and turn it into an equation indeed. [And, yes, sorry… I apologize again to your old math teacher: he may not quite agree with the shortcut I am taking here, but he’ll justify the logic聽behind.] So… Remembering that聽位1聽=聽2L, 位2聽= L, 位3聽=聽(2/3)路L, etcetera, we can then write:

E1聽= (1/2)/L, E2聽= (2/2)/L, E3聽=聽(3/2)/L, E4聽=聽(4/2)/L, E5聽=聽(5/2)/L,…, En聽=聽(n/2)/L,…

That’s a really聽nice result, because… Well… In quantum theory, we have this so-called聽equipartition theorem, which says that the permitted energy levels of a harmonic oscillator are equally spaced, with the interval between them equal to h or (if you use the angular frequency to describe a wave (so that’s 蠅 = 2蟺路f), then Planck’s constant (h) becomes 魔 = h/2蟺). So here we’ve got equipartition too, with the interval between the various energy levels equal to (1/2)/L.

You’ll say: So what? Frankly, if this doesn’t amaze you, stop reading鈥攂ut if this doesn’t amaze you, you actually stopped reading a long time ago. 馃檪 Look at what we’ve got here. We聽didn鈥檛 specify anything about that string, so we didn鈥檛 care about its聽materials or diameter or tension or how it was made (a wound guitar string is a terribly complicated thing!) or about whatever. Still, we know its fundamental (or normal) modes, and their frequency or nodes or energy or whatever depend on the length of the string聽only, with the ‘fundamental’ unit of energy being equal to the reciprocal length. Full stop. So all is just a matter of size and proportions. In other words, it’s all about structure. Absolute measurements don’t matter.

You may say: Bull****.聽What’s the conclusion? You still didn’t tell me anything about how the total energy of the wave is supposed to be distributed over its normal modes!聽

That’s true. I didn’t. Why? Well… I am not sure, really. I presented a lot of stuff here, but I did not聽present a clear and unambiguous answer as to how the total energy of a string is distributed over its modes. Not for actual strings, nor for ideal聽strings. Let me be honest: I don’t know. I really don’t. Having said that, my guts instinct that most of the energy 鈥撀爋f, let’s say, a C4 note 鈥 should be in the primary mode (i.e. in the fundamental frequency) must聽be right: otherwise we would not call it a C4 note. So let’s try to make some assumptions. However, before doing so, let’s first briefly touch base with reality.

For actual聽strings (or聽actual聽musical sounds), I suspect the analysis聽can be quite complicated, as evidenced by the following illustration, which I took from one of the many interesting sites聽on this topic. Let me quote the author: “A flute is essentially a tube that is open at both ends. Air is blown across one end and sound comes out the other. The harmonics are all whole number multiples of the fundamental frequency (436聽Hz, a slightly flat A4 鈥 a bit lower in frequency than is normally acceptable). Note how the second harmonic is nearly as intense as the fundamental. [My = blog writer’s 馃檪 italics] This strong second harmonic is part of what makes a flute sound like a flute.”

Hmmm… What I see in the graph is a first harmonic that is actually more聽intense than its fundamental, so what’s that all about? So can we actually associate a specific frequency to that tone? Not sure. :-/ So we’re in trouble already.

flute

If reality doesn’t match our thinking, what about ideality? Hmmm… What to say?聽As for ideal聽strings 鈥 or ideal flutes 馃檪聽鈥 I’d venture to say that the most obvious distribution of energy over the various modes (or harmonics, when we’re talking sound) would is the聽Boltzmann distribution.

Huh?Yes. Have a look at one of my posts on statistical mechanics. It’s a weird thing: the distribution of molecular speeds in a gas, or the density of the air in the atmosphere, or whatever involving many particles and/or聽a great degree of complexity (so many, or such a degree of complexity, that only some kind of statistical approach to the problem works鈥攁ll that involves Boltzmann’s Law, which basically says the distribution function will be a function of the energy聽levels involved:聽f =聽e鈥揺nergy. So… Well… Yes. It’s the logarithmic scale again. It seems to govern the Universe. 馃檪

Huh?Yes. That’s why I聽think: the distribution of the total energy of the oscillation should be some Boltzmann function, so it should depend on the energy of the modes: most of the energy will be in the lower modes, and most of the most in the fundamental. […]聽Hmmm… It again begs the question: how much聽exactly?

Well… The Boltzmann聽distribution strongly聽resembles聽the ‘harmonic’ distribution shown above (1, 1/2, 1/3, 1/4 etc), but it’s not quite the same. The graph below shows how they are similar and dissimilar in shape. You can experiment yourself with coefficients and all that, but your conclusion will be the same. As they say in Asia: they are “same-same but different.” 馃檪 […]聽It’s like the ‘good’ and ‘equal’ temperament used when tuning musical instruments: the ‘good’ temperament 鈥 which is聽based on harmonic ratios 鈥 is good, but not good enough. Only the ‘equal’ temperament obeys the logarithmic scale and, therefore, is perfect. So, as I mentioned already, while my assumption isn’t quite right (the distribution is not聽harmonic, in the Pythagorean聽sense), the intuition behind is OK. So it’s just like Pythagoras’ number theory of the Universe. Having said that, I’ll leave it to you to draw the correct the conclusions from it. 馃檪

graph

Music and Physics

Pre-scriptum (dated 26 June 2020): These posts on elementary math and physics have not suffered much the attack by the dark force鈥攚hich is good because I still like them. While my views on the true nature of light, matter and the force or forces that act on them have evolved significantly as part of my explorations of a more realist (classical) explanation of quantum mechanics, I think most (if not all) of the analysis in this post remains valid and fun to read. In fact, I find the simplest stuff is often the best. 馃檪

Original post:

My first working title for this post was Music and聽Modes. Yes. Modes. Not moods. The relation between music and moods is an interesting research topic as well but so it’s not what I am going to write about. 馃檪

It started with me thinking I should write something on modes indeed, because the concept of a聽mode聽of a wave, or any oscillator really, is quite central to physics, both in classical physics as well as in quantum physics (quantum-mechanical systems are analyzed as oscillators too!). But I wondered how to approach it, as it’s a rather boring topic if you look at the math only. But then聽I was flying back from Europe, to Asia, where I live and, as I am also playing a bit of guitar, I suddenly wanted to know why we like music. And then I thought that’s a question you may have asked yourself at some point of time too! And so then I thought I should write about modes as part of a more interesting story: a story about聽music鈥攐r, to be precise, a story about the physics behind music. So… Let’s go for it.

Philosophy versus physics

There is, of course, a very simple answer to the question of why we like music: we like music because it is music. If it would not聽be music, we would not聽like it. That’s a rather philosophical answer, and it probably satisfies most people. However, for someone studying physics, that answer can surely not be sufficient.聽What’s the physics behind? I reviewed Feynman’s聽Lectureon sound waves in the plane, combined it with some other stuff I googled聽when I arrived, and then I wrote this post, which gives you a much less philosophical answer. 馃檪

The observation at the center of the discussion is deceptively simple: why is it that similar strings (i.e. strings made of the same material, with the same thickness, etc), under the same tension but differing in length, sound ‘pleasant’ when sounded together if鈥 and only if 聽鈥 the ratio of the length of the strings is like 1:2, 2:3, 3:4, 3:5, 4:5, etc (i.e. like whatever other ratio of two small integers)?

You probably wonder: is that the question, really? It is. The question is deceptively simple indeed because, as you will see in a moment, the answer is quite complicated. So聽complicated, in fact, that the Pythagoreans didn’t have any answer. Nor did anyone else for that matter鈥攗ntil the 18th century or so, when musicians, physicists and mathematicians alike started to realize that a string (of a guitar, or a piano, or whatever instrument Pythagoras was thinking of at the time),聽or a column of air (in a pipe organ or a trumpet, for example), or whatever other thing that actually creates the musical tone, actually聽oscillates at numerous frequencies simultaneously.

The Pythagoreans did not suspect that a string, in itself, is a rather complicated thing 鈥 something which physicists refer to as a harmonic oscillator 鈥撀燼nd that its sound, therefore, is actually produced by many frequencies, instead of only one. The concept of a pure note, i.e. a tone that is free of harmonics (i.e. free of all other frequencies, except for the fundamental聽frequency) also didn’t exist at the time. And if it did, they would not have been able to produce a pure tone anyway: producing pure tones 鈥 or notes, as I’ll call them, somewhat inaccurately (I should say: a pure聽pitch)聽鈥撀爄s remarkably complicated, and they do not exist in Nature. If the Pythagoreans would have been able to produce pure tones, they would have observed that pure tones do聽not聽give any sensation of consonance or dissonance if their relative frequencies respect those simple ratios. Indeed, repeated experiments, in which such pure tones are being produced, have shown that human beings can’t really say whether it’s a musical sound or not: it’s just sound, and it’s neither pleasant (or consonant, we should say)聽or unpleasant (i.e. dissonant).

The Pythagorean observation is聽valid, however, for actual (i.e. non-pure)聽musical tones. In short, we need to distinguish between聽tones and notes (i.e. pure tones): they聽are two very different things, and the gist of the whole argument is that musical tones coming out of one (or more) string(s) under tension are full of harmonics and, as I’ll explain in a minute, that’s what explains the observed relation between the lengths of those strings and the phenomenon of consonance聽(i.e. sounding ‘pleasant’) or dissonance聽(i.e.聽sounding ‘unpleasant’).

Of course, it’s easy to say what I say above: we’re 2015 now, and so we have the benefit of hindsight. Back then 鈥 聽so that’s more than 2,500 years ago! 鈥 the simple but remarkable聽fact that the lengths of similar strings should respect some simple ratio if they are to sound ‘nice’ together, triggered a fascination with number theory (in fact, the Pythagoreans actually established the foundations of what is now known as number theory). Indeed, Pythagoras felt that similar relationships should also hold for other natural phenomena! To mention just one example, the Pythagoreans also believed that the orbits of the planets would also respect such simple numerical relationships, which is why they talked of the ‘music of the spheres’ (Musica Universalis).

We now know that the Pythagoreans were聽wrong. The聽proportions in the movements of the planets around the Sun do not respect simple ratios and, with the benefit of hindsight once again, it is regrettable that it took many courageous and brilliant people, such as Galileo Galilei and Copernicus, to convince the Church of that fact. 馃槮 Also, while Pythagoras’ observations in regard to the sounds coming out of whatever strings he was looking at were correct, his conclusions were wrong: the observation does not聽imply that the frequencies of musical notes聽should all be in some simple ratio one to another.

Let me repeat what I wrote above: the frequencies of musical notes聽are not聽in some simple relationship one to another. The frequency scale for all musical tones is logarithmic and, while that implies that we can, effectively, do some tricks with ratios based on the properties of the logarithmic scale (as I’ll explain in a moment), the so-called ‘Pythagorean’ tuning system, which is based on simple ratios, was plain wrong, even if it 鈥 or some variant of it (instead of the 3:2 ratio, musicians used the 5:4 ratio from about 1510 onwards) 鈥 was generally used until the 18th century!聽In short, Pythagoras was wrong indeed鈥攊n this regard at least: we can’t do much with those simple ratios.

Having said that, Pythagoras’ basic intuition was right, and that intuition is still very much what drives physics today: it’s the idea that Nature can be described, or explained (whatever that means), by quantitative relationships only. Let’s have a look at how it actually works for music.

Tones, noise and notes

Let’s first define and distinguish tones and notes.聽A musical tone is the opposite of noise, and the difference between the two is that musical tones are聽periodic聽waveforms, so they have a聽period聽T, as illustrated below. In contrast, noise is a non-periodic waveform. It’s as simple as that.

noise versus music

Now, from previous posts, you know we can write any period function as the sum of a potentially infinite number of simple harmonic functions, and that this sum is referred to as the Fourier series. I am just noting it here, so don’t worry about it as for now. I’ll come back to it later.

You also know we have seven musical notes: Do-Re-Mi-Fa-Sol-La-Si or, more common in the English-speaking world, A-B-C-D-E-F-G. And then it starts again with A (or Do). So we have two notes, separated by an interval which is referred to as an octave聽(from the Greek聽octo, i.e. eight), with six notes in-between, so that’s eight notes in total. However, you also know that there are notes in-between, except between E and F and between B and C. They are referred to as semitones or half-steps. I prefer the term ‘half-step’ over ‘semitone’, because we’re talking notes really, not tones.

We have, for example, F鈥sharp聽(denoted by F#), which we can also call G-flat (denoted by Gb). It’s the same thing: a sharp # raises a note by a semitone (aka half-step), and a flat b lowers it by the same amount, so F# is Gb. That’s what shown below: in an octave, we have eight notes but twelve half-steps.聽

Frequency_vs_name

Let’s now look at the frequencies. The frequency聽scale above (expressed in oscillations per second, so that’s the hertz unit) is a logarithmic scale: frequencies聽double聽as we go from one octave to another: the frequency of the C4 note above (the so-called middle C)聽is 261.626 Hz, while the frequency of the next C note (C5) is double that: 523.251 Hz. [Just in case you’d want to know: the 4 and 5 number refer to its position on a standard 88-key piano keyboard: C4 is the fourth C key on the piano.]

Now, if we equate the interval between C4 and C5 with 1 (so the octave is our musical ‘unit’), then the interval between the twelve half-steps is, obviously, 1/12. Why? Because we have 12 halve-steps in our musical unit. You can also easily verify that, because of the way logarithms work, the聽ratio of the frequencies of two notes that are separated by one half-step (between D# and E, for example) will be equal to 21/12. Likewise, the ratio of the frequencies of two notes that are separated by n聽half-steps is equal to 2n/12. [In case you’d doubt, just do an example. For instance, if we’d denote the frequency of C4 as聽f0, and the frequency of C# as f1聽and so on (so the frequency of D is f2, the frequency of C5 is f12, and everything else is in-between), then we can write the f2/f0聽ratio as聽f2/f0聽= (聽f2/f1)(f1/f0) = 聽21/12路21/12聽= 22/12聽= 21/6. I must assume you’re smart enough to generalize this result yourself, and that聽f12/f0聽is, obviously, equal to聽212/12聽=21聽= 2, which is what it should be!]

Now, because the frequencies of the various C notes are expressed as a number involving some decimal fraction (like聽523.251 Hz, and the 0.251 is actually an approximation only), and because they are, therefore, a bit hard to read and/or work with, I’ll illustrate the next idea 鈥 i.e. the concept of harmonics 鈥 with the A instead of the C. 馃檪

Harmonics

The lowest A on a piano is denoted by A0, and its frequency is 27.5 Hz. Lower A notes exist (we have one at 13.75 Hz, for instance) but we don’t use them, because they are near (or actually beyond) the limit of the lowest frequencies we can hear. So let’s stick to our grand piano and start with that 27.5 Hz frequency. The next A note is A1, and its frequency is 55 Hz. We then have A2, which is like the A on my (or your) guitar: its frequency is equal to 2脳55 = 110 Hz. The next is A3, for which we double the frequency once again: we’re at 220 Hz now. The next one is the A in the illustration of the C scale above: A4, with a frequency of 440 Hz.

[Let me, just for the record, note that the A4聽note is the standard tuning pitch聽in Western music. Why? Well… There’s no good reason really, except convention. Indeed,聽we can derive the frequency of any other note from that A4聽note using our formula for the ratio of frequencies but, because of the properties of a logarithmic function, we could do the same using whatever other note really. It’s an important point: there’s no such thing as an absolute reference point in music: once we define聽our musical ‘unit’ (so that’s the so-called octave in Western music), and how many steps we want to have in-between (so that’s 12 steps鈥攁gain, in Western music, that is), we get all the rest. That’s just how logarithms work. So music is all about structure, i.e. mathematical relationships. Again, Pythagoras’ conclusions were wrong, but his intuition was right.]

Now, the notes we are talking about here are all so-called pure tones. In fact, when I say that the A on our guitar is referred to as A2聽and that it has a frequency of 110 Hz, then I am actually making a huge simplification. Worse, I am lying when I say that: when you play a string on a guitar, or when you strike a key on a piano, all kinds of other frequencies 鈥 so-called harmonics聽鈥 will resonate as well, and that’s what gives the quality to the聽sound: it’s what makes it sound beautiful. So the fundamental frequency (aka as聽first harmonic) is 110 Hz alright but we’ll also have second, third, fourth, etc harmonics with frequency 220 Hz, 330 Hz, 440 Hz, etcetera. In music, the basic or fundamental frequency is referred to as the pitch of the tone and, as you can see, I often use the term ‘note’ (or pure聽tone)聽as a synonym for pitch鈥攚hich is more or less OK, but not quite correct actually. [However, don’t worry about it: my sloppiness here does not affect the argument.]

What’s the physics behind? Look at the illustration below (I borrowed it from the聽Physics Classroomsite). The thick black line is the string, and the wavelength of its fundamental frequency (i.e. the first harmonic) is聽twice聽its length, so we write 位1聽= 2路L or, the other way around, L = (1/2)路位1. Now that’s the so-called first mode聽of the string. [One often sees the term fundamental聽or聽natural or normal聽mode, but the adjective is not necessary really. In fact, I find it confusing, although I sometimes find myself using it too.]

string

We also have a second, third, etc mode, depicted below, and these modes correspond to the second, third, etc harmonic respectively.

modes

For the second, third, etc mode, the relationship between the wavelength and the length of the string is, obviously, the following: L = (2/2)路位2聽=聽位2, L = L = (3/2)路位3, etc. More in general, for the nth聽mode, L will be equal to L = (n/2)路位n, with n = 1, 2, etcetera. In fact, because L is supposed to be some fixed length, we should write it the other way around: 位n聽= (2/n)路L.

What does it imply for the frequencies? We know that the聽speed聽of the wave 鈥 let’s denote it by c 鈥撀燼s it travels up and down the string, is a property of the string,聽and it’s a property聽of the string only. In other words, it does聽not聽depend on the frequency. Now, the wave velocity is equal to the frequency times the wavelength,聽always, so we have c = f路位. To take the example of the (classical) guitar string: its length is 650 mm, i.e. 0.65 m. Hence, the identities 位1聽= (2/1)路L,聽位2聽= (2/2)路L,聽位3聽= (2/3)路L etc聽become 位1聽= (2/1)路0.65 = 1.3 m, 位2聽= (2/2)路0.65 = 0.65 m, 位3聽= (2/3)路0.65 = 0.433.. m and so on. Now, combining these wavelengths with the above-mentioned frequencies, we get the wave velocity c = (110 Hz)路(1.3 m) = (220 Hz)路(0.65 m) = (330 Hz)路(0.433.. m) = 143 m/s.

Let me now get back to Pythagoras’ string. You should note that the frequencies of the harmonics produced by a simple guitar string are related to each other by simple whole number ratios. Indeed, the frequencies of the first and second harmonics are in a simple 2 to 1 ratio (2:1). The second and third harmonics have a 3:2 frequency ratio. The third and fourth harmonics a 4:3 ratio. The fifth and fourth harmonic 5:4, and so on and so on. They have to be. Why?聽Because the harmonics are simple multiples of the basic frequency. Now聽that聽is what’s really behind Pythagoras’ observation: when he was sounding similar strings with the same tension but different lengths, he was making sounds with the same harmonics. Nothing more, nothing less.聽

Let me be quite explicit here, because the point that I am trying to make here is somewhat subtle. Pythagoras’ string is Pythagoras’ string: he talked similar strings. So we’re not talking some actual guitar or a piano or whatever other string instrument. The strings on (modern) string instruments are not similar, and they do not聽have the same tension.聽For example, the six strings of a guitar strings do聽not聽differ in length (they’re all 650 mm) but they’re different聽in tension. The six strings on a classical guitar also have a different diameter, and the first three strings are plain strings, as opposed to the bottom strings, which are wound. So the strings are not similar but very different indeed. To illustrate the point, I copied the values below for just one of the many commercially available guitar string sets.聽聽tensionIt’s the same for piano strings. While they are somewhat more simple (they’re all made of piano wire, which is very high quality steel wire basically), they also聽differ鈥攏ot only in length but in diameter as well, typically ranging from聽0.85聽mm for the highest treble strings to 8.5聽mm (so that’s ten times 0.85 mm) for the lowest bass notes.

In short, Pythagoras was聽not聽playing the guitar or the piano (or whatever other more sophisticated string instrument that the Greeks surely must have had too) when he was thinking of these harmonic relationships. The physical explanation behind his famous observation is, therefore, quite simple: musical tones that have the same harmonics sound pleasant,聽or consonant, we should say鈥攆rom the Latin聽con-sonare, which, literally, means ‘to sound together’ (from sonare = to sound and con = with). And otherwise… Well… Then they do聽not聽sound pleasant: they are dissonant.

To drive the point home, let me emphasize that, when we’re plucking a string, we produce a sound consisting of many frequencies, all in one go. One can see it in practice: if you strike a lower A string on a piano 鈥 let’s say the 110 Hz A2聽string 鈥 then its second harmonic (220 Hz) will make the A3聽string vibrate too, because it’s got the same frequency! And then its fourth聽harmonic will make the A4聽string vibrate too, because they’re both at 440 Hz.聽Of course, the strength of these other vibrations (or their amplitude聽we should say)聽will depend on the strength of the other harmonics and we should, of course, expect that the聽fundamental聽frequency (i.e. the first harmonic) will absorb most of the energy. So we pluck one string, and so we’ve got one sound, one聽tone only, but numerous聽notes聽at the same time!

In this regard,聽you should also note that聽the聽third harmonic of our 110 Hz A2聽string corresponds to the fundamental frequency of the E4 tone: both are 330 Hz! And, of course, the harmonics of E, such as its second harmonic (2路330 Hz = 660 Hz) correspond to higher harmonics of A too! To be specific, the second harmonic of our E string is equal to the sixth harmonic of our A2聽string. If your guitar is any good,聽and if your strings are of reasonable quality too, you’ll actually see it: the (lower) E and A strings co-vibrate if you play the A major chord, but by striking the upper four strings only. So we’ve got energy – motion really – being transferred from the four strings you do strike to the two strings you do聽not strike! You’ll say: so what? Well… If you’ve got any better proof of the actuality (or reality)聽of various frequencies being present at the same time, please tell me! 馃檪

So that’s why A and E sound very聽well together (A, E and C#, played together, make up the so-called A major chord): our ear likes matching harmonics. And so that聽why we like musical tones鈥攐r why we define those tones as being musical! 馃檪 Let me summarize it once more: musical tones are composite sound waves, consisting of a fundamental frequency and so-called harmonics (so we’ve got many notes聽or pure tones altogether in one musical聽tone). Now, when other musical tones have harmonics that are shared, and we sound those notes too, we get the sensation of harmony, i.e. the combination sounds聽consonant.

Now, i’s not difficult to see that we will always have such shared harmonics if we have聽similar strings, with the same tension but different lengths, being sounded together. In short, what Pythagoras observed has nothing much to do with聽notes, but with聽tones.聽Let’s go a bit further in the analysis now by introducing some more math. And, yes, I am very sorry: it’s the dreaded Fourier analysis indeed! 馃檪

Fourier analysis

You know that we can decompose any periodic function into a sum of a (potentially infinite) series of simple sinusoidal functions, as illustrated below. I took the illustration from Wikipedia: the red function s6(x) is the sum of six sine functions of different amplitudes and (harmonically related) frequencies. The so-called Fourier transform聽S(f) (in blue) relates the six frequencies with the respective amplitudes.

Fourier_series_and_transform

In light of the discussion above, it is easy to see what this means for the sound coming from a plucked string. Using the angular frequency notation (so we write everything using聽蠅 instead of f), we know that the normal or natural modes of oscillation have frequencies 蠅 = 2蟺/T = 2蟺f(so that’s the fundamental frequency or first harmonic), 2蠅 (second harmonic), 3蠅 (third harmonic), and so on and so on.

Now, there’s no reason to assume that all of the sinusoidal functions that make up our tone should have the same phase: some phase shift聽桅 may be there and, hence, we should write our sinusoidal function 聽not as cos(蠅t), but as cos(蠅t +聽桅) in order to ensure our analysis is general enough.聽[Why not a sine function? It doesn’t matter: the cosine and sine function are the same, except for another phase shift of 90掳 =聽蟺/2.] Now, from our geometry classes, we know that we can re-write cos(蠅t +聽桅) as

cos(蠅t +聽桅) = [cos(桅)cos(蠅t) 鈥 sin(桅)sin(蠅t)]

We have a lot of these functions of course 鈥 one for each harmonic, in fact聽鈥 and, hence, we should use subscripts, which is what we do in the formula below, which says that聽any function f(t) that is periodic with the period T can be written mathematically as:

Fourier series

You may wonder: what’s that period T? It’s the period of the fundamental mode, i.e. the first harmonic. Indeed, the period of the second, third, etc harmonic will only be one half, one third etcetera of the period of the first harmonic. Indeed, T2聽= (2蟺)/(2蠅) = (1/2)路(2蟺)/蠅 = (1/2)路T1, and聽T3聽= (2蟺)/(3蠅) = (1/3)路(2蟺)/蠅 = (1/3)路T1, and so on. However, it’s easy to see that these functions also聽repeat themselves after two, three, etc periods respectively. So all is alright, and the general idea behind the Fourier analysis is further illustrated below. [Note that both the formula as well as the illustration below (which I took from Feynman’s Lectures)聽add a ‘zero-frequency term’ a0聽to the series. That zero-frequency term will usually be zero for a musical tone, because the ‘zero’ level of our tone will be zero indeed. Also note that the an聽and bn聽coefficients are, of course, equal to an聽= cos 桅n聽and bn聽= 鈥搒in桅n, so you can relate the illustration and the formula easily.]

Fourier 2You’ll say: What the heck!聽Why do we need the mathematical gymnastics here? It’s just to understand that other characteristic of a musical tone: its quality聽(as opposed to its pitch). A so-called rich聽tone will have strong harmonics, while a聽pure聽tone will only have the first harmonic. All other characteristics聽鈥 the difference between a tone produced by a violin as opposed to a piano聽鈥 are then related to the ‘mix’ of all those harmonics.

So we have it all now, except for loudness which is, of course, related to the magnitude of the air pressure changes as our waveform moves through the air: pitch, loudness and quality. that’s what makes a musical tone. 馃檪

Dissonance

As mentioned above, if the sounds are not consonant, they’re dissonant. But what is dissonance really? What’s going on? The answer is the following: when聽two frequencies are near to a simple fraction, but not exact, we get so-called beats, which our ear does not聽like.

Huh?聽Relax.聽The illustration below, which I copied from the Wikipedia article on piano tuning, illustrates the phenomenon.聽The blue wave is the sum of the red and the green wave, which are originally identical. But then the frequency of the green wave is increased, and so the two waves are no longer in phase, and the interference results in a beating pattern. Of course, our musical tone involves different frequencies and, hence, different periods聽T1,T2,聽T3聽etcetera, but you get the idea: the higher harmonics also聽oscillate with period T1, and if the frequencies are not聽in some exact ratio, then we’ll have a similar problem: beats, and our ear will not like the sound.

220px-WaveInterference

Of course, you’ll wonder: why don’t we like beats in tones? We can ask that, can’t we? It’s like asking why we like music, isn’t it? […] Well… It is and it isn’t. It’s like asking why our ear (or our brain) likes harmonics. We don’t know. That’s how we are wired. The ‘physical’ explanation of what is musical and what isn’t only goes so far, I guess. 馃槮

Pythagoras versus Bach

From all of what I wrote above, it is obvious that the frequencies of the聽harmonics of a musical tone are, indeed, related by simple ratios of small integers: the frequencies of the first and second harmonics are in a simple 2 to 1 ratio (2:1); the second and third harmonics have a 3:2 frequency ratio; the third and fourth harmonics a 4:3 ratio; the fifth and fourth harmonic 5:4, etcetera. That’s it. Nothing more, nothing less.

In other words, Pythagoras was observing musical tones: he could not聽observe the pure tones聽behind, i.e. the actual聽notes.聽However, aesthetics led Pythagoras, and all musicians after him 鈥 until the mid-18th century 鈥 to also think that the ratio of the frequencies of the notes within an octave聽should also be simple ratios. From what I explained above, it’s obvious that it should not聽work that way: the ratio of the frequencies of two notes separated by n half-steps is 2n/12, and, for most values of n, 2n/12聽is not some simple ratio. [Why? Just take your pocket calculator and calculate the value of 21/12: it’s 20.08333…聽= 1.0594630943… and so on… It’s an irrational number: there are no repeating decimals. Now,聽2n/12聽is equal to 21/12路21/12路…路21/12聽(n times). Why would you expect that product to be equal to some simple ratio?]

So聽鈥撀I said it already 鈥撀Pythagoras was wrong鈥攏ot only in this but also in other regards, such as when he espoused his views on the solar system, for example. Again, I am sorry to have to say that, but it is what is: the Pythagoreans did seem to prefer mathematical ideas over physical experiment.聽馃檪聽Having said that, musicians obviously didn’t know about any alternative to Pythagoras, and they had surely never heard about logarithmic scales at the time. So… Well… They did use the so-called Pythagorean tuning system.聽To be precise, they tuned their instruments by equating the frequency ratio between the first and the fifth tone in the C scale聽(i.e. the C and G, as they did not聽include the C#, D# and F#聽semitones when counting) with the ratio聽3/2, and then they used other so-called harmonic ratios for the notes in-between.

Now, the 3/2 ratio is actually聽almost聽correct, because the actual frequency ratio is聽27/12聽(we have seven tones, including the semitones鈥攏ot five!), and so that’s 1.4983, approximately. Now, that’s pretty close to 3/2 = 1.5, I’d say. 馃檪 Using that approximation (which, I admit, is fairly accurate indeed), the tuning of the other strings would then also be done assuming certain ratios should be respected, like the ones below.

Capture

So it was all quite聽good.聽Having said that, good musicians, and some great mathematicians, felt something was wrong鈥攊f only because there were several so-called just intonation聽systems around (for an overview, check out the Wikipedia article on just intonation). More importantly, they felt it was quite difficult to聽transpose聽music using the Pythagorean tuning system. Transposing music amounts to changing the so-called聽key聽of a musical piece: what one does, basically, is moving the whole piece up or down in pitch by some constant interval that is not equal to an聽octave. Today, transposing music is a piece of cake鈥擶estern music at least. But that’s only because all Western music is played on instruments that are tuned using聽that logarithmic scale (technically, it’s referred to as the 12-tone equal temperament (12-TET) system). When you’d use one of the Pythagorean systems for tuning, a transposed piece does not聽sound quite right.聽

The first mathematician who really seemed to know what was wrong (and, hence, who also knew what to do) was Simon Stevin, who wrote a manuscript based on the ’12th聽root of 2 principle’ around AD 1600. It shouldn’t surprise us: the thinking of this mathematician from Bruges would inspire John Napier’s work on logarithms. Unfortunately, while that manuscript describes the basic principles behind the 12-TET system, it didn’t get published (Stevin had to run away from Bruges, to Holland, because he was protestant and the Spanish rulers at the time didn’t like that). Hence, musicians, while not quite understanding the math聽(or the physics, I should say) behind their own music, kept trying other tuning systems, as they felt it made their music sound better indeed.

One of these ‘other systems’ is the so-called聽‘good’聽temperament, which you surely heard about, as it’s聽referred to in Bach’s famous composition, Das Wohltemperierte Klavier, which he finalized in the first half of the 18th century. What is that ‘good’ temperament really? Well… It is what it is: it’s one of those tuning systems which made musicians feel better about their music for a number of reasons, all of which are well described in the Wikipedia article on it. But the main reason is that the tuning system that Bach recommended was a great deal better when it came to playing the same piece in another key. However, it still wasn’t quite right, as it wasn’t the聽equal temperament聽system (i.e. the 12-TET system) that’s in place now (in the West at least鈥攖he Indian music scale, for instance, is still based on simple ratios).

Why do I mention this piece of Bach? The reason is simple: you probably heard of it because it’s one of the main reference points in a rather famous book: G枚del, Escher and Bach鈥攁n Eternal Golden Braid. If not, then just forget about it. I am mentioning it because one of my brothers loves it. It’s on artificial intelligence. I haven’t read it, but I must assume Bach’s master piece is analyzed there because of its structure, not because of the tuning system that one’s supposed to use when playing it. So… Well… I’d say: don’t make that composition any more mystic than it already is. 馃檪 The ‘magic’ behind it is related to what I said about A4 being the ‘reference point’ in music: since we’re using a universal logarithmic scale now, there’s no such thing as an absolute reference point any more: once we define聽our musical ‘unit’ (so that’s the so-called octave in Western music), and also define how many steps we want to have in-between (so that’s 12鈥攊n Western music, that is), we get all the rest. That’s just how logarithms work.

So, in short, music is all about structure, i.e. it’s all about聽mathematical relations, and about mathematical relations only. Again, Pythagoras’ conclusions were wrong, but his intuition was right. And, of course, it’s his intuition that gave birth to science: the simple ‘models’ he made 鈥 of how notes are supposed to be related to each other, or about our solar system 鈥 were, obviously, just the start of it all. And what a great start it was! Looking back once again, it’s rather sad conservative forces (such as the Church) often got in the way of progress. In fact, I suddenly wonder: if scientists would not have been bothered by those conservative forces, could mankind have sent people around the time that Charles V was born, i.e. around A.D. 1500 already? 馃檪

Post scriptum:聽My example of the聽the (lower) E and A guitar strings co-vibrating when playing the A major chord聽striking the upper four strings only, is somewhat tricky. The (lower) E and A strings are associated with lower聽pitches, and we said overtones (i.e. the second, third, fourth, etc harmonics) are multiples聽of the fundamental frequency.聽So why is that the lower聽strings co-vibrate? The answer is easy: they oscillate at the higher frequencies only. If you have a guitar: just try it. The two strings you do not pluck do vibrate鈥攁nd very visibly so, but the low fundamental frequencies that come out of them when you’d strike them, are not audible. In short, they resonate at the higher frequencies only. 馃檪

The example that Feynman gives is much more straightforward: his example mentions the lower C (or A, B, etc) notes on a piano causing vibrations in the higher C strings (or the higher A, B, etc string respectively). For example, striking the C2 key (and, hence, the C2 string inside the piano) will make the (higher) C3 string vibrate too. But few of us have a grand piano at home, I guess. That’s why I prefer my guitar example. 馃檪

Some content on this page was disabled on June 16, 2020 as a result of a DMCA takedown notice from The California Institute of Technology. You can learn more about the DMCA here:

https://en.support.wordpress.com/copyright-and-the-dmca/