Map the button colours on a direct relationship between the continuous spectrum of frequencies of electromagnetic energy in the band of visible light and the pitches of sound in a relationship to continuous frequency spectrum of sound that are 40 octaves (a factor of 240 = 1,099,511,627,776) below the frequencies of visible light.
See: https://www.flutopedia.com/sound_color.htm
Outstanding issues:
- Have to rechoose the colour option from the menu every time that you pick a new keyboard layout or tuning, so that it recalculates the colours from the note frequencies again
- The satutation/intensity could be distributed more to discern shades between adjacent tones a bit more by deliberately scaling the saturation or lightness a little bit further, but for now have just set th colours to be the same level of vividness and saturation
- the led hardware itself i think pushes yellow oranges and greens a little off towards each other so could do with some calibration
I haven't done C++ in years, so needs optimisation and tidyup