tempo_eval.extract_tempo

tempo_eval.extract_tempo(tempo_annotations)[source]

Extract the most salient (greatest confidence) tempo value from the annotation.

Parameters

tempo_annotations (Annotation) – annotations

Returns

a tempo value (typically in BPM)

Return type

float

Example

>>> from tempo_eval import read_reference_annotations, extract_tempo
>>> smc_ground_truth = read_reference_annotations('smc_mirex', validate=False)  # turn validation off for speed
>>> smc_1_0_205 = smc_ground_truth['tempo']['1.0']['SMC_205.jams']  # choose reference version '1.0'
>>> tempo = extract_tempo(smc_1_0_205)  # extract single tempo from JAMS annotation
>>> print(tempo)
78.74015748031492