gdritter repos when-computer / 38316f5
Fixed name and relative refs Getty Ritter 8 years ago
2 changed file(s) with 254 addition(s) and 254 deletion(s). Collapse all Expand all
+0
-254
drafts/microtonal-music.telml less more
1 \meta{("pythagorean-tuning-and-equal-temperament"
2 "pythagorean tuning and equal temperament"
3 ("music") 1476776339)}
4
5 There was a recent blog post by \link{https://eev.ee/|Eevee} called \link{https://eev.ee/blog/2016/09/15/music-theory-for-nerds/|Music Theory For Nerds}, which is an excellent whirlwind introduction to a vast swath of music theory. It's very good, and you should go read it.
6
7 When I first read it, it reminded me that one topic I've wanted to write about on this blog was microtonal music. As it turns out, writing about the motivation and theory behind microtonal music involves delving into some of the more esoteric foundations of Western music, to the degree that this post doesn't even get to microtonal tunings. Eevee at one point remarks, on the topic of our twelve-note octave:
8
9 \blockquote{
10 I don’t know why twelve in particular has this effect, or if other roots do as well, but it’s probably why Western music settled on twelve.
11 }
12
13 This blog post is a post about how we settled on twelve.
14
15 \h1{Consonance and Dissonance}
16
17 It helps us to think of sounds as \em{waves}, which correspond to the vibrations sound-carrying materials like air. For demonstration here, I'll be using basic \em{sine waves}, which sound like this:
18
19 \audio{static/tuning/sinewave.mp3}
20
21 We can visualize a sine wave as looking more or less\ref{ink} like this:
22 \sidenote{I drew this in Inkscape and not a graphing tool, so it's not totally accurate, but it doesn't need to be a perfect sine wave to be an okay teaching tool.}
23
24 \img{static/tuning/sin.svg}
25
26 When we talk about the \em{frequency} of this sound, we're talking about the time between peaks in the wave. Frequency is measured in \em{hertz} (abbreviated as \em{Hz}),
27 which in this context just means "peaks of the wave per second".\ref{hertz}
28 \sidenote{It's also my least favorite kind of donut.}
29 Two sounds that have the same number of peaks per second are perceived by human being as being the same sound.
30
31 Additionally, sounds whose frequencies are simple ratios are perceived as somehow "pleasing", while sounds whose frequencies are related by more complicated ratios are perceived as "less pleasing". For example, this will play two frequencies in sequence and then together, one at 300 Hz, and one at 600 Hz, which are related by a \tt{2:1} ratio. The two sounds will sound appropriate to one another:
32
33 \audio{static/tuning/consonant.mp3}
34
35 In comparison, a less simple ratio—here, 300 Hz and 573 Hz, related by a \tt{100:191} ratio—will sound somewhat less pleasant when played together:
36
37 \audio{static/tuning/dissonant.mp3}
38
39 In music and music theory, sounds which "go together" are said to be \em{consonant} and sounds which "don't go together" are called \em{dissonant}. There isn't a strictly-defined separation between the two: some pairs of sounds are clearly consonant (such as the \tt{2:1} ratio) and some are clearly dissonant, but there is no well-defined cutoff point where sounds stop being consonant and start being dissonant. It's best to think of them as relative to one another: a pair of sounds can be \em{more consonant} or \em{more dissonant} than another pair, rather than being \em{consonant} or \em{dissonant} on an absolute scale.\ref{condis} \sidenote{Also note that the terms \em{consonant} and \em{dissonant} are old, and have been informally and sometimes contradictorily defined for centuries: some people define them in terms of frequencies, some in terms of perception, some in terms of both. Defining them as \em{pleasant} and \em{unpleasant} is reductive, but not necessarily a bad intuition.}
40
41 \h1{Picking Points in Sound-Space}
42
43 When we write music, we generally want to put pleasant sounds together, which suggests that we'd like to take the space of all possible sounds—many of which are not going to sound pleasant together at all—and carve it up so that we can have a nice grab-bag of consonant frequencies to work with while omitting dissonant ones. Let's start in a very simple way: we know that intervals composed of simple ratios of frequences are consonant, so let's start with two of the simplest possible ratios—the \tt{2:1} ratio and the \tt{3:2} ratio—and use them to build up a set of "compatible" sounds, a bunch of sounds we can pull from that are guaranteed to have some consonant neighbors in the same set.
44
45 Let's start with 400 Hz as our first tone:
46
47 \svgimg{static/tuning/s1.svg}
48
49 Let's stipulate that every frequency which can be generated from 400 Hz using the \tt{2:1} ratio—that is, frequencies like 100 Hz, 200 Hz, 800 Hz, 1600 Hz—are also included, because all of those frequencies are always going to be consonant with each other. Whenever we add a new frequency \\(f\\) to our scale, we are also going to add \\(2^n \\times f\\) for every integer \\(n\\).
50
51 \svgimg{static/tuning/s1-5.svg}
52
53 Now, let's generate another sound using by the \tt{3:2} ratio. \\(400 \\times \\frac\{3\}\{2\}\\) produces \\(600\\). So, let's add 600 Hz (again including every frequency of the form \\(2^n \\times 600\\), outside the range of our graphic.)
54
55 \svgimg{static/tuning/s2.svg}
56
57 Next, \\(600 \\times \\frac\{3\}\{2\}\\) produces \\(900\\). That's outside the range I've chosen to display here: but, like before, we're going to be including not just 900 Hz, but also all the doubled and halved frequencies we can reach from 900 Hz, and one of those—450 Hz—is within the range of our graphic. Luckily, no matter which new tone we choose add, we're going to also be adding one corresponding tone in the 400 Hz to 800 Hz range, so whenever the new tone generated by application of the \tt{3:2} ratio is outside this range, I'll go ahead and halve it, so every new set of frequencies we generate will be in this range.
58
59 \svgimg{static/tuning/s3.svg}
60
61 Okay, let's keep going: \\(450 \\times \\frac\{3\}\{2\}\\) is 675:
62
63 \svgimg{static/tuning/s4.svg}
64
65 You know the drill now, so I'm just going to list a bunch more:
66 \ul{
67 \li{ \\(675.00 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} = 506.25\\) }
68 \li{ \\(506.25 \\times \\frac\{3\}\{2\}\\ \\ \\ \\ \\ \\ \\ \\ \\approx 759.37\\) }
69 \li{ \\(759.37 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 569.53\\) }
70 \li{ \\(569.53 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 427.14\\) }
71 \li{ \\(427.14 \\times \\frac\{3\}\{2\}\\ \\ \\ \\ \\ \\ \\ \\ \\approx 640.72\\) }
72 \li{ \\(640.72 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 480.54\\) }
73 \li{ \\(480.54 \\times \\frac\{3\}\{2\}\\ \\ \\ \\ \\ \\ \\ \\ \\approx 720.81\\) }
74 \li{ \\(720.81 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 540.61\\) }
75 }
76
77 I'm going to stop there—I'll explain why in a moment—but here's what
78 all the tones we've created so far look like:
79
80 \img{static/tuning/all.svg}
81
82 If you play them in the order we created them, they sound like this:
83
84 \audio{static/tuning/circle.mp3}
85
86 If you play them from left to right, they sound like this:
87
88 \audio{static/tuning/scale.mp3}
89
90 These tones might seem familiar if you've played on (or with) a piano before: we've recreated the tones on a piano keyboard! …or, well, we've gotten \em{very close}.
91
92 \h1{Pythagorean Comma}
93
94 I've been avoiding lumping in too much new jargon, but I might as well do a few reveals: the set of notes I've been building up is generally called \em{Pythagorean Tuning}; an interval with a \tt{2:1} ratio is called an \em{octave}; an interval with a \tt{3:2} ratio is generally called a \em{perfect fifth}, due to a note-numbering system I'm going to gloss over here.
95
96 You'll recall I stopped generating notes after we accumulated twelve of them. We could try to keep going, but something funny thing happens after we add the next note, which is that we get \em{almost but not quite} back to where we started: \\(540.61 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 405.45\\).
97
98 \svgimg{static/tuning/wolf.svg}
99
100 If you play 405.45 Hz and 400 Hz together, they sound close but not \em{quite} the same. They're certainly a lot closer together than any other pair of notes we've produced so far! If you play them next to each other, you can barely hear the difference:
101
102 \audio{static/tuning/almost.mp3}
103
104 It turns out that if you keep using the \tt{3:2} ratio to generate tones, you'll never \em{exactly} get back to where you started: instead, you'll start generating tones that differ just slightly from the ones you already generated. You can keep going, and you'll keep generating more frequencies that will all be slightly different than the ones you generated before, and get back to yet another note that's a bit above 405.45 Hz, and so forth. The closest we'll get to the original 400 Hz will be after we've applied the \tt{3:2} ratio \em{53 times}, but even then, we're not going to hit 400 Hz exactly.
105
106 The difference between that original root frequency (400 Hz) and the almost-but-not-quite-the-root frequency (405.45 Hz) is referred to as \em{Pythagorean comma}\ref{comma}.
107 \sidenote{The word \em{comma} derives from a Greek word for 'cutting': in typography, it originally referred to the part of the sentence after a punctuation mark, which was 'cut off' from the beginning of the sentence, and gradually came to signify the mark itself. In this musical sense, it was originally used because the Pythagorean comma is a 'cut-off portion' of the musical scale.}
108 It's not really very useful to measure Pythagorean comma in hertz, because the difference between the root value and the not-quite-the-root value depends on which frequency we choose as the root, i.e. if we were working in the range of 300 Hz to 600 Hz, then it would be smaller (the difference between 304.09 Hz and 300 Hz), but if we were working in the range of 500 Hz to 1000 Hz, then it would be larger (the difference between 506.82 Hz and 500 Hz.) So let's move away from hertz and start using a different unit of measurement, one where we cancel out the logarithmic nature of frequencies: the \em{cent}.
109
110 The cent is a unit defined in terms of ratios of frequencies, so that the space of an octave—that is, a frequency and its double or half—is always expressed as exactly 1200 cents. Cents turn out to be wonderful for expressing tunings. I'm going to gloss over the conversion formulae between frequencies and cents—you can find them \link{https://en.wikipedia.org/wiki/Cent_(music)#Use|on Wikipedia, of course}—and convert all the frequencies we've generated into cents. I'll include the not-quite-the-root frequency at the end of the table:
111
112 \table{
113 \tr{ \th{ frequency } \th{ cents } }
114 \tr{\td{400.00 Hz} \td{0.00 cents}}
115 \tr{\td{427.14 Hz} \td{113.68 cents}}
116 \tr{\td{450.00 Hz} \td{203.91 cents}}
117 \tr{\td{480.54 Hz} \td{317.59 cents}}
118 \tr{\td{506.25 Hz} \td{407.82 cents}}
119 \tr{\td{540.60 Hz} \td{521.50 cents}}
120 \tr{\td{569.53 Hz} \td{611.73 cents}}
121 \tr{\td{600.00 Hz} \td{701.95 cents}}
122 \tr{\td{640.72 Hz} \td{815.64 cents}}
123 \tr{\td{675.00 Hz} \td{905.86 cents}}
124 \tr{\td{720.81 Hz} \td{1019.55 cents}}
125 \tr{\td{759.37 Hz} \td{1109.77 cents}}
126 \tr{\td{\red{405.45 Hz}} \td{\red{23.46 cents}} }
127 }
128
129
130 Okay, now we have a value for Pythagorean comma: it will always be approximately 23.46 cents, regardless of which base frequency we choose to work with.\ref{pycom}
131 \sidenote{Cents are a more convenient way of expressing ratios of frequencies, but if we wanted to express Pythagorean comma as a ratio, it would be \tt{531441:524288}.}
132
133 Now, let's also try graphing all our cent amounts, including the close-to-the-root note. We end up with something that looks like this:
134
135 \svgimg{static/tuning/cents.svg}
136
137 See those two dots near each other, all the way on the left? The difference between them is what we mean by \em{Pythagorean comma}.
138
139 As an interesting aside: the existence of Pythagorean comma is also the reason for one of the odd vestigial features of musical notation: namely, the existence of \em{enharmonically equivalent notes}. When learning modern music notation, you quickly learn that there are some odd redundancies in staff notation, including the fact that some notes can be expressed more than one way: for example, A♭ and G♯ are two ways of writing the same note. That's true with modern tunings and notation, but one reason for having both notations is that they \em{did} used to connote different notes in tunings like the Pythagorean tuning: if we use A♭ as our root note, then we'd write our close-to-the-root-but-not-quite note as G♯, and the two would differ from each other by the Pythagorean comma. This distinction is no longer made, but we're still stuck with the notation.
140
141 Back to the scale we're generating, where we have have to decide what to do with the not-quite-the-root note: we could include our it in the scale we're creating, and maybe even continue generating new frequencies from our \tt{3:2} generator. This would build a scale that includes more and more notes, but in addition to requiring some a physically unwieldy keyboards, our scales are already getting diminishing returns from including these new notes: our goal was to choose a set of notes that sounded good together. Already, we've confused would-be composers to including two very-nearly-the-same notes when all the other notes are nicely distinct, and that new root isn't going to sound nearly as nice when played with some of the notes we generated earlier. Anyway, since we our new note is \em{almost} just the original root note, we could just leave it off, stop the scale with only twelve notes. Sure, that means that one of our intervals is gonna be a \em{teeny} bit less consonant than the others, but most of them sound great, right?
142
143 As it turns out, that's exactly what Western music did for about two thousand years.
144
145 \h1{What Are The Problems with Pythagorean Tuning?}
146
147 The tuning I've described here was originally described by Pythagoras\ref{pyth}
148 \sidenote{Surprising, I know.}
149 in the 6th century BCE, and was historically quite popular in Western music up until about the 16th century. It has a nice basis in mathematics, and features the \tt{2:3} ratio throughout, which means it has a lot of nice consonances between its various notes. However, the West has stopped using this tuning nearly as much as it once did. What are the problems with it? Why would we want something else?
150
151 Well, for one, there are a lot of ratios other than \tt{2:3} that \em{also} sound nice: for example, the \tt{4:5} ratio, being small and simple, is also a consonant interval. If we apply that ratio to our root note from before of 400 Hz, then we get \\(400 * \\frac\{5\}\{4\} = 500\\). This frequency isn't in the scale we created. The closest we have is 506.25 Hz, which corresponds a ratio of \tt{81:64}—close, but not really as pleasant as a real \tt{4:5} ratio. Take a listen: the following clip alternates back and forth between a perfect \tt{3:4} interval and the less-pleasing \tt{81:64} interval we get from Pythagorean tuning:
152
153 \audio{static/tuning/ditone.mp3}
154
155 That meant that music composed with Pythagorean tuning in mind tended to avoid that interval—what we now call a \em{major third}—because it just didn't sound as nice as it does in other tuning systems.
156
157 Another big problem was \em{the wolf}, which is a wonderfully evocative name for a musical phenomenon. In Pythagorean tuning, once we've arranged every tone in ascending order of frequency, the fifth—that is, the tone that's related to the root tone by the \tt{2:3} ratio—is seven steps up from the root, as you can see here:
158
159 \svgimg{static/tuning/fifth.svg}
160
161 If we move our focus to the next note up from each of those—the second and the eight frequency in our list, respectively—we discover that they are \em{also} related to each other by the \tt{2:3} ratio! If we look at every note and its partner seven steps above it—looping around when necessary—we find that each of those pairs is related to each by a simple, pleasing ratio, either \tt{2:3} or \tt{3:4}. …well, all of those pairs them except one.
162
163 \table{
164 \tr{ \th {Tone\sub{i}} \th {Tone\sub{i+7}} \th {Ratio} }
165 \tr{ \td {400.00 Hz} \td {600.00 Hz} \td {1.500}}
166 \tr{ \td {427.15 Hz} \td {640.72 Hz} \td {1.500}}
167 \tr{ \td {450.00 Hz} \td {675.00 Hz} \td {1.500}}
168 \tr{ \td {480.54 Hz} \td {720.81 Hz} \td {1.500}}
169 \tr{ \td {506.25 Hz} \td {759.38 Hz} \td {1.500}}
170 \tr{ \td {540.61 Hz} \td {400.00 Hz} \td {\red{1.352}}}
171 \tr{ \td {569.53 Hz} \td {427.15 Hz} \td {1.333}}
172 \tr{ \td {600.00 Hz} \td {450.00 Hz} \td {1.333}}
173 \tr{ \td {640.72 Hz} \td {480.54 Hz} \td {1.333}}
174 \tr{ \td {675.00 Hz} \td {506.25 Hz} \td {1.333}}
175 \tr{ \td {720.81 Hz} \td {540.61 Hz} \td {1.333}}
176 \tr{ \td {759.38 Hz} \td {569.53 Hz} \td {1.333}}
177 }
178
179 There's an odd one out in this tuning, and it's because of the Pythagorean comma: a perfect fifth up from 540.61 Hz is 810.92 Hz, but that frequency corresponds to the not-quite-the-root note that we chose to omit from our scale. Instead, we kept the \em{actual} root, 400 Hz (or the corresponding note an octave higher, at 800 Hz) which, when taken with 540.61 Hz, produces an interval that doesn't really sound like a fifth, and instead produces a kind of dissonant "beating" when you listen to it.
180
181 This interval was said to "howl" when played, so it was avoided by composers, who referred to it as \em{the wolf}. It's also sometimes called a \em{Procrustean fifth}, because of the way \link{https://en.wikipedia.org/wiki/Procrustes|it doesn't really fit}. Similar not-quite-right intervals will arise in other alternate tuning systems, so the phrase \em{wolf interval} also refers to any these kinds of intervals in other systems. When Pythagorean tuning was in widespread use, composers had to be aware of wolf intervals when composing, and would write compositions that didn't ever use that particular interval.
182
183 Here is a sound clip which first plays a 540.61 Hz tone paired with a perfect fifth (at 810.92 Hz), and then plays the same tone paired with 800 Hz, which is the interval referred to as "the wolf".
184
185 \audio{static/tuning/wolf.mp3}
186
187 What else could we do if we wanted to build a musical system that didn't have problems like the wolf? In the sixteenth and seventeenth centuries, Western music in general moved to a different system called \em{quarter-comma meantone}—which was a different tuning system that actually had an even more acute wolf interval\ref{wlf}—but \sidenote{In Pythagorean tuning, the wolf interval is about 23 cents flat, while in quarter-comma meantone, it's 35 cents sharp.} I'm going to skip over that one as well as a handful of other systems, and move straight to the system we picked up in the 19th century without looking back: \em{equal temperament}\ref{edo}.
188 \sidenote{
189 This is also sometimes more specifically called \em{12-TET}, for '12-Tone Equal Temperament', or \em{12-EDO}, for '12 Equal Divions of the Octave'.
190 }
191
192 \h1{Equal Temperament}
193
194 Let's look again at the chart that shows the frequencies of a Pythagorean tuning, as well as how many cents each one is from the root:
195
196 \table{
197 \tr{ \th{ frequency } \th{ cents } }
198 \tr{\td{400.00 Hz} \td{0.00 cents}}
199 \tr{\td{427.14 Hz} \td{113.68 cents}}
200 \tr{\td{450.00 Hz} \td{203.91 cents}}
201 \tr{\td{480.54 Hz} \td{317.59 cents}}
202 \tr{\td{506.25 Hz} \td{407.82 cents}}
203 \tr{\td{540.60 Hz} \td{521.50 cents}}
204 \tr{\td{569.53 Hz} \td{611.73 cents}}
205 \tr{\td{600.00 Hz} \td{701.95 cents}}
206 \tr{\td{640.72 Hz} \td{815.64 cents}}
207 \tr{\td{675.00 Hz} \td{905.86 cents}}
208 \tr{\td{720.81 Hz} \td{1019.55 cents}}
209 \tr{\td{759.37 Hz} \td{1109.77 cents}}
210 }
211
212 Notice how the stride between each pair of adjacent tones is roughly similar, but with some bit of wiggle room. Let's look at the sizes of the gaps between each adjacent pair of frequencies, calculated in cents:
213
214 \table{
215 \tr{ \th{ frequency } \th{ cents } \th { change in cents } }
216 \tr{ \td{400.00 Hz} \td{0.00 cents} \td{+90.23 cents} }
217 \tr{ \td{427.14 Hz} \td{113.68 cents} \td{+113.68 cents} }
218 \tr{ \td{450.00 Hz} \td{203.91 cents} \td{+90.22 cents} }
219 \tr{ \td{480.54 Hz} \td{317.59 cents} \td{+113.68 cents } }
220 \tr{ \td{506.25 Hz} \td{407.82 cents} \td{+90.22 cents } }
221 \tr{ \td{540.60 Hz} \td{521.50 cents} \td{+113.68 cents } }
222 \tr{ \td{569.53 Hz} \td{611.73 cents} \td{+90.22 cents } }
223 \tr{ \td{600.00 Hz} \td{701.95 cents} \td{+90.22 cents } }
224 \tr{ \td{640.72 Hz} \td{815.64 cents} \td{+113.68 cents } }
225 \tr{ \td{675.00 Hz} \td{905.86 cents} \td{+90.22 cents } }
226 \tr{ \td{720.81 Hz} \td{1019.55 cents} \td{+113.68 cents } }
227 \tr{ \td{759.37 Hz} \td{1109.77 cents} \td{+90.22 cents } }
228 }
229
230 We can see that every note is either 90 or 113 cents above the previous note. This hints at one approach we can take to avoid dissonant intervals like the wolf: given that they're all more or less similar already, we could just fudge all the intervals so they're all exactly equal. That means each interval might not sound \em{quite} perfect—no two of them will be related by a perfect simple ratio—but to most untrained ears, they'll be close enough. Now, instead of doing some elaborate set of frequency multiplications to choose our notes as in Pythagorean tuning, we just split the octave into twelve equal steps of 100 cents each, and convert those back to get our frequencies:
231
232 \table{
233 \tr{ \th{ frequency } \th{ cents } \th { change in cents } }
234 \tr{ \td{ 400.00 Hz } \td{ 0.00 cents } \td{ } }
235 \tr{ \td{ 423.78 Hz } \td{ 100.00 cents } \td{ +100 cents } }
236 \tr{ \td{ 448.98 Hz } \td{ 200.00 cents } \td{ +100 cents } }
237 \tr{ \td{ 475.68 Hz } \td{ 300.00 cents } \td{ +100 cents } }
238 \tr{ \td{ 503.96 Hz } \td{ 400.00 cents } \td{ +100 cents } }
239 \tr{ \td{ 533.93 Hz } \td{ 500.00 cents } \td{ +100 cents } }
240 \tr{ \td{ 565.68 Hz } \td{ 600.00 cents } \td{ +100 cents } }
241 \tr{ \td{ 599.32 Hz } \td{ 700.00 cents } \td{ +100 cents } }
242 \tr{ \td{ 634.96 Hz } \td{ 800.00 cents } \td{ +100 cents } }
243 \tr{ \td{ 672.71 Hz } \td{ 900.00 cents } \td{ +100 cents } }
244 \tr{ \td{ 712.71 Hz } \td{ 1000.00 cents } \td{ +100 cents } }
245 \tr{ \td{ 755.09 Hz } \td{ 1100.00 cents } \td{ +100 cents } }
246 }
247
248 It turns out that this is, broadly speaking, a pretty good approximation! We're within \em{two cents} of a perfect fifth, and most of the other ratios are at least workable. Because our "fifths" are ever-so-slightly less than a perfect \tt{2:1} ratio, we can loop around and get back to \em{exactly} the root note, and consequently our wolf intervals disappear, as well.
249
250 Of course, we did this by fudging things, so none of these ratios are going to sound \em{exactly} as nice. We still don't approximate the \tt{5:4} ratio very well—we're about fourteen cents too high—but again, an untrained ear probably won't really notice. And it turns out that we do approximate a perfect fifth to within two cents, which is a pretty good approximation!
251
252 It's a pretty convenient system, and it's in pretty wide use today: at the very least, it's how a lot of people think about tuning. In practice, a number of instruments can't use equal temperament \em{exactly} because of physical limitations on the instrument itself, and singers tend to use something closer to the Pythagorean tuning (because it's easier to make your voice go up a perfect fifth than an ever-so-slightly-imperfect fifth) but we tend to treat equal temperament as the ideal tuning for most modern instruments.
253
254 I have more things to say, but this post is already a bit long, so I'm going to split the rest of this material into a separate post. Next time: \em{microtonal music}!
1 \meta{("pythagorean-tuning-and-equal-temperament"
2 "pythagorean tuning and equal temperament"
3 ("music") 1476776339)}
4
5 There was a recent blog post by \link{https://eev.ee/|Eevee} called \link{https://eev.ee/blog/2016/09/15/music-theory-for-nerds/|Music Theory For Nerds}, which is an excellent whirlwind introduction to a vast swath of music theory. It's very good, and you should go read it.
6
7 When I first read it, it reminded me that one topic I've wanted to write about on this blog was microtonal music. As it turns out, writing about the motivation and theory behind microtonal music involves delving into some of the more esoteric foundations of Western music, to the degree that this post doesn't even get to microtonal tunings. Eevee at one point remarks, on the topic of our twelve-note octave:
8
9 \blockquote{
10 I don’t know why twelve in particular has this effect, or if other roots do as well, but it’s probably why Western music settled on twelve.
11 }
12
13 This blog post is a post about how we settled on twelve.
14
15 \h1{Consonance and Dissonance}
16
17 It helps us to think of sounds as \em{waves}, which correspond to the vibrations sound-carrying materials like air. For demonstration here, I'll be using basic \em{sine waves}, which sound like this:
18
19 \audio{/static/tuning/sinewave.mp3}
20
21 We can visualize a sine wave as looking more or less\ref{ink} like this:
22 \sidenote{I drew this in Inkscape and not a graphing tool, so it's not totally accurate, but it doesn't need to be a perfect sine wave to be an okay teaching tool.}
23
24 \img{/static/tuning/sin.svg}
25
26 When we talk about the \em{frequency} of this sound, we're talking about the time between peaks in the wave. Frequency is measured in \em{hertz} (abbreviated as \em{Hz}),
27 which in this context just means "peaks of the wave per second".\ref{hertz}
28 \sidenote{It's also my least favorite kind of donut.}
29 Two sounds that have the same number of peaks per second are perceived by human being as being the same sound.
30
31 Additionally, sounds whose frequencies are simple ratios are perceived as somehow "pleasing", while sounds whose frequencies are related by more complicated ratios are perceived as "less pleasing". For example, this will play two frequencies in sequence and then together, one at 300 Hz, and one at 600 Hz, which are related by a \tt{2:1} ratio. The two sounds will sound appropriate to one another:
32
33 \audio{/static/tuning/consonant.mp3}
34
35 In comparison, a less simple ratio—here, 300 Hz and 573 Hz, related by a \tt{100:191} ratio—will sound somewhat less pleasant when played together:
36
37 \audio{/static/tuning/dissonant.mp3}
38
39 In music and music theory, sounds which "go together" are said to be \em{consonant} and sounds which "don't go together" are called \em{dissonant}. There isn't a strictly-defined separation between the two: some pairs of sounds are clearly consonant (such as the \tt{2:1} ratio) and some are clearly dissonant, but there is no well-defined cutoff point where sounds stop being consonant and start being dissonant. It's best to think of them as relative to one another: a pair of sounds can be \em{more consonant} or \em{more dissonant} than another pair, rather than being \em{consonant} or \em{dissonant} on an absolute scale.\ref{condis} \sidenote{Also note that the terms \em{consonant} and \em{dissonant} are old, and have been informally and sometimes contradictorily defined for centuries: some people define them in terms of frequencies, some in terms of perception, some in terms of both. Defining them as \em{pleasant} and \em{unpleasant} is reductive, but not necessarily a bad intuition.}
40
41 \h1{Picking Points in Sound-Space}
42
43 When we write music, we generally want to put pleasant sounds together, which suggests that we'd like to take the space of all possible sounds—many of which are not going to sound pleasant together at all—and carve it up so that we can have a nice grab-bag of consonant frequencies to work with while omitting dissonant ones. Let's start in a very simple way: we know that intervals composed of simple ratios of frequences are consonant, so let's start with two of the simplest possible ratios—the \tt{2:1} ratio and the \tt{3:2} ratio—and use them to build up a set of "compatible" sounds, a bunch of sounds we can pull from that are guaranteed to have some consonant neighbors in the same set.
44
45 Let's start with 400 Hz as our first tone:
46
47 \svgimg{/static/tuning/s1.svg}
48
49 Let's stipulate that every frequency which can be generated from 400 Hz using the \tt{2:1} ratio—that is, frequencies like 100 Hz, 200 Hz, 800 Hz, 1600 Hz—are also included, because all of those frequencies are always going to be consonant with each other. Whenever we add a new frequency \\(f\\) to our scale, we are also going to add \\(2^n \\times f\\) for every integer \\(n\\).
50
51 \svgimg{/static/tuning/s1-5.svg}
52
53 Now, let's generate another sound using by the \tt{3:2} ratio. \\(400 \\times \\frac\{3\}\{2\}\\) produces \\(600\\). So, let's add 600 Hz (again including every frequency of the form \\(2^n \\times 600\\), outside the range of our graphic.)
54
55 \svgimg{/static/tuning/s2.svg}
56
57 Next, \\(600 \\times \\frac\{3\}\{2\}\\) produces \\(900\\). That's outside the range I've chosen to display here: but, like before, we're going to be including not just 900 Hz, but also all the doubled and halved frequencies we can reach from 900 Hz, and one of those—450 Hz—is within the range of our graphic. Luckily, no matter which new tone we choose add, we're going to also be adding one corresponding tone in the 400 Hz to 800 Hz range, so whenever the new tone generated by application of the \tt{3:2} ratio is outside this range, I'll go ahead and halve it, so every new set of frequencies we generate will be in this range.
58
59 \svgimg{/static/tuning/s3.svg}
60
61 Okay, let's keep going: \\(450 \\times \\frac\{3\}\{2\}\\) is 675:
62
63 \svgimg{/static/tuning/s4.svg}
64
65 You know the drill now, so I'm just going to list a bunch more:
66 \ul{
67 \li{ \\(675.00 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} = 506.25\\) }
68 \li{ \\(506.25 \\times \\frac\{3\}\{2\}\\ \\ \\ \\ \\ \\ \\ \\ \\approx 759.37\\) }
69 \li{ \\(759.37 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 569.53\\) }
70 \li{ \\(569.53 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 427.14\\) }
71 \li{ \\(427.14 \\times \\frac\{3\}\{2\}\\ \\ \\ \\ \\ \\ \\ \\ \\approx 640.72\\) }
72 \li{ \\(640.72 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 480.54\\) }
73 \li{ \\(480.54 \\times \\frac\{3\}\{2\}\\ \\ \\ \\ \\ \\ \\ \\ \\approx 720.81\\) }
74 \li{ \\(720.81 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 540.61\\) }
75 }
76
77 I'm going to stop there—I'll explain why in a moment—but here's what
78 all the tones we've created so far look like:
79
80 \img{/static/tuning/all.svg}
81
82 If you play them in the order we created them, they sound like this:
83
84 \audio{/static/tuning/circle.mp3}
85
86 If you play them from left to right, they sound like this:
87
88 \audio{/static/tuning/scale.mp3}
89
90 These tones might seem familiar if you've played on (or with) a piano before: we've recreated the tones on a piano keyboard! …or, well, we've gotten \em{very close}.
91
92 \h1{Pythagorean Comma}
93
94 I've been avoiding lumping in too much new jargon, but I might as well do a few reveals: the set of notes I've been building up is generally called \em{Pythagorean Tuning}; an interval with a \tt{2:1} ratio is called an \em{octave}; an interval with a \tt{3:2} ratio is generally called a \em{perfect fifth}, due to a note-numbering system I'm going to gloss over here.
95
96 You'll recall I stopped generating notes after we accumulated twelve of them. We could try to keep going, but something funny thing happens after we add the next note, which is that we get \em{almost but not quite} back to where we started: \\(540.61 \\times \\frac\{3\}\{2\} \\times \\frac\{1\}\{2\} \\approx 405.45\\).
97
98 \svgimg{/static/tuning/wolf.svg}
99
100 If you play 405.45 Hz and 400 Hz together, they sound close but not \em{quite} the same. They're certainly a lot closer together than any other pair of notes we've produced so far! If you play them next to each other, you can barely hear the difference:
101
102 \audio{/static/tuning/almost.mp3}
103
104 It turns out that if you keep using the \tt{3:2} ratio to generate tones, you'll never \em{exactly} get back to where you started: instead, you'll start generating tones that differ just slightly from the ones you already generated. You can keep going, and you'll keep generating more frequencies that will all be slightly different than the ones you generated before, and get back to yet another note that's a bit above 405.45 Hz, and so forth. The closest we'll get to the original 400 Hz will be after we've applied the \tt{3:2} ratio \em{53 times}, but even then, we're not going to hit 400 Hz exactly.
105
106 The difference between that original root frequency (400 Hz) and the almost-but-not-quite-the-root frequency (405.45 Hz) is referred to as \em{Pythagorean comma}\ref{comma}.
107 \sidenote{The word \em{comma} derives from a Greek word for 'cutting': in typography, it originally referred to the part of the sentence after a punctuation mark, which was 'cut off' from the beginning of the sentence, and gradually came to signify the mark itself. In this musical sense, it was originally used because the Pythagorean comma is a 'cut-off portion' of the musical scale.}
108 It's not really very useful to measure Pythagorean comma in hertz, because the difference between the root value and the not-quite-the-root value depends on which frequency we choose as the root, i.e. if we were working in the range of 300 Hz to 600 Hz, then it would be smaller (the difference between 304.09 Hz and 300 Hz), but if we were working in the range of 500 Hz to 1000 Hz, then it would be larger (the difference between 506.82 Hz and 500 Hz.) So let's move away from hertz and start using a different unit of measurement, one where we cancel out the logarithmic nature of frequencies: the \em{cent}.
109
110 The cent is a unit defined in terms of ratios of frequencies, so that the space of an octave—that is, a frequency and its double or half—is always expressed as exactly 1200 cents. Cents turn out to be wonderful for expressing tunings. I'm going to gloss over the conversion formulae between frequencies and cents—you can find them \link{https://en.wikipedia.org/wiki/Cent_(music)#Use|on Wikipedia, of course}—and convert all the frequencies we've generated into cents. I'll include the not-quite-the-root frequency at the end of the table:
111
112 \table{
113 \tr{ \th{ frequency } \th{ cents } }
114 \tr{\td{400.00 Hz} \td{0.00 cents}}
115 \tr{\td{427.14 Hz} \td{113.68 cents}}
116 \tr{\td{450.00 Hz} \td{203.91 cents}}
117 \tr{\td{480.54 Hz} \td{317.59 cents}}
118 \tr{\td{506.25 Hz} \td{407.82 cents}}
119 \tr{\td{540.60 Hz} \td{521.50 cents}}
120 \tr{\td{569.53 Hz} \td{611.73 cents}}
121 \tr{\td{600.00 Hz} \td{701.95 cents}}
122 \tr{\td{640.72 Hz} \td{815.64 cents}}
123 \tr{\td{675.00 Hz} \td{905.86 cents}}
124 \tr{\td{720.81 Hz} \td{1019.55 cents}}
125 \tr{\td{759.37 Hz} \td{1109.77 cents}}
126 \tr{\td{\red{405.45 Hz}} \td{\red{23.46 cents}} }
127 }
128
129
130 Okay, now we have a value for Pythagorean comma: it will always be approximately 23.46 cents, regardless of which base frequency we choose to work with.\ref{pycom}
131 \sidenote{Cents are a more convenient way of expressing ratios of frequencies, but if we wanted to express Pythagorean comma as a ratio, it would be \tt{531441:524288}.}
132
133 Now, let's also try graphing all our cent amounts, including the close-to-the-root note. We end up with something that looks like this:
134
135 \svgimg{/static/tuning/cents.svg}
136
137 See those two dots near each other, all the way on the left? The difference between them is what we mean by \em{Pythagorean comma}.
138
139 As an interesting aside: the existence of Pythagorean comma is also the reason for one of the odd vestigial features of musical notation: namely, the existence of \em{enharmonically equivalent notes}. When learning modern music notation, you quickly learn that there are some odd redundancies in staff notation, including the fact that some notes can be expressed more than one way: for example, A♭ and G♯ are two ways of writing the same note. That's true with modern tunings and notation, but one reason for having both notations is that they \em{did} used to connote different notes in tunings like the Pythagorean tuning: if we use A♭ as our root note, then we'd write our close-to-the-root-but-not-quite note as G♯, and the two would differ from each other by the Pythagorean comma. This distinction is no longer made, but we're still stuck with the notation.
140
141 Back to the scale we're generating, where we have have to decide what to do with the not-quite-the-root note: we could include our it in the scale we're creating, and maybe even continue generating new frequencies from our \tt{3:2} generator. This would build a scale that includes more and more notes, but in addition to requiring some a physically unwieldy keyboards, our scales are already getting diminishing returns from including these new notes: our goal was to choose a set of notes that sounded good together. Already, we've confused would-be composers to including two very-nearly-the-same notes when all the other notes are nicely distinct, and that new root isn't going to sound nearly as nice when played with some of the notes we generated earlier. Anyway, since we our new note is \em{almost} just the original root note, we could just leave it off, stop the scale with only twelve notes. Sure, that means that one of our intervals is gonna be a \em{teeny} bit less consonant than the others, but most of them sound great, right?
142
143 As it turns out, that's exactly what Western music did for about two thousand years.
144
145 \h1{What Are The Problems with Pythagorean Tuning?}
146
147 The tuning I've described here was originally described by Pythagoras\ref{pyth}
148 \sidenote{Surprising, I know.}
149 in the 6th century BCE, and was historically quite popular in Western music up until about the 16th century. It has a nice basis in mathematics, and features the \tt{2:3} ratio throughout, which means it has a lot of nice consonances between its various notes. However, the West has stopped using this tuning nearly as much as it once did. What are the problems with it? Why would we want something else?
150
151 Well, for one, there are a lot of ratios other than \tt{2:3} that \em{also} sound nice: for example, the \tt{4:5} ratio, being small and simple, is also a consonant interval. If we apply that ratio to our root note from before of 400 Hz, then we get \\(400 * \\frac\{5\}\{4\} = 500\\). This frequency isn't in the scale we created. The closest we have is 506.25 Hz, which corresponds a ratio of \tt{81:64}—close, but not really as pleasant as a real \tt{4:5} ratio. Take a listen: the following clip alternates back and forth between a perfect \tt{3:4} interval and the less-pleasing \tt{81:64} interval we get from Pythagorean tuning:
152
153 \audio{/static/tuning/ditone.mp3}
154
155 That meant that music composed with Pythagorean tuning in mind tended to avoid that interval—what we now call a \em{major third}—because it just didn't sound as nice as it does in other tuning systems.
156
157 Another big problem was \em{the wolf}, which is a wonderfully evocative name for a musical phenomenon. In Pythagorean tuning, once we've arranged every tone in ascending order of frequency, the fifth—that is, the tone that's related to the root tone by the \tt{2:3} ratio—is seven steps up from the root, as you can see here:
158
159 \svgimg{/static/tuning/fifth.svg}
160
161 If we move our focus to the next note up from each of those—the second and the eight frequency in our list, respectively—we discover that they are \em{also} related to each other by the \tt{2:3} ratio! If we look at every note and its partner seven steps above it—looping around when necessary—we find that each of those pairs is related to each by a simple, pleasing ratio, either \tt{2:3} or \tt{3:4}. …well, all of those pairs them except one.
162
163 \table{
164 \tr{ \th {Tone\sub{i}} \th {Tone\sub{i+7}} \th {Ratio} }
165 \tr{ \td {400.00 Hz} \td {600.00 Hz} \td {1.500}}
166 \tr{ \td {427.15 Hz} \td {640.72 Hz} \td {1.500}}
167 \tr{ \td {450.00 Hz} \td {675.00 Hz} \td {1.500}}
168 \tr{ \td {480.54 Hz} \td {720.81 Hz} \td {1.500}}
169 \tr{ \td {506.25 Hz} \td {759.38 Hz} \td {1.500}}
170 \tr{ \td {540.61 Hz} \td {400.00 Hz} \td {\red{1.352}}}
171 \tr{ \td {569.53 Hz} \td {427.15 Hz} \td {1.333}}
172 \tr{ \td {600.00 Hz} \td {450.00 Hz} \td {1.333}}
173 \tr{ \td {640.72 Hz} \td {480.54 Hz} \td {1.333}}
174 \tr{ \td {675.00 Hz} \td {506.25 Hz} \td {1.333}}
175 \tr{ \td {720.81 Hz} \td {540.61 Hz} \td {1.333}}
176 \tr{ \td {759.38 Hz} \td {569.53 Hz} \td {1.333}}
177 }
178
179 There's an odd one out in this tuning, and it's because of the Pythagorean comma: a perfect fifth up from 540.61 Hz is 810.92 Hz, but that frequency corresponds to the not-quite-the-root note that we chose to omit from our scale. Instead, we kept the \em{actual} root, 400 Hz (or the corresponding note an octave higher, at 800 Hz) which, when taken with 540.61 Hz, produces an interval that doesn't really sound like a fifth, and instead produces a kind of dissonant "beating" when you listen to it.
180
181 This interval was said to "howl" when played, so it was avoided by composers, who referred to it as \em{the wolf}. It's also sometimes called a \em{Procrustean fifth}, because of the way \link{https://en.wikipedia.org/wiki/Procrustes|it doesn't really fit}. Similar not-quite-right intervals will arise in other alternate tuning systems, so the phrase \em{wolf interval} also refers to any these kinds of intervals in other systems. When Pythagorean tuning was in widespread use, composers had to be aware of wolf intervals when composing, and would write compositions that didn't ever use that particular interval.
182
183 Here is a sound clip which first plays a 540.61 Hz tone paired with a perfect fifth (at 810.92 Hz), and then plays the same tone paired with 800 Hz, which is the interval referred to as "the wolf".
184
185 \audio{/static/tuning/wolf.mp3}
186
187 What else could we do if we wanted to build a musical system that didn't have problems like the wolf? In the sixteenth and seventeenth centuries, Western music in general moved to a different system called \em{quarter-comma meantone}—which was a different tuning system that actually had an even more acute wolf interval\ref{wlf}—but \sidenote{In Pythagorean tuning, the wolf interval is about 23 cents flat, while in quarter-comma meantone, it's 35 cents sharp.} I'm going to skip over that one as well as a handful of other systems, and move straight to the system we picked up in the 19th century without looking back: \em{equal temperament}\ref{edo}.
188 \sidenote{
189 This is also sometimes more specifically called \em{12-TET}, for '12-Tone Equal Temperament', or \em{12-EDO}, for '12 Equal Divions of the Octave'.
190 }
191
192 \h1{Equal Temperament}
193
194 Let's look again at the chart that shows the frequencies of a Pythagorean tuning, as well as how many cents each one is from the root:
195
196 \table{
197 \tr{ \th{ frequency } \th{ cents } }
198 \tr{\td{400.00 Hz} \td{0.00 cents}}
199 \tr{\td{427.14 Hz} \td{113.68 cents}}
200 \tr{\td{450.00 Hz} \td{203.91 cents}}
201 \tr{\td{480.54 Hz} \td{317.59 cents}}
202 \tr{\td{506.25 Hz} \td{407.82 cents}}
203 \tr{\td{540.60 Hz} \td{521.50 cents}}
204 \tr{\td{569.53 Hz} \td{611.73 cents}}
205 \tr{\td{600.00 Hz} \td{701.95 cents}}
206 \tr{\td{640.72 Hz} \td{815.64 cents}}
207 \tr{\td{675.00 Hz} \td{905.86 cents}}
208 \tr{\td{720.81 Hz} \td{1019.55 cents}}
209 \tr{\td{759.37 Hz} \td{1109.77 cents}}
210 }
211
212 Notice how the stride between each pair of adjacent tones is roughly similar, but with some bit of wiggle room. Let's look at the sizes of the gaps between each adjacent pair of frequencies, calculated in cents:
213
214 \table{
215 \tr{ \th{ frequency } \th{ cents } \th { change in cents } }
216 \tr{ \td{400.00 Hz} \td{0.00 cents} \td{+90.23 cents} }
217 \tr{ \td{427.14 Hz} \td{113.68 cents} \td{+113.68 cents} }
218 \tr{ \td{450.00 Hz} \td{203.91 cents} \td{+90.22 cents} }
219 \tr{ \td{480.54 Hz} \td{317.59 cents} \td{+113.68 cents } }
220 \tr{ \td{506.25 Hz} \td{407.82 cents} \td{+90.22 cents } }
221 \tr{ \td{540.60 Hz} \td{521.50 cents} \td{+113.68 cents } }
222 \tr{ \td{569.53 Hz} \td{611.73 cents} \td{+90.22 cents } }
223 \tr{ \td{600.00 Hz} \td{701.95 cents} \td{+90.22 cents } }
224 \tr{ \td{640.72 Hz} \td{815.64 cents} \td{+113.68 cents } }
225 \tr{ \td{675.00 Hz} \td{905.86 cents} \td{+90.22 cents } }
226 \tr{ \td{720.81 Hz} \td{1019.55 cents} \td{+113.68 cents } }
227 \tr{ \td{759.37 Hz} \td{1109.77 cents} \td{+90.22 cents } }
228 }
229
230 We can see that every note is either 90 or 113 cents above the previous note. This hints at one approach we can take to avoid dissonant intervals like the wolf: given that they're all more or less similar already, we could just fudge all the intervals so they're all exactly equal. That means each interval might not sound \em{quite} perfect—no two of them will be related by a perfect simple ratio—but to most untrained ears, they'll be close enough. Now, instead of doing some elaborate set of frequency multiplications to choose our notes as in Pythagorean tuning, we just split the octave into twelve equal steps of 100 cents each, and convert those back to get our frequencies:
231
232 \table{
233 \tr{ \th{ frequency } \th{ cents } \th { change in cents } }
234 \tr{ \td{ 400.00 Hz } \td{ 0.00 cents } \td{ } }
235 \tr{ \td{ 423.78 Hz } \td{ 100.00 cents } \td{ +100 cents } }
236 \tr{ \td{ 448.98 Hz } \td{ 200.00 cents } \td{ +100 cents } }
237 \tr{ \td{ 475.68 Hz } \td{ 300.00 cents } \td{ +100 cents } }
238 \tr{ \td{ 503.96 Hz } \td{ 400.00 cents } \td{ +100 cents } }
239 \tr{ \td{ 533.93 Hz } \td{ 500.00 cents } \td{ +100 cents } }
240 \tr{ \td{ 565.68 Hz } \td{ 600.00 cents } \td{ +100 cents } }
241 \tr{ \td{ 599.32 Hz } \td{ 700.00 cents } \td{ +100 cents } }
242 \tr{ \td{ 634.96 Hz } \td{ 800.00 cents } \td{ +100 cents } }
243 \tr{ \td{ 672.71 Hz } \td{ 900.00 cents } \td{ +100 cents } }
244 \tr{ \td{ 712.71 Hz } \td{ 1000.00 cents } \td{ +100 cents } }
245 \tr{ \td{ 755.09 Hz } \td{ 1100.00 cents } \td{ +100 cents } }
246 }
247
248 It turns out that this is, broadly speaking, a pretty good approximation! We're within \em{two cents} of a perfect fifth, and most of the other ratios are at least workable. Because our "fifths" are ever-so-slightly less than a perfect \tt{2:1} ratio, we can loop around and get back to \em{exactly} the root note, and consequently our wolf intervals disappear, as well.
249
250 Of course, we did this by fudging things, so none of these ratios are going to sound \em{exactly} as nice. We still don't approximate the \tt{5:4} ratio very well—we're about fourteen cents too high—but again, an untrained ear probably won't really notice. And it turns out that we do approximate a perfect fifth to within two cents, which is a pretty good approximation!
251
252 It's a pretty convenient system, and it's in pretty wide use today: at the very least, it's how a lot of people think about tuning. In practice, a number of instruments can't use equal temperament \em{exactly} because of physical limitations on the instrument itself, and singers tend to use something closer to the Pythagorean tuning (because it's easier to make your voice go up a perfect fifth than an ever-so-slightly-imperfect fifth) but we tend to treat equal temperament as the ideal tuning for most modern instruments.
253
254 I have more things to say, but this post is already a bit long, so I'm going to split the rest of this material into a separate post. Next time: \em{microtonal music}!