Pitch and beat detection aren't necessarily trivial. A voice isn't just a "a pitch". It's more complex. Your sound source will influence your method. Search the forum for different approaches.
Once you have actual pitch data (frequency values, MIDI notes, etc), you can choose how to map the values to color. In general, you are probably best sticking with a hue-based color space like HSL, HSV, etc. because the variables are more analogous to sound. One of the more common ways is to scale the 12 semitones to 360 degrees of hue. You can also map amplitude to lightness or duration to saturation. Things like that.
Here is something that uses pitch~ to convert input tones to color. Specifically, frequency to hue and amplitude to value. Frequency changes the "color" and gain control the overall "brightness" or value of the color.
Hue is polar and measured in degrees.. so you need to set a frequency range to map to 0-360.
Using cycle~ as a source makes it a bit clearer to illustrate. You can always plug in a different sound source.
Also, this patch uses a jasch object (hsv2rgb), so you'll need to grab that library if you don't have it. Otherwise, I can post an hsv2rgb abstraction built with max objects as an alternative.
wow that's really great! thanks very much.
I'm trying to figure out about the hsv2rgb thingy.. If understand it right: it's a small piece that arranges HSV to RGB. I found it on jash-downloads and I installed it in max/file/install (hope this is right)
anyway great thanks to you Metamax. but if I run into problems with this project can I ask you again?
yeah right! You gave me a good start though. I'm working with the patch right now, and trying to understand it better. Anyway, thanks again for your help and when I get this project working I'll post it to you.