Classes (extension) | UGens > Analysis > Pitch

Tartini : MultiOutUGen : UGen : AbstractFunction : Object

pitch tracker
Source: Tartini.sc


This alternative pitch follower uses autocorrelation like Pitch, but with an adapted method, and calculated via FFT. There are some parameters for you to choose the window size and other aspects of the calculation, but a user who doesn't want to worry too much about this kind of stuff, please just use the defaults and don't worry about them.

In technical terms, this UGen calculates a modified autocorrelation function following the method used in the Tartini open source (GNU GPL) pitch following software (http://miracle.otago.ac.nz/postgrads/tartini/)

The algorithm is based on the following paper: Philip McLeod and Geoff Wyvill (2005) "A Smarter Way to Find Pitch". ICMC Proceedings; 138-141.

NOTE: For the default and standard values of N and k (512 and 256, 1024 and 512, 2048 and 1024) initialisation time of the UGen at run-time should be fast (due to precalculation when the plug-in loads). BUT, for nonstandard choices, the first time you instantiate a UGen there will be a CPU spike. ADVANCED- hack the code in the load() function to choose your own standard precalculated FFT sizes for fftw.

Class Methods

Tartini.kr(in: 0.0, threshold: 0.93, n: 2048, k: 0, overlap: 1024, smallCutoff: 0.5)

There are two outputs (see examples code below)

fundamental frequency trail
confidence in the estimate- 0 = no fundamental found, 1= fully confident, then also values inbetween- will be above 0.9 if really finding a strong periodicity



the audio rate input signal


In autocorrelation function peak picking, chooses first peak within this threshold of the maximum peak. Leave it at 0.93 by default.


data window size (on OS X without fftw, only 2048, 1024 and 512 supported, and k must be n/2)


autocorrelation lags, actual FFT size will be n+k (this may lead to nonstandard non-power of 2 FFTs, fftw copes, don't worry about it...). It is recommended by Phil McLeod that you keep k at n/2 (if you set k=0 you will get that default) else at most 3*n/4.


overlap size in samples (ie, 1024 window, 256 overlap means advance by 768 samples each time)


a parameter for determining when a peak is recorded in the autocorrelation function, advanced use only. Suggest you never put this too low, ie near zero, because then every possible lag in the autocorrelation becomes a potential peak, CPU cost goes up, and results won't necessarily be any good.

Inherited class methods

Instance Methods

Inherited instance methods


(use headphones!)