aubio: tempo/tempo.h File Reference

aubio 0.4.6

Typedefs | Functions
tempo.h File Reference

Tempo detection object. More...

Go to the source code of this file.

## Typedefs
typedef struct _aubio_tempo_t | aubio_tempo_t
| tempo detection structure

## Functions
aubio_tempo_t * | new_aubio_tempo (const char_t *method, uint_t buf_size, uint_t hop_size, uint_t samplerate)
| create tempo detection object More...
void | aubio_tempo_do (aubio_tempo_t *o, const fvec_t *input, fvec_t *tempo)
| execute tempo detection More...
uint_t | aubio_tempo_get_last (aubio_tempo_t *o)
| get the time of the latest beat detected, in samples More...
smpl_t | aubio_tempo_get_last_s (aubio_tempo_t *o)
| get the time of the latest beat detected, in seconds More...
smpl_t | aubio_tempo_get_last_ms (aubio_tempo_t *o)
| get the time of the latest beat detected, in milliseconds More...
uint_t | aubio_tempo_set_silence (aubio_tempo_t *o, smpl_t silence)
| set tempo detection silence threshold More...
smpl_t | aubio_tempo_get_silence (aubio_tempo_t *o)
| get tempo detection silence threshold More...
uint_t | aubio_tempo_set_threshold (aubio_tempo_t *o, smpl_t threshold)
| set tempo detection peak picking threshold More...
smpl_t | aubio_tempo_get_threshold (aubio_tempo_t *o)
| get tempo peak picking threshold More...
smpl_t | aubio_tempo_get_period (aubio_tempo_t *bt)
| get current beat period in samples More...
smpl_t | aubio_tempo_get_period_s (aubio_tempo_t *bt)
| get current beat period in seconds More...
smpl_t | aubio_tempo_get_bpm (aubio_tempo_t *o)
| get current tempo More...
smpl_t | aubio_tempo_get_confidence (aubio_tempo_t *o)
| get current tempo confidence More...
uint_t | aubio_tempo_set_tatum_signature (aubio_tempo_t *o, uint_t signature)
| set number of tatum per beat More...
uint_t | aubio_tempo_was_tatum (aubio_tempo_t *o)
| check whether a tatum was detected in the current frame More...
smpl_t | aubio_tempo_get_last_tatum (aubio_tempo_t *o)
| get position of last_tatum, in samples More...
uint_t | aubio_tempo_get_delay (aubio_tempo_t *o)
| get current delay More...
smpl_t | aubio_tempo_get_delay_s (aubio_tempo_t *o)
| get current delay in seconds More...
smpl_t | aubio_tempo_get_delay_ms (aubio_tempo_t *o)
| get current delay in ms More...
uint_t | aubio_tempo_set_delay (aubio_tempo_t *o, sint_t delay)
| set current delay More...
uint_t | aubio_tempo_set_delay_s (aubio_tempo_t *o, smpl_t delay)
| set current delay in seconds More...
uint_t | aubio_tempo_set_delay_ms (aubio_tempo_t *o, smpl_t delay)
| set current delay More...
void | del_aubio_tempo (aubio_tempo_t *o)
| delete tempo detection object More...

## Detailed Description

Tempo detection object.

This object stores all the memory required for tempo detection algorithm and returns the estimated beat locations.

Definition in file tempo.h.

## Function Documentation

## ◆ aubio_tempo_do()

void aubio_tempo_do | ( | aubio_tempo_t * | o,
|  | const fvec_t * | input,
|  | fvec_t * | tempo
| ) |  |

execute tempo detection

Parameters

  o | beat tracking object
  input | new samples
  tempo | output beats

Examples:
  examples/aubiotrack.c, and tempo/test-tempo.c.

## ◆ aubio_tempo_get_bpm()

smpl_t aubio_tempo_get_bpm | ( | aubio_tempo_t * | o | ) |

get current tempo

Parameters

  o | beat tracking object

Returns
  the currently observed tempo, or `0` if no consistent value is found

Examples:
  tempo/test-tempo.c.

## ◆ aubio_tempo_get_confidence()

smpl_t aubio_tempo_get_confidence | ( | aubio_tempo_t * | o | ) |

get current tempo confidence

Parameters

  o | beat tracking object

Returns
  confidence with which the tempo has been observed, the higher the more confidence, `0` if no consistent value is found.

Examples:
  tempo/test-tempo.c.

## ◆ aubio_tempo_get_delay()

uint_t aubio_tempo_get_delay | ( | aubio_tempo_t * | o | ) |

get current delay

Parameters

  o | beat tracking object

Returns
  current delay, in samples

## ◆ aubio_tempo_get_delay_ms()

smpl_t aubio_tempo_get_delay_ms | ( | aubio_tempo_t * | o | ) |

get current delay in ms

Parameters

  o | beat tracking object

Returns
  current delay, in milliseconds

## ◆ aubio_tempo_get_delay_s()

smpl_t aubio_tempo_get_delay_s | ( | aubio_tempo_t * | o | ) |

get current delay in seconds

Parameters

  o | beat tracking object

Returns
  current delay, in seconds

## ◆ aubio_tempo_get_last()

uint_t aubio_tempo_get_last | ( | aubio_tempo_t * | o | ) |

get the time of the latest beat detected, in samples

Parameters

  o | tempo detection object as returned by new_aubio_tempo

Examples:
  examples/aubiotrack.c, and tempo/test-tempo.c.

## ◆ aubio_tempo_get_last_ms()

smpl_t aubio_tempo_get_last_ms | ( | aubio_tempo_t * | o | ) |

get the time of the latest beat detected, in milliseconds

Parameters

  o | tempo detection object as returned by new_aubio_tempo

Examples:
  tempo/test-tempo.c.

## ◆ aubio_tempo_get_last_s()

smpl_t aubio_tempo_get_last_s | ( | aubio_tempo_t * | o | ) |

get the time of the latest beat detected, in seconds

Parameters

  o | tempo detection object as returned by new_aubio_tempo

Examples:
  tempo/test-tempo.c.

## ◆ aubio_tempo_get_last_tatum()

smpl_t aubio_tempo_get_last_tatum | ( | aubio_tempo_t * | o | ) |

get position of last_tatum, in samples

Parameters

  o | beat tracking object

## ◆ aubio_tempo_get_period()

smpl_t aubio_tempo_get_period | ( | aubio_tempo_t * | bt | ) |

get current beat period in samples

Parameters

  bt | beat tracking object

Returns the currently observed period, in samples, or 0 if no consistent value is found.

## ◆ aubio_tempo_get_period_s()

smpl_t aubio_tempo_get_period_s | ( | aubio_tempo_t * | bt | ) |

get current beat period in seconds

Parameters

  bt | beat tracking object

Returns the currently observed period, in seconds, or 0 if no consistent value is found.

## ◆ aubio_tempo_get_silence()

smpl_t aubio_tempo_get_silence | ( | aubio_tempo_t * | o | ) |

get tempo detection silence threshold

Parameters

  o | tempo detection object as returned by new_aubio_tempo()

Returns
  current silence threshold

## ◆ aubio_tempo_get_threshold()

smpl_t aubio_tempo_get_threshold | ( | aubio_tempo_t * | o | ) |

get tempo peak picking threshold

Parameters

  o | tempo detection object as returned by new_aubio_tempo()

Returns
  current tempo detection threshold

## ◆ aubio_tempo_set_delay()

uint_t aubio_tempo_set_delay | ( | aubio_tempo_t * | o,
|  | sint_t | delay
| ) |  |

set current delay

Parameters

  o | beat tracking object
  delay | delay to set tempo to, in samples

Returns
  `0` if successful, non-zero otherwise

## ◆ aubio_tempo_set_delay_ms()

uint_t aubio_tempo_set_delay_ms | ( | aubio_tempo_t * | o,
|  | smpl_t | delay
| ) |  |

set current delay

Parameters

  o | beat tracking object
  delay | delay to set tempo to, in samples

Returns
  `0` if successful, non-zero otherwise

## ◆ aubio_tempo_set_delay_s()

uint_t aubio_tempo_set_delay_s | ( | aubio_tempo_t * | o,
|  | smpl_t | delay
| ) |  |

set current delay in seconds

Parameters

  o | beat tracking object
  delay | delay to set tempo to, in seconds

Returns
  `0` if successful, non-zero otherwise

## ◆ aubio_tempo_set_silence()

uint_t aubio_tempo_set_silence | ( | aubio_tempo_t * | o,
|  | smpl_t | silence
| ) |  |

set tempo detection silence threshold

Parameters

  o | beat tracking object
  silence | new silence threshold, in dB

Returns
  `0` if successful, non-zero otherwise

## ◆ aubio_tempo_set_tatum_signature()

uint_t aubio_tempo_set_tatum_signature | ( | aubio_tempo_t * | o,
|  | uint_t | signature
| ) |  |

set number of tatum per beat

Parameters

  o | beat tracking object
  signature | number of tatum per beat (between 1 and 64)

## ◆ aubio_tempo_set_threshold()

uint_t aubio_tempo_set_threshold | ( | aubio_tempo_t * | o,
|  | smpl_t | threshold
| ) |  |

set tempo detection peak picking threshold

Parameters

  o | beat tracking object
  threshold | new threshold

Returns
  `0` if successful, non-zero otherwise

Examples:
  examples/aubiotrack.c.

## ◆ aubio_tempo_was_tatum()

uint_t aubio_tempo_was_tatum | ( | aubio_tempo_t * | o | ) |

check whether a tatum was detected in the current frame

Parameters

  o | beat tracking object

Returns
  2 if a beat was detected, 1 if a tatum was detected, 0 otherwise

## ◆ del_aubio_tempo()

void del_aubio_tempo | ( | aubio_tempo_t * | o | ) |

delete tempo detection object

Parameters

  o | beat tracking object

Examples:
  examples/aubiotrack.c, and tempo/test-tempo.c.

## ◆ new_aubio_tempo()

aubio_tempo_t* new_aubio_tempo | ( | const char_t * | method,
|  | uint_t | buf_size,
|  | uint_t | hop_size,
|  | uint_t | samplerate
| ) |  |

create tempo detection object

Parameters

  method | beat tracking method, unused for now (use "default")
  buf_size | length of FFT
  hop_size | number of frames between two consecutive runs
  samplerate | sampling rate of the signal to analyze

Returns
  newly created aubio_tempo_t if successful, `NULL` otherwise

Examples:
  examples/aubiotrack.c, and tempo/test-tempo.c.