Forums > MaxMSP

Expression needed

May 03 2009 | 4:47 pm

Hi there

I need an expression that enables three continuously changing values to always add up to 1.

Basically, I have the swatch object, and want to be able to do a sweep through the colours with the slider object. I have the pack object going into the swatch object and know I need three float values going into it for the RGB values but this is as far as I’ve got!

Is there a simple way to do this?

Many thanks,

May 03 2009 | 5:45 pm

The start of your question sounds like you are talking about normalizing an array. What you want is something like (RGB positions are screwed up here but easy to fix):

— Pasted Max Patch, click to expand. —
May 03 2009 | 5:46 pm

That’s actually perfect. Thank you so much!

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP