patch for pitch to color

    Apr 05 2014 | 7:54 pm
    hi all, as a jackaroo I'm looking for a patch which can pick a color based on incoming sound pitch (voice). I there anybody who can help me? thnx

    • Apr 05 2014 | 8:55 pm
      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.
    • Apr 05 2014 | 9:02 pm
      thnx for your reply.. I was thinking of fiddle...but I like your 'simple' idea.. [though even that's kind of complicated for me:-p]
    • Apr 05 2014 | 9:13 pm
      Once you get your sound source / pitch detection thing figured out, post a patch and I will help you turn the data to color. Good luck with your project.
    • Apr 05 2014 | 9:15 pm
      really? great thanks in advance..
    • Apr 05 2014 | 9:42 pm
      this what I've got so far..
    • Apr 06 2014 | 12:29 am
      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.
    • Apr 06 2014 | 7:04 am
      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?
    • Apr 06 2014 | 10:17 am
      Yeah, it takes hue, saturation and value and converts them to red, green and blue.
      The benefit of using HSV or HSL colorspace is that it puts all of the hue info into one channel (rather than needing 3 as with RGB) and it allows you to control brightness and colorfulness separately.
    • Apr 06 2014 | 10:38 am
      Oh and yeah, I'll help you out. But you will learn more if you do it yourself. Sometimes you just have to sit with it.. until your brain hurts.
    • Apr 06 2014 | 11:37 am
      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. cheers!
    • Apr 07 2014 | 6:31 pm
      Hi there again, I almost got it.. do you have for me [pitch~ 2048 512 4096 blackman72 0 1 10 3] or is it just the pitch~ object?
    • Apr 07 2014 | 6:45 pm
      Not sure I understand your question. You included the pitch~ object in your original patch. That's why I used it. It's a CNMAT external. Everything after the ~ is an argument.
    • Apr 07 2014 | 7:17 pm
      never mind.. got it!!
    • Apr 08 2014 | 5:23 am
      I promised to post the patch for my installation so here it is.. It just needs some minor justifications many thanks for your contribution!