RGB colour analysis…
May 23, 2006 at 9:36pm
RGB colour analysis…
Hello forum users,
I am attempting to create an RGB colour to sound frequency converter and I am hoping to use the light frequency scale (visible light spectrum) in relation to sound frequency (20 to 20,000Hz).
Please see the link below for the visible light spectrum colour scale.
Lower light frequencies (red, orange, yellow) will relate to low sound frequencies rising up the sound frequency spectrum to high frequencies representing blues, purples and violets.
I was wondering if such a thing had been done before within the Cycling 74 world and if not if anyone has any suggestions as to how this could be done.
I’m currently reviewing ideas using simple mathematics, with greater/less than or = to objects being used to categorise sections of the RGB colour scale and sound frequency scale. However, this will be time consuming and assistance would be appreciated!
May 23, 2006 at 10:05pm
Providing you have some facility with using Max generally, it’s
The good news about working with Max is that once you come
Have you taken a look at how RGB values map to the “color
May 23, 2006 at 10:15pm
this idea has been around about as long as the spectrum has been around
if you’re interested, you could read:
a timeline is on
these efforts were basically abandoned because colour is not very
This is not to discourage you, I think any linkage between anything can
to do it, i think you need to convert RGB to HSL or HSV (there are
May 23, 2006 at 10:33pm
On May 23, 2006, at 5:15 PM, Joost Rekveld wrote:
> This is not to discourage you, I think any linkage between anything
one word: metasynth!
May 24, 2006 at 8:47am
Those are definitely interesting, but the link between color and
It’s all arbotrary, though; there is no universal formula for
Another interesting relationship is how we perceive individual colors
May 24, 2006 at 10:37am
May 24, 2006 at 10:31pm
Thanks for your replies, this post has certainly revealed some extremely interesting information!
My work is fairly basic at this stage. I have created a patch that allows for scanning of an image using a mouse or tablet. I have managed to source X/Y co-ordinates, R/G/B values and control over a 4 output panning area from this patch so far. The final element is to add a sound conversion stage and the heart of this will be a colour to sound frequency conversion, alongide saturation values, 4-speaker panning and pressure (if tablet pen is used).
By reviewing the swatch object I can see that RGB values correspond to the light spectrum (in regards to the swatch’s arrangement from left to right). The values are clear, with Red creating 255-0-0, with green increasing to form orange and then yellow, then red removed to form green, blue added to form light blue and green removed to create darker shades of blue with red added once again to create purple and finally violet. Saturation corresponds vaguely to the brightness of the colour (I will most probably use this value to control volume).
I was wondering what process I might use to map this R/G/B value change to the sound frequency spectrum. As noted, I can source RGB values from scanning an image, I now want to relate them to a particular frequency and my knowledge of mathematics is too minimal to do so! I would like to follow the light frequency spectrum as noted before (this is quite important as rules will be written to assist listeners).
All help would be very welcome. I’ve played with less/greater than or equal to arrangements but I end up in quite a mess! I would like the frequency flow to be as smooth as possible, without painful jumps from frequency to frequency (red going suddenly to violet might cause a few issues)!
All advice welcome as always. Thanks for your help so far.
May 25, 2006 at 1:39am
I think you need to study colourspaces a bit more thoroughly. http://en.wikipedia.org/wiki/Colorspace
RGB is but one of many possible ways to represent colour data. For what you want to do, it is far from the most useful. As has been previously mentioned, what you are looking for is hue. This can be obtained in Jitter using the jit.rgb2hsl object. Instead of containing argb values, your 4-plane matrices will now hold alpha, hue, saturation and luminosity.
What your are seeking to do is map hue to pitch. There is a problem, however. Hue is a circle. A pixel with a hue of 0, and one with a hue of 255 are both going to look red. Not only that, saturation and luminosity being equal, they are going to be all but indistinguishable from each other. Think of hue as a chronometre: if I measure something occuring at 59 seconds, and the next event is at 2 seconds, you’d be wrong to think the two events were 57 seconds appart. Hence, you have a problem: mapping something cyclical (hue) to something linear (pitch).
> By reviewing the swatch object I can see that RGB values correspond to the light spectrum (in regards to the swatch’s arrangement from left to right). The values are clear, with Red creating 255-0-0, with green increasing to form orange and then yellow, then red removed to form green, blue added to form light blue and green removed to create darker shades of blue with red added once again to create purple and finally violet. Saturation corresponds vaguely to the brightness of the colour (I will most probably use this value to control volume).
May 25, 2006 at 7:29pm
well.. could always link hue to a shepard scale. thats plenty circular :)
also, to deal with the sudden jumps, try smoothing the data out with a line~ object using the time inlet to control slew.
You must be logged in to reply to this topic.