top | item 1940474

Mathematical explanation of music and white/black notes in a piano

161 points| tpinto | 15 years ago |math.stackexchange.com | reply

30 comments

order
[+] gjm11|15 years ago|reply
The short answer is: the diatonic scale in a given key consists of notes whose frequencies are those of the keynote times certain simple rational numbers; the white notes on the piano are those that belong to the diatonic scale based on C.

What's special about those simple rational-number ratios? Answer: on most musical instruments, notes whose frequencies are in simple rational ratios sound nice together. This turns out (surprisingly, at least to me) to be a fact about the instrument and not merely about the notes; when you play a given note on a given instrument, you get (kinda) sine waves whose frequencies are those of the given note, plus some higher frequencies; exactly what the higher frequencies are and how much of each you get depends on the instrument. For most instruments, the higher frequencies are integer multiples of the fundamental frequency, and that turns out to mean that the good-sounding combinations of notes are ones with simple rational frequency ratios; but there are instruments that behave differently (e.g., a tuned circular drum; or you can make a synthesized instrument that does anything you like) and different chords will sound good on them.

For much more on this, see William Sethares's book "Tuning, Timbre, Spectrum, Scale" and his web pages at http://eceserv0.ece.wisc.edu/~sethares/ttss.html where you can find, e.g., some music in unorthodox scales performed on (synthetic) instruments designed to make the harmony sound good.

For instance: listen to http://eceserv0.ece.wisc.edu/~sethares/mp3s/tenfingersX.mp3 and hear how out-of-tune it sounds. Now try http://eceserv0.ece.wisc.edu/~sethares/mp3s/Ten_Fingers.mp3 which has exactly the same notes but played on a synthetic instrument designed to make the harmonies work.

[+] extension|15 years ago|reply
The top answer on stackexchange is a superb explanation of musical science that most of the finest musicians in history could not give you. They just don't teach you these things in music class.

Musical culture seems to resist illumination, perhaps fearing that the "magic" will somehow be broken. The irony is that music is, in a sense, a mathematical illusion, but revealing the trick only makes it more fascinating.

I will add one important point that hasn't really been made: The purpose of equal temperament may have originally been to "change keys without retuning", but it also essentially allows you to play in 12 different keys at the same time. This has been exploited to great lengths as source of musical novelty and is absolutely fundamental to modern music.

[+] russellallen|15 years ago|reply
Of course they teach those things in "music class". They teach them in music theory class at university level for a start. You're creating a strawman.

Just look at the Wikipedia entry on tuning, for example: http://en.wikipedia.org/wiki/Musical_tuning

Do you think that was all created by non-musicians while 'most of the finest musicians in history' cowered in the corner afraid of the magic being broken?

[+] seertaak|15 years ago|reply
> They just don't teach you these things in music class.

Go read "How Equal Temperament Destroyed Harmony". By a musician, for musicians. I would add there are a number of conductors and musicians that insist on playing compositions in their original tunings.

> Musical culture seems to resist illumination

And I'm sure elsewhere in cyberspace at this precise moment some musician is lamenting the ability of scientists to understand their craft. Plus ca change...

[+] alextgordon|15 years ago|reply
Musical culture seems to resist illumination, perhaps fearing that the "magic" will somehow be broken. The irony is that music is, in a sense, a mathematical illusion, but revealing the trick only makes it more fascinating.

This is true, but I think the answer is far more mundane. Musicians operate at a couple of levels of abstraction above that SO answer, so such details become irrelevant to them.

Imagine if the standard introduction to programming was a course on Java or PHP. Pretty soon you'd have a plethora of programmers who didn't know a thing about pointers or any of the old tricks programmers used to do with assembly. Wait... that's already happened :)

[+] kainhighwind|15 years ago|reply
I'm glad folks are finding this interesting. However, this is pretty much common knowledge to anyone who has taken music theory. It's usually not given a great deal of attention as most musicians using the standard 12 tone don't care much about what's going on under the hood. They're a bit like programmers who use a high level language and an IDE and don't know how a compiler or assembly works.

Just a bit funny to come across it here, it'd be a bit like finding out musicians were talking on a forum going 'wow, computer programs are written using structured text files!' or something of the like. Not trying to be rude..

[+] hasenj|15 years ago|reply
The piano to me feels like an iPhone, it does a lot of things well, and it hides many details from you. I don't know if real pianos are tunable/adjustable, but the electronic one we have at home certainly isn't (except in its ability to sounds as different instruments).

I recently bought a Oud[1], a classical stringed middle eastern instrument, it's not fretted, it's portable, and adjustable. To me, when I compare it to the piano, the Oud feels like the Unix of musical instruments. It's a bit hard to get used to at first, but it's designed to be lite-weight (portable) and adjustable, allowing power users to be very creative and expressive. Most other users will stick to a standard tuning and placement of fingers.

I'm not super-bothered by the way the piano is layed out, to me it's just a simplified instrument that works for 95% of the cases.

What I don't understand is why do all the middle eastern scales (maqam[2]) have 7 tones. The fact the western C major scale also has 7 tones is just another example of yet another scale with 7 tones (and it happens to correspond to the Ajam maqam[3]).

There are some middle eastern scales not really playable on a piano, like the Rast[4], unless the piano is somehow adjustable.

[1]: http://en.wikipedia.org/wiki/Oud

[2]: http://en.wikipedia.org/wiki/Arabic_maqam

[3]: http://en.wikipedia.org/wiki/Ajam_(maqam)

[4]: http://en.wikipedia.org/wiki/Rast_(maqam)

[+] wazoox|15 years ago|reply
> I don't know if real pianos are tunable/adjustable, but the electronic one we have at home certainly isn't (except in its ability to sounds as different instruments).

An acoustic piano cannot be easily tuned (it takes a couple of hours to a trained specialist, because there are more than 200 strings to adjust). However "serious" electronic keyboards have been fine-tunable for more than 20 years. Many of them can play any microtonal scale you may imagine, and many different classic temperaments are pre-programmed.

[+] cletus|15 years ago|reply
Years ago I watched a British documentary called Howard Goodall's Big Bangs. It's well worth watching. It explains how music theory developed from Pythagoras's (matching the 12 keys on the piano). It's an interesting exercise to "prove" these 12 steps based on this simple ratio.

What came much later was equal temperament. The 12 steps don't match up exactly. Equal temperament changes the notes slightly by changing the ratio slightly (to factors of the 12th root of 2). I believe it was Bach who first discovered this.

Not all cultures use equal temperament but it is overwhelmingly dominant in the West.

The series also explains chords, keys and so on. For someone like me who is more mathematically inclined it was fascinating. Give it a look if you can.

Oh also it wasn't the BBC as you might expect. It was Channel 4.

[+] hugh3|15 years ago|reply
I think there are different answers at different levels.

On one level, the white notes are the notes of the C major scale, and the black notes are the semitones which are left over. Why not put all the semitones in one row? That would be much harder to play. Why split it into "C major" and "leftovers"? A bunch of semi-arbitrary decisions made by early harpsichord manufacturers, I guess, which happen to make the instrument easier to play than most alternatives.

If you're looking for an explanation of why the notes of the major scale sound good together whereas most alternative modes sound weird, that's a more difficult question.

[+] nix|15 years ago|reply
Supposedly there is a mathematical reason for the 2-2-1-2-2-2-1 spacing of the major scale. If you take all possible pairs of notes in the diatonic scale, you get a richer distribution of intervals than you can produce with any other seven-note selection from the twelve note scale. Similarly, the classic pentatonic scale provides the best set of intervals for any five-note selection from the twelve. A better set of intervals might lead to a better choice of chords too.

This is my somewhat fuzzy recollection from a paper I read a long time ago. Someone out there can check with three lines of R, right?

[+] cturner|15 years ago|reply
I've recently read _How Music Works_.

  http://www.amazon.co.uk/How-Music-Works-listener%C2%92s-harmony/dp/1846143152/ref=sr_1_1?ie=UTF8&qid=1290710570&sr=8-1
Covers the physics of sound and harmonics as well. Recommend.
[+] JonnieCache|15 years ago|reply
I can highly recommend this lecture, Notes and Neurons, from the 2009 World Science Festival. It features a panel of neuroscientists discussing the possible physiological encodings of the various mathematical structures discussed here. It also includes some amazing participative musical performances from Bobby McFerrin.

http://www.worldsciencefestival.com/video/notes-neurons-full

[+] wzdd|15 years ago|reply
If you're just after a listen, there are lots of examples of alternative systems on youtube. Here's 19-tone, equal temperament (as opposed to the usual 12 TET): http://www.youtube.com/watch?v=1EP0KvbxW8o

I like the above example because it always starts by sounding "off" to me but seems okay by the end of the piece. It's a matter of what you're used to.

[+] stupidsignup|15 years ago|reply
For anyone interested in that kind of stuff: read "Musimathics", volume I especially.
[+] MrJagil|15 years ago|reply
kinda-off-topic: I am very often baffled by the sheer mathematical and general complexity of music. Each music-related wikipedia article is the stub of a link-tree that quickly ends up in confounding complexity.

The highly emotional associations I get of rock musicians and metal concerts when thinking about music could not be further from the science of music.