Musical notes and colors of a rainbow

I have wondered that in an octave in piano there are seven primary notes, and also we observe mostly seven primary colors of a rainbow. I know we perceive logarithmically, that means we only care about relative differences.

Is there any relation between $7$ musical notes (in an octave) and $7$ colors of a rainbow?

EDIT: I agree that the primary term for the $7$ notes in an octave is more or less the matter of taste. However, if we take the western musical taste as a guide, we can justify ourselves to use $12$ notes in an octave and place piano keys in the present way. Take a look at here.

• There's a mathematical explanation for 12 notes in an octave, as explained in your link. There's no explanation for 7 primary notes though, except that it sounds good and familiar to western ears. – Eric Duminil Mar 16 '17 at 9:50
• @EricDuminil I guess you got my purpose wrong. There is a mathematical justification for the fraction $\frac{7}{12}$ which states there is $7$ white keys in an octave. – heaven-of-intensity Mar 16 '17 at 10:00
• Thanks for staying open-minded. A correct, mathematical explanation of 12 notes in an octave shouldn't use note names until the very end. First : octave, then fifths, then semi-tone, then 12 notes in an octave. At the end, name the notes as you wish, but it isn't a mathematical process anymore. – Eric Duminil Mar 16 '17 at 11:06
• You can see here that musicians sometimes associate sounds with colours, but it's never a direct correspondence of wavelengths. – user27542 Mar 16 '17 at 12:01
• @Karlo Yes, the octave system doesn't work in colors. I asked about the relation in an octave. – heaven-of-intensity Mar 16 '17 at 15:02

On the most basic level, the answer is a flat no. The seven primary notes in an octave is specific to the western musical tradition. It's not entirely arbitrary as you say, but there are many other choices that could have been made, and there are other cultures who use fewer notes (e.g. pentatonic scales in blues music) or more (e.g. Indian classical music). The seven colours in the rainbow are also somewhat arbitrary. (Are indigo and violet really different colours? Why don't we count aquamarine, right between green and blue?)

Having said that, it does happen to be the case that the range of frequencies we can see is just a little short of an octave, ranging from about 440-770 THz. This is really more or less a coincidence, but because of it, I can point out a relationship between light and colours, just for fun.

The A above middle C is defined, for modern instruments, as 440Hz. The A an octave above is 880Hz, and in general if we go $n$ octaves up we get a frequency of $440\times 2^n$. If we go forty octaves up from A we get a note of 483 THz. This can't be played as a sound wave (air can't vibrate at frequencies that are too high) but as an electromagnetic wave it's a slightly reddish orange.

If we go down a note to G we get $392\times 2^{40}$ Hz $= 431$ THz, which is just into the infra-red. (It might be possible to see it as a very deep red colour, but I'm not sure.) However, moving up from there we get the following colours:

• G - 431 THz - infra-red
• A - 483 THz - orange
• B - 543 THz - yellow-green
• C - 576 THz - green
• D - 646 THz - blue
• E - 724 THz - indigo
• F - 768 THz - violet (barely visible)
• G - 862 THz - ultra-violet

(I leave the sharps and flats as an exercise to the reader.) So you can't see G (or F#), but the other notes do actually have colours.

However, as I said this is just a bit of fun and does not in any way have any practical implications, since sounds at those frequencies can't be transmitted through air.

• This is one of my favorite answers in the whole Stack Exchange network! Now let me add that in real life this has no application. But for those who love superhero comics, the Green Lanterns once used this very same relationship to teach a blind member of their corps (Rot Lop Fan) how to use a power ring :) (though by mistake they told him to use F#, which would somewhere between violet and UV, instead of C...) – Thermo's Second Law Mar 16 '17 at 14:05
• I think there's a suggestion that "blue" in the context of a rainbow actually refers to aquamarine and "indigo" to deep blue rather than any purplish colour. – Muzer Mar 16 '17 at 14:47
• I find it interesting that the colors versus the opposing ends of the visible spectrum become similar to each other again. It's easy to arrange the rainbow colors in a circle which is closed, the same way one can arrange notes in an octave. Not sure what the physiological base is for that -- the color receptors in the retina do not appear to have any sensitivity to, say, light of half their designated wavelength. – Peter - Reinstate Monica Mar 17 '17 at 15:19
• Of interest may be Alexander Sciabin; there is a color wheel associated with an octave in the "Philosophical influences and influence of colour" section. – Peter - Reinstate Monica Mar 17 '17 at 15:33
• @CiprianTomoiaga no, it can't be, because different synaethesiacs map different colours to each note (or letter, word etc.). Synaesthesia is a neurological/psychological phenomenon, not a physical one. – Nathaniel Mar 19 '17 at 10:32

There is a connection in the sense that Isaac Newton regarded both musical harmony and optical physics as branches of mathematics (Kepler did the same with harmony and astronomy, and this kind of thing was not original to them), and deliberately chose 7 rainbow colours to match the common Western scale, despite his poor eyesight initially only spotting 5 colours; he later added orange and indigo

Wikipedia's article on the rainbow says

Newton chose to divide the visible spectrum into seven colours out of a belief derived from the beliefs of the ancient Greek sophists, who thought there was a connection between the colours, the musical notes, the known objects in the Solar System, and the days of the week.

and includes a reference to a 2004 article by Niels Hutchison, MUSIC FOR MEASURE, On the 300th Anniversary of Newton's "Opticks"

• He should have just mapped the 5 onto a pentatonic scale – Dave Mar 16 '17 at 17:23

Answer to this question varies significantly based on point of view.

Physics & Physiology: No, there is no connection. The mechanisms are quite different (EM vs. acoustic spectrum, eyes vs. ears etc.) and number 7 is arbitrary.

Musicology & Aesthetics: Number 7 isn't that important, because in an octave there is actually 12 notes if we adopt western model and it is not the only option, vision does not have an octave-principle etc. On the other hand, there are numerous theories (but in context of this site let's label them "analogies") about visible color and tone (e.g. from Newton himself). This notion (part of a bigger phaenomenon called synesthesia) is psychological and experience-based. It lies on no physical principle - well, other than: "Waves! It all fits together, ya know?!"

• "Arbitrary" does not mean "unimportant." The diatonic scale (seven notes based on certain simple frequency ratios) has been fundamental to Western music since prehistoric times. Why they stopped at seven tones? That's arbitrary. But those seven tones are the bedrock of western music theory. – Solomon Slow Mar 16 '17 at 16:28

The physiology viewpoint: totally different mechanisms.

The cochlea performs a mechanical Fourier transform. To some extent, we hear wavelengths. We can see a detailed explanation in The Human Ear -- Hearing, Sound Intensity and Loudness Levels.

But we don't see wavelengths. The different (usually three) types of cone cells are more or less sensitive to different (objective) wavelengths. Each (subjective) color is the product of this three signals.

• Thanks for answer. Is there any physiology explanation for seeing 7 colors in a rainbow? – heaven-of-intensity Mar 17 '17 at 8:07
• @Kiarash, names for colors $\ne$ colors (en.wikipedia.org/wiki/…). Some amazonian tribes have the same chromatic vision that other (excluding daltonic/tetrachromatic) humans and less names for colors. See es.slideshare.net/LaurenBurleson/…. And, actually, we have more than seven names for colors. – Martín-Blas Pérez Pinilla Mar 17 '17 at 8:22
• Got it. Thanks! Although colors trivially differs from their names, but it's very tempting because I actually feel around $7$ colors in a rainbow, maybe just because of culture and other reasons. – heaven-of-intensity Mar 17 '17 at 8:32
• @Kiarash, I can't come up with a physiological reason for more than 5-6 colors (the three sensitivity peaks, plus the maxima for differences in sensitivity). – Mark Mar 17 '17 at 22:12

What we perceive as colors are only a tiny fraction of the electromagnetic spectrum. An octave of piano notes represents a set of frequencies in the acoustic "spectrum" (light waves and sound waves are fundamentally different, by the way). The number 7 is arbitrary, we can name many more colors and we could define many more notes (on the piano we actually have 12 in an octave).

One more difference is that the rainbow contains the whole visible spectrum from red (large wavelength) to violet (short wavelength). Above and below that we are not able to perceive. One octave on the piano, on the other hand, is just one fraction. There are many octaves we are able to hear. The pattern repeats many times. Regarding 7/12 notes: music and physics yield a number of notes. But the number of colors in the rainbow is completely arbitrary. Where do you define boundaries between colors (e.g, yellow-green, bright-lime, citron)? It is continuous.

So from my perspective it is even more difficult to find relations than to find differences between "notes" and "colors".