COLOR GENERATOR ACTIVATED BY WEBCAM

maggal's icon

I'm kind of new to Max and I am having trouble regulating the information being picked up by the webcam being translated into the speed of a random color generator.

I was told to remove the IR filter from my webcam so I did and the information that appears on the pcamera window looks like when you close your eyes and look into the sun.

i have established a mean value so that anything below that value, will give off a signal and so the color generator is activated. However, I would really like to alter the speed of the change having it happen slower or at the same speed at which the live motion is captured. I don't know how to establish a range for speed and if there is no motion have the color generator window fade to black. Can anyone help me with this? I've attached the patch below.

I would very much appreciate anyone's help.

Thank you

MOODROOM-1.maxpat
Max Patch