-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path19-notes.html
221 lines (208 loc) · 10.8 KB
/
19-notes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="https://hardmath123.github.io/19-notes.html"/>
<link rel="stylesheet" type="text/css" href="/static/base.css"/>
<title>Nineteen - Comfortably Numbered</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="alternate" type="application/rss+xml" title="Comfortably Numbered" href="/feed.xml" />
<!--
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$']]}
});
</script>
-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-YNHdsYkH6gMx9y3mRkmcJ2mFUjTd0qNQQvY9VYZgQd7DcN7env35GzlmFaZ23JGp" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
// customised options
// • auto-render specific keys, e.g.:
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\begin{align}', right: '\\end{align}', display: true},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
// • rendering keys, e.g.:
throwOnError : false
});
});
</script>
</head>
<body>
<header id="header">
<script src="static/main.js"></script>
<div>
<a href="/"><span class="left-word">Comfortably</span> <span class="right-word">Numbered</span></a>
</div>
</header>
<article id="postcontent" class="centered">
<section>
<h1>Nineteen</h1>
<center><em><p>Explaining xenotonality with number-theoretic music theory</p>
</em></center>
<h4>Friday, October 21, 2016 · 4 min read</h4>
<p>I’m taking AP Music Theory this year, and I’ve been spending some time
exploring the number theory of music. This post is just a quick check-in on my
thoughts so far, and an explanation for why I’m trying to build a 19-note
marimba in my spare time.</p>
<hr>
<p>A piano has 12 notes between consecutive C’s: C, C#, D, D#, E, F, F#, G, G#, A,
A#, B, and C again. A good question to ask is, “why?”</p>
<p>Well, it comes down to how your ear works. There is plenty of literature on
this (I recommend <a href="https://eev.ee/blog/2016/09/15/music-theory-for-nerds/">this blog
post</a> or <a href="https://www.youtube.com/watch?v=i_0DXxNeaQ0">this
video</a>), but the main takeaway is
that for a variety of reasons related to the structure of your cochlea, your
brain likes to hear frequencies that have nice whole-number ratios. For
example, a C is 256 Hertz while a G is 384 Hertz, and 384/256 = 3/2 which is a
nice whole-number ratio. Indeed, if you play a C and a G together, it sounds
pretty good Musicians call this a “perfect fifth”, and one musician in
particular liked it so much that he built a tuning system around it.</p>
<p>Pythagoras—yes, the one with the triangle theorem—figured that using the
ratios 2:1 and 3:2, you can build a whole bunch of notes that sound good
together (it’s easy to do this kind of tuning for string instruments, because
the lengths are really easy). You do this by going up by the 3:2 ratio, and
then going down by a factor of 2 when it gets higher than 2. So, you get 1,
3/2, (9/4)/2 = 9/8, and so on. As a musician, you might recognize this as
“going up the circle of fifths”.</p>
<p>We can then ask, “will going up the circle of fifths ever get us back to our
root note?” Obviously, the answer is no: to get back to the root note you need
to get a ratio of 1 again. But, every time you multiply by 3/2 you add a power
of 3 to the numerator, which will never cancel with the denominator. That is,
we are searching for an integer solution to the equation $ (3/2)^x / 2^y = 1$
which clearly does not exist.</p>
<p>However, we can get close! Recall from <a href="a-balance-of-powers.html">A Balance of
Powers</a> that we can compute really good approximate
solutions for these equations by taking logaritms and using Diophantine
approximation techniques. The first convergent yields x=5 and y=3, which gives
us a ratio of 243/256, or around 0.95. This is pretty bad: the difference is
clearly audible (in fact, it’s approximately the difference between a C and a
C#). Nevertheless, the notes you get by this process (C, G, D, A, E) form
something very familiar: the pentatonic scale.</p>
<p>In any case: the second convergent yields x=12 and y=7, which gives us a ratio
of 531441/524288, or around 1.01. This is much better—it’s much harder to
hear the difference!</p>
<p>So, twelve fifths gets us reasonably close to the root note: and that’s where
our 12-note chromatic scale comes from.</p>
<p>Unfortunately, there were problems with this scheme. The most urgent problem
was that it lacked symmetry: you can only play in “C”. If you start a song on
“D”, everything sounds awful because the ratios don’t work the same relative to
“D”. In theory we could start all our songs on “C”, but that makes it hard for
singers with different ranges, and also prevents composers from modulating to a
different key.</p>
<p>With this issue in mind, people tried to come up with alternative tunings. One
such alternative was “well-tempering”, which is what Bach really loved. He
wrote <em>The Well-Tempered Clavier</em> to show off well-tempering: he has a prelude
and fugue in each key, and I’m told that that each piece takes advantage of the
subtle tuning tendencies of its respective key.</p>
<p>The big winner turned out to be “even tempering”. Even tempering spaces out the
12 notes of the scale evenly. Since the top note is twice the frequency of the
root note, each consecutive pair of notes in the even-tempered scale differs by
a ratio of $ 2^{(1/12)} : 1$, which is around 1.06. Crucially, the difference
between “C” and “D” is the same as that between “D” and “E”, so if you start a
song on “D” instead of “C”, everything still fits. Furthermore, even tempering
frequencies don’t stray <em>too</em> far from the Pythagorean frequencies, so
everything still sounds good! Well, except for the occasional connoisseurs who
complain that they can hear the difference.</p>
<hr>
<p>But, we have strayed from the original goal: we wanted lots of simple
whole-number ratios. Does the 12-note even tempering achieve that?</p>
<p>Well, I wrote a Python program that calculates a “pleasantness score” for each
n-note even tempering. The pleasantness score takes a set of whole-number
ratios (Pythagorean ratios, mostly), and returns the total error a tempering
achieves with respect to those whole-number ratios. Clearly, a million-note
even tempering would have a very low total error, because it is off by at most
a millionth for each ratio.</p>
<pre><code class="lang-python">>>> ratios = [3/2, 4/3, 5/3, 7/5] # for example
>>> def score(n):
>>> ... total = 0
>>> ... for r in ratios:
>>> ... total += min([(2**(1.0*i/n) - r)**2 for i in range(n)])
>>> ... return total
>>>
>>> for i in range(2, 32):
>>> ... print i, '\t', '%10.2f' % (1/score(i))
n 1/score
--------------
2 12.85
3 25.68
4 69.78
5 80.27
6 51.99
7 252.74
8 282.14
9 182.01
10 413.60
11 249.02
12 2293.78
13 267.00
14 811.75
15 1277.37
16 711.44
17 785.59
18 550.84
19 5030.16
20 1150.78
21 901.15
22 2531.40
23 1238.07
24 2293.78
25 1182.83
26 2645.21
27 6829.60
28 1274.03
29 4398.47
30 1520.35
31 14003.10
</code></pre>
<p>It turns out that for almost any set of simple ratios you pick, 12 notes has a
significantly better score than anything before it! Note that after 12, you can
do better with a 19-note scale, and even better with a 31-note scale. I do not
know why 12, 19, and 31 work out so well: but they do. 19 and 31 in particular
are very nice because they are prime. So, you can do a “circle of fifths” with
just about any ratio: a “circle of thirds”, for example. Both 19- and 31- note
even temperings were explored by Joel Mandelbaum in the 1900s (so, I’m not the
first person to have figured this out).</p>
<p>If you’re curious, you can find a piece of 19-note music, <em>Truth on a Bus</em>,
<a href="http://sethares.engr.wisc.edu/mp3s/truthonabus.html">here</a> and a piece of
31-note music, “Music fur die 31-Stufige Orgel”,
<a href="https://www.youtube.com/watch?v=23ImVLezV4c">here</a>, which is played on a
31-note Fokker organ.</p>
<p>And <em>that</em> is why we’re currently building a 19-note marimba for our jazz band.</p>
</section>
<div id="comment-breaker">◊ ◊ ◊</div>
</article>
<footer id="footer">
<div>
<ul>
<li><a href="https://github.com/kach">
Github</a></li>
<li><a href="feed.xml">
Subscribe (RSS feed)</a></li>
<li><a href="https://twitter.com/hardmath123">
Twitter</a></li>
<li><a href="https://creativecommons.org/licenses/by-nc/3.0/deed.en_US">
CC BY-NC 3.0</a></li>
</ul>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46120535-1', 'hardmath123.github.io');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
</footer>
</body>
</html>