Vocal pitch tracking best practices

Evan's icon

I've been asked to create a Max patch/device that controls a mono synth according to vocal input. The development is moving along, but I figured I'd ask around to see if ay users have any valuable advice on as to getting the pitch tracking to be awesome.

I've got a basic signal flow concept of input -> gate -> Eq -> Compression -> Pitch tracking. Does this seem about right? Im curious as to the difference if I put the Compression before the EQ. I just figured I'd only want to compress the data that I will actually be using (frequencies within the range of the human voice).

I've implemented it with retune~, but I am also thinking about investigating fzero~. My experiments with retune have been encouraging, but it's hard to accurately track the octave of the fundamental due to the complexity of the voice. On a synth it works incredibly well. I've had trouble getting a stable reliable pitch and 'note' events from fzero~. It seems to want to spit output data constantly, including the onset indication. I was thinking of cooking something up in Gen to tame the data and get it solid.

Any advice, anecdotes, or warnings would be greatly appreciated.

nonlocality's icon

try using the sigmund~ external. you'll no doubt get better results with it!

Evan's icon

No 32 bit. Building this for compatibility going forward. Sigmund~ is not 64 bit yet (tis a shame, because I would've used it).

nonlocality's icon

yikes. you might be restricted to fzero or retune (i'm not familiar with retune) then

Evan's icon

hence mentioning them in my post ;)

I'm confident I'll be able to get usable, stable tracking with a bit of work and some careful treatment of the data.

Thanks for dropping in anyway.

mzed's icon

Can you post your patch? Are you using the default fzero~ settings?

I think that the onset detector in fzero~ might be a little too nervous. I'm not sure if it can be tweaked to work bettor. The help patch for fzero~ uses the amplitude output of fzero, rather than the onset detection, for this reason. That might be a good approach to explore.

Evan's icon

Yeah I'll post the pitch detection thing later today, not at my machine currently.

I am not using the onset detection of fzero, it is indeed much too nervous. I am doing some amplitude tracking and driving the envelope of the synth from that. I'm doing some compression and filtering prior to the pitch tracking, so I don't think that using the amplitude output of fzero~ will accurately reflect what's coming into the patch, but it might be worth a look. One of the reasons I initially avoided that is because the data coming out of fzero~ isn't at signal rate, which is kind of a bummer.

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

Here's a small part of the patch taht deals strictly with the pitch tracking. If any one is still interested in taking a look, I'd love to hear any suggestions. There's some controls for various parameters, and some switches to play with different sources and objects.

Les Stuck's icon

Volker Böhm has been hard at work:

A 64-bit version of sigmund~ is now available:
https://github.com/v7b1/sigmund_64bit-version/releases

You might also try vb.pitch~
http://vboehm.net/downloads/

BTW, filtering out all the high frequencies is not necessarily a good idea, since some tracking algorithms use the harmonics to figure out the fundamental.

<