Using Vamp Plugins and Hosts > Getting and Using Vamp Plugins

Strange results from qm-vamp-plugins:qm-tempotracker:tempo

(1/1)

knobunc:
I've noticed that the tempo results are off from what calculating a simple BPM number from the time difference of consecutive beats would give.  For instance in the histograms below you can see that qm-tempotracker:tempo thought that 117 was the right target, but there were less than 2% of the qm-tempotracker:beats at a bpm of 117.  If I manually tap the beats I get 115 bpm which is where the qm-tempotracker:beats suggests.

Histogram of results from qm-vamp-plugins:qm-tempotracker:tempo

--- Code: ---115    6  3.6% ***                                                                                               
117  152 91.6% *******************************************************************************************       
120    1  0.6%                                                                                                   
123    1  0.6%                                                                                                   
129    1  0.6%                                                                                                   
133    1  0.6%                                                                                                   
152    4  2.4% **                                                                                                 

--- End code ---

Histogram of tempo compute from qm-vamp-plugins:qm-tempotracker:beats

--- Code: ---091    1  0.2%                                                                                                   
108    1  0.2%                                                                                                   
110    2  0.4%                                                                                                   
112   48 10.0% **********                                                                                         
115  386 80.8% ********************************************************************************                   
117    8  1.7% *                                                                                                 
120    4  0.8%                                                                                                   
123    2  0.4%                                                                                                   
126    4  0.8%                                                                                                   
129    3  0.6%                                                                                                   
133    1  0.2%                                                                                                   
152    7  1.5% *                                                                                                 
191    4  0.8%                                                                                                   
199    1  0.2%                                                                                                   
215    1  0.2%                                                                                                   
235    5  1.0% *                                                                                                 

--- End code ---

The bars and numbers don't add up between the two histograms because the beats talks about actual beats, but the tempo histogram is reporting on the roughly 1.5 second chunks reported by qm-tempotracker:tempo. Which leads to another question... why am I seeing the chunks?  The api docs for that say:
  "The estimated tempo, returned as a feature each time the estimated tempo changes, with a single value for the tempo in beats per minute."
Yet I see the following output from vamp-simple-host:

--- Code: ---0.011609977:117.455
1.497687074:152
2.983764172:152
4.469841269:152
5.955918367:152
7.441995464:117.455
8.928072562:117.455
10.414149659:117.455
11.900226757:117.455
13.386303854:117.455
14.872380952:117.455
16.358458049:117.455
17.844535147:117.455
19.330612244:117.455

--- End code ---
And that 1.486 second difference between timestamps is consistent across any file I have looked at.  I would have expected to see the times when it changed... why I am I getting periodic reports?

I have a wrapper around vamp-simple-host, and I am using version 2.0 of the SDK and version 1.5 of the QM plugins.

Any suggestions would be greatly appreciated.  Thanks for a cool tool,
-ben

cannam:
Hm, puzzling one.

Part of this is easy to explain -- the tempo tracker is indeed supposed to return a result only when the tempo changes, as documented, but the current release has a bug that makes it return a value on every process call whether it has changed or not.  This has been fixed for a while in the code repository and will be fixed in the next release (not too far off I expect).

The discrepancy in tempo and beat timings is harder to explain, and I'm not sure I have the requisite knowhow to completely understand what caused this.  I believe that there's no intrinsic built-in guarantee that the tempo and beat timings will match up with one another, because the tempo is an underlying estimate that covers a relatively lengthy period while beats may be fitted to track local changes somewhat.  Also, both tempo and beat locations have a limited resolution essentially based on the internal frame size -- as I understand it, 115 and 117 are actually rounded versions of two immediately neighbouring values at the internal resolution (so this may be a simple off-by-one error internally, or it may be something subtler that is not technically a code error at all).

It may be helpful if you could link to audio data to go with your results (I realise this is not always possible).

If I get any more information on this, I'll add it!


Chris

knobunc:
For what it's worth, this happens pretty consistently across any file that I have tried it with.  The higher the tempo, the further off it is (it's about 1-3% high).

I have tried it with techno songs with a fixed tempo and a very clear bass-driven beat.  And the beats reported are unvarying, yet the tempo ends up high.

Thanks for answering,

-ben

Navigation

[0] Message Index

Go to full version