Pitch object

musicboxx's icon

Does anyone know how to make the Pitch object work in Max 5 / 6? As in enable the Pitch object to translate audio into numerical values?

Peter McCulloch's icon

pitch~ works fine for me. You might check the helpfile for it and just use the arguments that it uses there.

musicboxx's icon

Is there any way I could send you my patch? I'm a bit new to Max so I'm still not quite sure what to do. Basically, I'm trying to give numerical value to notes played via the Buffer & Groove objects. From that point onwards I want to assign colours to the numerical values. Any ideas....?

Peter McCulloch's icon

Best just to post it on the forum. Groove~ is just playing audio. Pitch~ takes audio signals and tries to analyze them for pitched material. There's also the fzero~ object in Max 6 that does pitch-tracking.

Have you worked through any of the tutorials yet? If not, that's my first recommendation. (check under the help menu)

musicboxx's icon

Cheers man! I was actually on the right track beforehand: audio signals are being recognized and numbers have been assigned to individual notes. My next headache will be assigning the numerical values to colours haha

Thanks for the help, though!

Rodrigo's icon

Once you get pitch tracking working you need to figure out how you want to map one to the other. Pitch, you will likely get as a single number (either as frequency or as a midi number), but color can be represented many ways. Most often (in max) as RGB, so you need to turn that one number into three numbers (at least). There's also hue and transparency. There's a "mood machine" inside the help file for 'swatch' that might give you some ideas.

musicboxx's icon

I've checked the 'Swatch' object, which is really cool, but ideally, I would just like one a certain colour to appear once a note is played (i.e.) Blue to appear when 'Pitch' spits out the number 59.4 etc etc.. Any other suggestions?

Can I post my patch up here for further assistance?

Peter McCulloch's icon

Sure. Be sure to use the "copy compressed" option under the edit menu.

musicboxx's icon

Still trying to send the file, give me some more time, sorry guys

musicboxx's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Rodrigo's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Here's an idea

Rodrigo's icon

A couple of notes. Use 'replace' instead of 'read' for buffer. Replace changes the size of the buffer to fit the new sample. Read just loads it into whatever size buffer you have.

The version on the left uses attacks to only change color when a new note/event happens, the version on the right changes constantly, but is smoothed out a bit (other wise it looks too jittery).

If you wanna get crazy with it you can use analyzer~ instead and take amplitude and noisiness data and use that to control saturation and other parameters.

musicboxx's icon

Thanks for that man, I think I understand what you've done. Any ideas about mapping raw incoming data to colours?