patch for pitch to color
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
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.
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]
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.
really? great thanks in advance..
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.
----------begin_max5_patcher---------- 1945.3oc4as0aaaCE94jeEDFa.o.NdjTRTR6s1ggtG1do.a.CcEEzRz1pU2p t3ljh1eX6w8Ka7hjujZQw35Ham9PrhnjkN7imuC+NGR+oKuXzzraXki.+L30 fKt3SWdwExlDMbQy4WLJgdSPLsTdaiBxRRXoUiFqtVE6lJY6WkkmmUFUwdV6 kxoUAKhRm+1BVPk5UXQbl345LF3BIS3Gb7mHNC4NABdSyWKJT97xl9tqQsOp YYoUozDl7JOuHhFu5JEymJZENA1zRZcRTZLqRZtn0MlUW01JbiGaYzcxGq+D nnwOe4khOFaHZjx9H2P+Jvnf+xX.jFjv10Q..XD+8xwAO4IvcCC39gAUmq51 bl5wOZzX9eqdXagI3chI3cfIH7dAJc4hLqf8gZVZvsf.9KoHKtD7a+4upAjv 9dR+CKKAHgvH4gtbVPv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AU0Ep5wc iGYzkh2ymu7+AyXKqcB -----------end_max5_patcher-----------
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, 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.
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.
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.
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?
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.
never mind.. got it!!