• Simple math logic...not simple for me :(

Hi...i'm having a problem i just can resolve, or my mind at this point is completely blocked...
I'm doing a patch where you can read rgb pixel data and use it to produce various sounds.
The problem is that i'm trying to split in six different colors, RGB of course, and the combination of that, Cyan Magenta & Yellow. Now i'm at the moment when i can "play" the yellow or cyan color without "playing" the green color. It's just G - Y or C. Great! But what i want to do now, AND I JUST CAN'T (and i'm feeling a little stupid at this point) is to play the three colors in combination when there's a white color. I can't find the right math conditions or operator to do this. I know is not an specific PD issue, but is driving me crazy.

I just want, at least with that particular image, to get a 1 as a result. I mean, the green synth should play when is green and white too...

I'll post some images

• Posts 5 | Views 2741
• Hi @juliandp, can you explain a bit more in depth what you are trying to do?

I think you need to decide which color space you want to use for the image sonification. The HSV or HSL color space (hue, saturation, luminance) might be useful if you want to make a different sound for each color range of the spectrum and also has a separate value for the brightness.

• Oh...other space color...yeah i thought about it.

I'll explain the patch in more detail.
It loads an image. Every pixel color data RGB, and its combinations, represent a different voice of a 6-voice fugue. This fugue is playing in background all the time. For example. the first voice is associated with the values of the red values. If the value is 1 the fugue voice is at full volume, when the values of the reds gets lower, that fugue voice is filtered and lowered in amplitude...it's like that with the other colors. Each six colors with each six fugue voices.

It's easy to only play the reds, greens and blue voices, cause they're not a combination (or a modulation in my case) of colors. But when I combine two colors (red & green to get yellow o blue & green to get cyan), the "source" colors are sounding too.

Well at this point, i can play yellow or cyan, and not play the source colors. That operation is done. It's Source color (e.g. Green) minus yellow or cyan, and with that the green value is reduced. It's great!!! buuuutttt...

What i want to do is, the sum of all colors is white...so the color green should be sounding like the rest of colors...but i JUST CAN'T GET THAT TO WORK...because the operations i made, the green gets a 0 value...

I'll upload my patch if this explanation is too clumsy...sorry bout that.

• The main patch is Gem Test 1.pd

• well i did it. I just put an [abs] object to counterback the negative result of my operations. Not the fanciest way, but it works!

Posts 5 | Views 2741
Internal error.

Oops! Looks like something went wrong!