HylianFox posted...
roughly corresponding with the musical scale (because why not?)
There are SO many reasons why not, lol.
1. The selection of seven notes for the major scale is largely arbitrary on top of being largely arbitrary. Western musical scales are all subsets of the twelve-tone chromatic scale, in which each octave is divided into twelve tones whose frequencies form an exponential sequence leading evenly into the next octave, at which the frequency is doubled. But this is a really messy approximation of what good actually sounds like.
The idea behind the major triad, for example, is that you take a frequency and add odd overtones on top of it, scaled to within a single octave. So you could have an A at 440Hz, then at a 3:2 ratio, 660Hz, then at a 5:4 ratio, 550Hz. But this isn't actually possible with the chromatic scale because 5:4 (1.25) is between 2^(3/12) and 2^(4/12). The C# at 440*2^(4/12) (554.365Hz) is noticeably out of tune. The E at 659.255 is pretty close but still not exact. The reason we deal with this is probably because it's easier than adding some kind of on-the-fly tuning mechanism to a piano.
Why would you want to imitate a system that messed up?
2. The heptatonic major scale is not evenly spaced. Chosing seven of the twelve notes of the chromatic scale ensures that it can't be. The pairs of major third and perfect fourth, and major seventh and octave are one note (a half step) apart from each other, while other adjacent pairs are two (a whole step). Copying this exactly would have landed us with a spectrum something like red, orange, yellow, yellow-green, green-cyan, blue-magenta, red-magenta. Which is obviously dumb.
As is, we have an extra Indigo between red and violet, which pits your two half-intervals next to each other. Any kindergarten can tell you indigo and violet are just two purples.
3. Because the color space implies 3, 6, 9 or 12, but not 7.
Actually, we shouldn't be referring to the rainbow by the color space of pigments anyway. Using the RGB color space, our primary colors are red, green and blue, our secondary colors are yellow, cyan and magenta, and our tertiary colors are... well, it depends on how you define the term. In traditional color theory, there are three and in terms of light they would just be lighter versions of the primaries, but in modern colloquial usage there are six that are in between the primaries and secondaries: orange, chartreuse, spring, azure, violet, rose.
To use all of the colors up to a certain level, we should have 3, 6, 9 or 12. 7 is just cherry-picking a tertiary color to add to the primaries and secondaries. And frankly, if we were going to do that anyway, it should be orange. Red, orange, yellow, green, cyan, blue, magenta.