matrix RGB led fading

lalalali's icon

Hi,

I have a matrix of RGB led that i can control individually and i would like to make them fade/blend colour depending on the proximity?
How could i control it with max/msp?

I have an arduino code that let the sensor speak to max/msp and let the leds to be control individually.

Any help? Thanks

Wetterberg's icon

i would like to make them fade/blend colour depending on the proximity

you're going to have to explain this in more detail. Like, you want it to be, for example, red for close proximity, blue for far away? And some sort of transition in between?

lalalali's icon

So maybe lets start with one colour, having the led really intense blue when i am close, breathing quite fast and fading to a light blue when i am far and breathing in that case more slowly..

Wetterberg's icon

ok, so now take apart your own statement: You want it to "breathe", which I guess is some kind of pulsating motion. How would you go about this? It should go up and down, yes? So you have movement over time - which objects would achieve movement over time?

lalalali's icon

Sorry, yes by 'breathe' i meant of a sort of pulsating motion. Could i animate the led with max/msp? what objects could achieve movement over time?

lalalali's icon

cycle?

Wetterberg's icon

Yes, you can absolutely do this with maxmsp, and you should consider the colour as simply numerical range of values between zero (off) and whichever value is your max.

cycle doesn't do oscillations as such - you're perhaps thinking about cycle~ ? That's absolutely useful. And the object has an input that controls its speed.

cycle~ -> math objects to condition the signal to the above mentioned range.

lalalali's icon

Would you be able to give me an example of patch please? kind of stuck here:/

Wetterberg's icon
Max Patch
Copy patch and select New From Clipboard in Max.
lalalali's icon

Could you please have a look at my patch, not too sure how the thing you sent me fit...
thanks a mill'

rgb_test_00.maxpat
Max Patch
Wetterberg's icon

sorry, I have no idea how to interface with your hardware right now - your patch doesn't give any indicators of it, either.

You need to figure out first how to properly convert messages for your arduino. I'd suggest reading up *properly* about sprintf to help you generate the ascii messages.

When you're done with that you can take the output of my patch, multiply it by 255, and feed it into sprintf, and that should set you on your way.

Have you done the max tutorials? Because doing any real work in max does require keen knowledge of the basic object set.