A mapping between musical notes and colors

bpert said:

If you take A = 440 Hz and keep doubling and doubling until you get into the range of light you will find ROYGBIV = F, G, A, Bb, B, C, D, E, F. Try it yourself.

So I did!  If you take the frequencies of each note in Hz (in equal temperament) and multiply them by 240 (40 octaves), you get a number in the THz, which would fall into the visual range if it represented the frequency of an electromagnetic wave instead of a sound wave. “A typical human eye will respond to wavelengths from about 390 to 750 nm.” Does it match up with ROYGBIV? Kinda.

Note Freq (Hz) +40 oct. (THz) Wavelength (nm) R G B Color HTML name
F♯4 370 407 737 174 0 0 dark red
G4 392 431 696 255 0 0 red
G♯4 415 457 657 255 0 0 red
A4 440 484 620 255 102 0 orange-red
B♭4 466 513 585 255 239 0 yellow
B4 494 543 552 153 255 0 chartreuse
C5 523 575 521 40 255 0 lime
C♯5 554 610 492 0 255 242 aqua
D5 587 646 464 0 122 255 sky blue
D♯5 622 684 438 5 0 255 blue
E5 659 725 414 71 0 237 blue
F5 698 768 390 99 0 178 indigo

I used this Python code to generate the RGB values for each wavelength, and Wolfram Alpha to find the nearest named HTML color.  Should find the nearest color names from the XKCD color survey instead (and “nearest” should be defined as distance in L*a*b* space, not in RGB space).

Since the starting point of F♯ is arbitrary, basically all this means is that our visual range covers about 1 octave.  Our audible range is 9–10 octaves, for comparison.