Freq to rgb

francesco.rosati's icon

hi all

i'm looking for a simple way to convert a number, representing a frequency, into a list of three numbers, respectively Red Green Blue channel, respecting the correspondances between the audio and the light spectra. I've tried with some simple algos but whitout good results.
Do you have any good idea?

cheers

franz

Gary Lee Nelson's icon

Depends on what you mean by good results. You may already be doing this...

If frequency is a single number you can fiddle with it in various ways:
unpack as three numbers using shift and mask
scale the freq differently for each color plane
scale the freq to 0..1 range then scale

This is a basic problem of mapping sound to image and vice versa. A nice
picture doesn't necessarily make a nice sound. I've used MetaSynth a lot
for this but I have to design the image knowing what images make "good"
sounds for me. I have not been satisfied with going from sound to image
although manipulating a sonogram with jitter has produced some things I
really like.

You might also try fiddle~ and its cousins to collect spectral data from
your sound mapping the fundamental and several strong harmonics into RGB.
Envelope following is also useful as an input to the alpha channel.

Cheers,
Gary Lee Nelson
TIMARA Department
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

nesa's icon

Hello,

there are a few good ideas documented from about 1700-something to today,
but most of them were not based on simple mathematic formula, but rather on
sensibility of particular artist. I like the ones by Oskar Fischinger and
Len Lye, but some people are pleased with mapping of freq to Hue and
amplitude to Brightness or Saturation.

best,
nesa

Antoine Villeret's icon

Hello

there is a work group of the AFIM wich works on the Visualisation of sound

I think you will be interested in their work...

Have a good time

antoine

francesco.rosati's icon

Hi guys

thank you very much for the precious infos!
The main question didn't involve any sort of artistic mapping, this will be for sure one of my next steps, but my goal is only to rapresent a frequency from 20 to 18.000hz with a linear colours scale from red to blue or something similar.

E.g.: an higher freq should be positioned in the range of the Blue-Violet if not standing at the synesthetic feels that probably wants to put an higher frequency within the Red range..and so on...
At least i've tried simply using the Swatch object and that's works pretty good for me.

Anyway the link about visualization of sounds shows an amazing project! I have ever been interested in this kind of synesthetic correspondances, from Skrjabin (a semi-scientific approach) and Kandinsky (a total artistic approach to sounds' visualization) to the contemporary goals on this ground as the mentioned O'Really videos on the Point Line Cloud's Curtist Roads DVD.
Simply for discussing about it and share a little "OutOfTopic" opinion, i've recently seen an exibition by the duo tinylittleelements and i've found the video part as a really interesting interpretation of sound.

Hope you can understand my bad bad english!

Antoine Villeret's icon

Hi

if you only want to map freq to color you can try this (just copy and paste it into a new patcher) :

Max Patch
Copy patch and select New From Clipboard in Max.

this is an adaptation of a little patch I made for the automatic determination of color.
and you can get the freq of your sound object with fiddle~ (on MAC) or pitch~ (on PC).

maybe it's what you need...

antoine

PS : don't worry about your english, mine is not so good too...

francesco.rosati's icon

thank you Antoine! This is exactly the scaling equation i need!
Thank you so much for posting!

franz