
Mathematical explanation of music and white/black notes in a piano - tpinto
http://math.stackexchange.com/questions/11669/mathematical-difference-between-white-and-black-notes-in-a-piano
======
gjm11
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
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.

~~~
alextgordon
_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 :)

~~~
JeremyBanks
I'm not sure I understand. Your argument for why musicians _should_ start at a
higher level of abstraction is that starting programmers at a higher level of
abstract works out poorly?

------
kainhighwind
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
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
> _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.

~~~
hasenj
Yea I've seen a Youtube video of someone adjusting a Yamaha keyboard to play
notes on middle eastern scales.

------
cletus
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.

------
fxj
12 tones is not the only possibility. there is also a 19 tone scale:

<http://en.wikipedia.org/wiki/19_equal_temperament>

there are also some mp3 files using 19 tone scale: e.g.
[http://www.harrington.lunarpages.com/mp3/Jeff-
Harrington_Pre...](http://www.harrington.lunarpages.com/mp3/Jeff-
Harrington_Prelude_3_for_19ET_Piano.mp3)

~~~
wazoox
Sounds great, thanks for the music link :)

------
hugh3
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
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?

~~~
manlon
If you start with the 12 chromatic tones and start addding notes to a scale
going up a circle of fifths, there are two natural stopping points where you
have spanned the octave with a complete-sounding set of notes with relatively
equal spacing and no gaps: five notes, which gives whole-step and minor-third
intervals; and seven notes, which gives whole-step and half-step intervals.
These two scales correspond to the spacing of the black notes and the white
notes, which are mirror images of each other around the circle of fifths. Any
other choice of scale size would have gaps, I believe.

~~~
nix
The drawback to this explanation is that the diatonic scale is 10,000 years
older than the "circle of fifths". So it presumably had some appeal to
musicians as well as to music theorists.

~~~
dmoney
Where do you find 10,000 year old music?

~~~
nix
You infer it from the existence of 10,000 year old musical instruments.

See <http://en.wikipedia.org/wiki/Diatonic_scale#Prehistory> \- which also
says that the circle of fifths was described much earlier than I thought.

------
cturner
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
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>

------
edanm
If you missed it, there's a link to a _free_ ebook called "Music: a
Mathematical Offering" -<http://www.maths.abdn.ac.uk/~bensondj/html/maths-
music.html>

Haven't read it, but it looks good.

------
wzdd
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
For anyone interested in that kind of stuff: read "Musimathics", volume I
especially.

------
MrJagil
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.

------
jacquesm
<http://en.wikipedia.org/wiki/Circle_of_fifths>

