Functions
tDualPitchDetector

Combined pitch detection algorithm using both Joel de Guzman's Q Audio DSP Library and Katya Vetters algorithms. More...

Functions

void tDualPitchDetector_init (tDualPitchDetector *const detector, float lowestFreq, float highestFreq, float *inBuffer, int bufSize, LEAF *const leaf)
 Initialize a tDualPitchDetector to the default mempool of a LEAF instance. More...
 
void tDualPitchDetector_initToPool (tDualPitchDetector *const detector, float lowestFreq, float highestFreq, float *inBuffer, int bufSize, tMempool *const mempool)
 Initialize a tDualPitchDetector to a specified mempool. More...
 
void tDualPitchDetector_free (tDualPitchDetector *const detector)
 Free a tDualPitchDetector from its mempool. More...
 
int tDualPitchDetector_tick (tDualPitchDetector *const detector, float sample)
 
float tDualPitchDetector_getFrequency (tDualPitchDetector *const detector)
 
float tDualPitchDetector_getPeriodicity (tDualPitchDetector *const detector)
 
float tDualPitchDetector_harmonic (tDualPitchDetector *const detector, int harmonicIndex)
 
float tDualPitchDetector_predictFrequency (tDualPitchDetector *const detector)
 
void tDualPitchDetector_setHysteresis (tDualPitchDetector *const detector, float hysteresis)
 Set the hysteresis used in zero crossing detection. More...
 
void tDualPitchDetector_setPeriodicityThreshold (tDualPitchDetector *const detector, float thresh)
 Set the threshold for periodicity of a signal to be considered as pitched. More...
 

Detailed Description

Combined pitch detection algorithm using both Joel de Guzman's Q Audio DSP Library and Katya Vetters algorithms.

Function Documentation

◆ tDualPitchDetector_init()

void tDualPitchDetector_init ( tDualPitchDetector *const  detector,
float  lowestFreq,
float  highestFreq,
float *  inBuffer,
int  bufSize,
LEAF *const  leaf 
)

Initialize a tDualPitchDetector to the default mempool of a LEAF instance.

Parameters
detectorA pointer to the relevant tDualPitchDetector.
lowestFreq
highestFreq
inputBufferA buffer of float to store input to the pitch detector.
bufferSizeSize of the input buffer.
leafA pointer to the leaf instance.

◆ tDualPitchDetector_initToPool()

void tDualPitchDetector_initToPool ( tDualPitchDetector *const  detector,
float  lowestFreq,
float  highestFreq,
float *  inBuffer,
int  bufSize,
tMempool *const  mempool 
)

Initialize a tDualPitchDetector to a specified mempool.

Parameters
detectorA pointer to the relevant tPitchDualDetector.
lowestFreq
highestFreq
inputBufferA buffer of float to store input to the pitch detector.
bufferSizeSize of the input buffer.
mempoolA pointer to the tMempool to use.

◆ tDualPitchDetector_free()

void tDualPitchDetector_free ( tDualPitchDetector *const  detector)

Free a tDualPitchDetector from its mempool.

Parameters
detectorA pointer to the relevant tDualPitchDetector.

◆ tDualPitchDetector_tick()

int tDualPitchDetector_tick ( tDualPitchDetector *const  detector,
float  sample 
)
Parameters
detectorA pointer to the relevant tDualPitchDetector.
input

◆ tDualPitchDetector_getFrequency()

float tDualPitchDetector_getFrequency ( tDualPitchDetector *const  detector)
Parameters
detectorA pointer to the relevant tDualPitchDetector.
Returns
The detected frequency.

◆ tDualPitchDetector_getPeriodicity()

float tDualPitchDetector_getPeriodicity ( tDualPitchDetector *const  detector)
Parameters
detectorA pointer to the relevant tDualPitchDetector.
Returns
The periodicity of the input.

◆ tDualPitchDetector_harmonic()

float tDualPitchDetector_harmonic ( tDualPitchDetector *const  detector,
int  harmonicIndex 
)
Parameters
detectorA pointer to the relevant tDualPitchDetector.
harmonicIndex
Returns

◆ tDualPitchDetector_predictFrequency()

float tDualPitchDetector_predictFrequency ( tDualPitchDetector *const  detector)
Parameters
detectorA pointer to the relevant tDualPitchDetector.
Returns
The predicted frequency in Hz.

◆ tDualPitchDetector_setHysteresis()

void tDualPitchDetector_setHysteresis ( tDualPitchDetector *const  detector,
float  hysteresis 
)

Set the hysteresis used in zero crossing detection.

Parameters
detectorA pointer to the relevant tDualPitchDetector.
hysteresisThe hysteresis in decibels. Defaults to -40db.

◆ tDualPitchDetector_setPeriodicityThreshold()

void tDualPitchDetector_setPeriodicityThreshold ( tDualPitchDetector *const  detector,
float  thresh 
)

Set the threshold for periodicity of a signal to be considered as pitched.

Parameters
detectorA pointer to the relevant tDualPitchDetector.
thresholdThe periodicity threshold from 0.0 to 1.0 with 1.0 being perfectly periodic.