Wednesday, May 12, 2010

The Mathematics of Music

OK, here's something I've always wondered about: why 12? That is to say, I've played music for many years now and I've never understood why, exactly, our musical scale is composed of twelve semitones. Probably my music teachers explained this to me at some point, but it must have not sunk in.

As any guitar player will tell you, the concept of an octave is intuitive and grounded in physics. An octave is what you get when you shorten the length of a plucked string by half thus doubling the frequency of the sound. But in principle you should be able to divide up the frequency space in an octave into any number of intervals, not just twelve.

(As it happens, there are two recent articles on the math of music that are worth reading: a Physics Today article about Richard Feynman's interest in piano tuning (pdf) and this one from Slate.)

The historical meaning of 12 is that the Greek philosopher Pythagoras had some strong religious beliefs about pure numbers and constructed the early version of our musical scale out of 3/2 intervals (i.e. out of the next simplest whole number fraction after the octave). As the Slate article explains, constructing a twelve-note scale out of 3/2 intervals doesn't quite bring you back round to an octave. The Pythagorean system works because the quantity (3/2)^12 * (1/2)^6 = 2.0273 is approximately equal to two -- a quantity known as the Pythagorean comma.

But this caused some problems for musicians. For example, the octave sounded perceptibly out of tune and you had to re-tune your instrument in order to play songs in different keys. So during the Renaissance, musicians came up with the concept of equal temperament, where the octave was divided into twelve logarithmically equal intervals of 2^(1/12) and each Pythagorean interval was thus re-tuned by a tiny amount. Bach was so psyched by this innovation that he went out and wrote the Well-Tempered Clavier in celebration.

So far, so good, but this still doesn't quite answer the question of why twelve? Clearly you can create equal tempered scales with any number of intervals, but is it possible to create a Pythagorean system with different numbers of intervals?

The algorithm to find out is pretty simple.
  1. Start with a base frequency of A=440 Hz.
  2. Step upwards by factors of 3/2 ... so 440, 660, 990, etc.
  3. If we go above an octave (880) then we need to divide by 2 to bring it back into the same octave range. So 990 becomes 495, and then we step upwards again by 3/2.
  4. The goal is to get as close as possible (either high or low) to 880 and then stop.
Twelve steps gets us to a frequency of 892.006 Hz, but it is easy to extend the series. Here's a plot out to N=100, with the red line representing 880 Hz.

So for most N, it is not really possible to craft a Pythagorean scale - either you don't land close enough to an octave or else you have oddly spaced intervals - but for a few N, the formula seems to work. N=5 (pentatonic scale) is not too bad and old, familiar N=12 works better.

But the winner is definitely N=53 which falls almost exactly on the red line - much more exactly than the familiar twelve tone scale. This scale, with 53 (barely distinguishable) intervals, is virtually equal tempered to begin with. Apparently this very bizarre musical system was first discovered by the Chinese mathematician Ching Fang thousands of years ago and was later rediscovered by various westerners (including Newton). And people have allegedly written music for it! Go figure.

So: a fairly interesting answer to the question posed. And if you're interested in spending time on wikipedia be warned that there are a truly ridiculous number of baroque music theory articles lurking there.

Tuesday, May 11, 2010

Disaster Capitalism

This interesting Mother Jones article takes a look at how global warming is already changing the business climate, both by pushing some businesses to the brink and by creating new opportunities for others. The author also praises the 'bracing' clarity that a bottom line tends to bring to political debates:
If a firm's bottom line is going to be affected by a changing climate—say, when its supply chains dry up because of drought, or its real estate gets swamped by sea-level rise—then it doesn't particularly matter whether or not the executives want to believe in climate change. Railing at scientists for massaging tree-ring statistics won't stop the globe from warming if the globe is actually, you know, warming.
The article focuses on three fairly intuitive examples--arctic shipping, the ski industry and disaster insurance--but it seems likely that there will be others in the future.

The obvious corollary to this is that there are big investment opportunities here for climate skeptics. I mean, if you really thought that climate change is a hoax (as does Sen. Inhofe) and that everyone else is simply over-reacting, then there is clearly a lot of money to be made selling things like beachfront property or cheap storm insurance.

Monday, May 10, 2010

Cool Logo

This graphic - apparently designed for the recent May Day immigration rights/anti-SB1070 demonstrations - is a really fantastic design. (Photo from this photoset.)
mayday09_0171

I'm not entirely sure who designed or distributed the signs, but I saw the image recently on the side of a building while driving and immediately knew what they were conveying. Tells a story, communicates a strong emotion, catches the eye -- nicely done.

Friday, May 07, 2010

Building A Better City

Spring is here in DC and the city has seen fit to build a fantastic new bike path--called the Metropolitan Branch Trail--that runs about 2 miles, virtually from our house to downtown DC. It's lined with spiffy solar-powered street lights and they have grand plans to extend it all the way from Union Station to Silver Spring. The path has made my bike commute immeasurably more pleasant, not just because the trail avoids busy streets and buses and taxis, but also because it seems to have avoided all the steep hills.

I should back up. Our current house is nestled among a clutch of modest sized hills (DC is surprisingly hilly!) meaning that any reasonable path to work inevitably involved a sweaty uphill slog. (Yes, I'm lazy. But in my defense I'm usually biking before having coffee.) I even went so far as to consult topographic maps to find some sort of minimally vertical route to work, but it turned out that the optimal path actually ran right along the train tracks that snake through Northeast DC leading into Union Station. But then, cleverly, the city decided to route the new bike trail right alongside those tracks. Nice job DC!

Bike trails are one of those things that aren't super-expensive but that you can imagine stressed-out budget cutters eying skeptically. So yay for DC deciding to invest in a small thing that makes the city better, greener, safer, healthier, friendlier. (OK, obviously I'm selfishly invested in this one, but little by little the path is getting more and more use. You can see it from the metro tracks and I bet a lot of people crushed into a 9am train are thinking about buying a bike now.)

In that same vein, I should probably say something about the new gay marriage law. DC has now joined 5 states (and one Indian tribe!) in granting marriage licenses to same-sex couples. Our church scheduled its first such ceremony for the first available Sunday after the law went into effect. The two grooms in question were both pillars of the church community who had been together for three decades, and they chose a Sunday service to make it 'official.'

Church was packed and everyone was extremely psyched for the couple -- the pastor quipped that the turnout was even higher than Easter. In addition to wedding joyfulness I also remember feeling a distinct (and quite spring/Easter-like) sense of possibility. After all the struggle and frustration and gridlock of modern life, it is in fact possible for progress to happen. Usually change is so slow that it seems like it will never happen, but then all of a sudden, it is there. We can do things.