ptrackInstrument Control:Sensing and Controlptrackptrack
Tracks the pitch of a signal.
Descriptionptrack takes an input signal, splits it into ihopsize blocks and using a STFT method, extracts an estimated pitch for its fundamental frequency as well as estimating the total amplitude of the signal in dB, relative to full-scale (0dB). The method implies an analysis window size of 2*ihopsize samples (overlaping by 1/2 window), which has to be a power-of-two, between 128 and 8192 (hopsizes between 64 and 4096). Smaller windows will give better time precision, but worse frequency accuracy (esp. in low fundamentals).This opcode is based on an original algorithm by M. Puckette.
Syntaxkcps, kamp ptrack asig, ihopsize[,ipeaks]Initializationihopsize -- size of the analysis 'hop', in samples, required to be power-of-two (min 64, max 4096).
This is the period between measurements.
ipeaks, ihi -- number of spectral peaks to use in the analysis, defaults to 20 (optional)
Performancekcps -- estimated pitch in Hz.
kamp -- estimated amplitude in dB relative to full-scale (0dB) (ie. always <= 0).
ptrack analyzes the input signal, asig,
to give a pitch/amplitude pair of outputs, for the fundamental of a monophonic signal.
The output is updated every sr/ihopsize seconds.
Examples
Here is an example of the ptrack opcode. This example uses the files ptrack.csd.
Example of the ptrack opcode.
See the sections Real-time Audio
and Command Line Flags for more information on using command line flags.
See alsoSensing and Control: Tempo and Pitch estimationCreditsAuthor: &namevictor;NUI, Maynooth.Maynooth, IrelandMarch, 2007New in Csound version 5.05