Frequency to Color

    Sep 05 2013 | 3:00 pm
    Hello forum,
    I'm wondering if there are any objects that can take frequency and amplitude values and translate them into RGB or HSL/HSV values in real time, similar to the following link:
    As I'm currently assuming such thing doesn't exists, I would like to know if any of you have done similar things before and can share some of your knowledge or give me some pointers.
    Thanks in advance.

    • Sep 06 2013 | 1:16 pm
    • Sep 06 2013 | 1:23 pm
      This is basically just math that you can patch together with plain-vanilla Max objects. You can follow the link from the page you cited to the Physics dept. at SFASU, pick an algorithm, and implement it as a Max patch or use Javascript or Java or C or whatever.
      I'm not aware of any objects that do all the lifting for you, but you might want to take a look at to see if you can find anything there.
    • Sep 07 2013 | 8:33 am
      This is a favorite subject of mine.. so forgive the verbosity.
      First of all, I'm not a fan of the ol' wavelengths of light to audio frequency sound mapping (per se). Not only does it make little to no sense in terms of physics (color and sound are two very different beasts) but it's not based on human experience. It's comes off as more of a disembodied novelty. To me at least. Of course I'm not talking about potential usefulness as an exercise in programming (I'm sure you would learn a lot).. but rather the relevance and meaningfulness of the approach. I prefer something more grounded in human experience... which typically involves qualities and proportions over quantities and absolute values.
      In terms of color.. HSV is probably the most intuitive and useable of all color formats. It's a bit more natural to map the variables to other forms of media as well ... and you can always convert it to RGB whenever you want.
      That said.. meaningful relationships between color and sound might include:
      pitch/hue The difference between two hues as a kind of color interval. We readily perceive proportional differences in both pitch and hue. Both colors and musical notes are also commonly mapped onto a circle.
      pitch/value(brightness) Contrast could be considered as a kind of value interval with differences in value relating to differences in pitch. Lower pitch is commonly associated with darker colors and high pitch with brighter colors. You could map notes to hue and consider the various tints/shades of a given hue as different intervals/octaves of that hue.
      volume/brightness The brightness or intensity of a color can be considered as a kind of color volume. A very natural association.
      volume/saturation Saturation is also closely related to value and makes for an interesting analogue to volume. We often perceive saturated fluorescent colors as 'loud', etc.
      white color and noise Consider that both white color and white noise consitute an even distribution of more pure, primary elements. Saturation can be thought of as chromatic purity.. with more saturated colors containing less white. The same can be said of sonic purity, with the purity of a given sound containing less noise. There is also a curious relationship between filtering white noise in subtractive sound synthesis and using pigments and other materials to absorb and reflect certain color.
      saturation/consonance The precise midpoint of any two complementary colors is gray.. which is totally desaturated and 'impure'. The midpoint in a tempered octave is a tritone, which is relatively more dissonant.
      color envelopes You can also play with color relationhips within a given frame of reference as a kind of 'envelope'.. with sharp, clear colors that pop as a color 'attack' and color that blends into the background as a 'release'. It would also follow that evenness and consistency of a given color could be considered as a kind of 'sustain'. etc.
      There are many approaches... Pick a single simple aspect of both color and sound.. let's say, frequency/brightness. Then it's just a matter of getting frequency values from an object or device and processing the values so that another object or device can use those values to affect the brightness of something. Start off with just a linear scaling of input to output and then play around with shaping the initial values before scaling them.
    • Sep 09 2013 | 2:06 pm
      Hello Metamax,
      Certainly, what you say is true, though I wasn't thinking about just plain mapping frequency to hue, I was considering dividing the mapping into octaves and applying the sum of octaves of a given color as saturation. However, many of the approaches you described are very interesting and I will certainly have your recommendations in mind.
      Thank you very much for your interest and taking your time to help me.
    • Sep 10 2013 | 4:27 am
      Hey, that sounds pretty cool. If you get something going, I would be interested in checking it out.
    • Sep 10 2013 | 3:22 pm
      Hello Metamax,
      Working on the subject I've decided the best way to work into this is re-synthesizing spectrograms, scaling different octaves in order to fit them in their light spectrum analogues, summing and finally obtaining detailed results in terms of both hue, saturation and brightness based on the spectral contents of a signal, I decided to open a new topic about this, thought I should let you know in case you have any ideas, as my main concern now is how to transform these vectors back into color.
      Thanks again!
    • Sep 10 2013 | 3:35 pm
      You could just do the reverse of what is described in this thread (with Jitter) :
      I used to also load sounds into atmogen - import the images into photoshop - mess around with them - and then turn them back into sound.