comparison code-doc/FixedTempoEstimator_8cpp-source.html @ 35:0976232e353b website

* Update for 2.1 release; add wiki link
author cannam
date Fri, 25 Sep 2009 15:40:18 +0000
parents cc0be37dc9d3
children
comparison
equal deleted inserted replaced
34:4b4db9230e94 35:0976232e353b
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3 <title>VampPluginSDK: FixedTempoEstimator.cpp Source File</title> 3 <title>VampPluginSDK: FixedTempoEstimator.cpp Source File</title>
4 <link href="tabs.css" rel="stylesheet" type="text/css">
4 <link href="doxygen.css" rel="stylesheet" type="text/css"> 5 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 <link href="tabs.css" rel="stylesheet" type="text/css">
6 </head><body> 6 </head><body>
7 <!-- Generated by Doxygen 1.5.6 --> 7 <!-- Generated by Doxygen 1.5.8 -->
8 <div class="navigation" id="top"> 8 <div class="navigation" id="top">
9 <div class="tabs"> 9 <div class="tabs">
10 <ul> 10 <ul>
11 <li><a href="main.html"><span>Main&nbsp;Page</span></a></li> 11 <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
12 <li><a href="namespaces.html"><span>Namespaces</span></a></li> 12 <li><a href="namespaces.html"><span>Namespaces</span></a></li>
13 <li><a href="annotated.html"><span>Classes</span></a></li> 13 <li><a href="annotated.html"><span>Classes</span></a></li>
14 <li class="current"><a href="files.html"><span>Files</span></a></li> 14 <li class="current"><a href="files.html"><span>Files</span></a></li>
15 <li><a href="dirs.html"><span>Directories</span></a></li> 15 <li><a href="dirs.html"><span>Directories</span></a></li>
16 </ul>
17 </div>
18 <div class="tabs">
19 <ul>
20 <li><a href="files.html"><span>File&nbsp;List</span></a></li>
21 <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
16 </ul> 22 </ul>
17 </div> 23 </div>
18 <div class="navpath"><a class="el" href="dir_35887283b966ca996e4ff77f459c38ce.html">examples</a> 24 <div class="navpath"><a class="el" href="dir_35887283b966ca996e4ff77f459c38ce.html">examples</a>
19 </div> 25 </div>
20 </div> 26 </div>
25 <a name="l00004"></a>00004 <span class="comment"> Vamp</span> 31 <a name="l00004"></a>00004 <span class="comment"> Vamp</span>
26 <a name="l00005"></a>00005 <span class="comment"></span> 32 <a name="l00005"></a>00005 <span class="comment"></span>
27 <a name="l00006"></a>00006 <span class="comment"> An API for audio analysis and feature extraction plugins.</span> 33 <a name="l00006"></a>00006 <span class="comment"> An API for audio analysis and feature extraction plugins.</span>
28 <a name="l00007"></a>00007 <span class="comment"></span> 34 <a name="l00007"></a>00007 <span class="comment"></span>
29 <a name="l00008"></a>00008 <span class="comment"> Centre for Digital Music, Queen Mary, University of London.</span> 35 <a name="l00008"></a>00008 <span class="comment"> Centre for Digital Music, Queen Mary, University of London.</span>
30 <a name="l00009"></a>00009 <span class="comment"> Copyright 2006-2008 Chris Cannam and QMUL.</span> 36 <a name="l00009"></a>00009 <span class="comment"> Copyright 2006-2009 Chris Cannam and QMUL.</span>
31 <a name="l00010"></a>00010 <span class="comment"> </span> 37 <a name="l00010"></a>00010 <span class="comment"> </span>
32 <a name="l00011"></a>00011 <span class="comment"> Permission is hereby granted, free of charge, to any person</span> 38 <a name="l00011"></a>00011 <span class="comment"> Permission is hereby granted, free of charge, to any person</span>
33 <a name="l00012"></a>00012 <span class="comment"> obtaining a copy of this software and associated documentation</span> 39 <a name="l00012"></a>00012 <span class="comment"> obtaining a copy of this software and associated documentation</span>
34 <a name="l00013"></a>00013 <span class="comment"> files (the "Software"), to deal in the Software without</span> 40 <a name="l00013"></a>00013 <span class="comment"> files (the "Software"), to deal in the Software without</span>
35 <a name="l00014"></a>00014 <span class="comment"> restriction, including without limitation the rights to use, copy,</span> 41 <a name="l00014"></a>00014 <span class="comment"> restriction, including without limitation the rights to use, copy,</span>
69 <a name="l00048"></a>00048 75 <a name="l00048"></a>00048
70 <a name="l00049"></a><a class="code" href="classFixedTempoEstimator_1_1D.html">00049</a> <span class="keyword">class </span><a class="code" href="classFixedTempoEstimator_1_1D.html">FixedTempoEstimator::D</a> 76 <a name="l00049"></a><a class="code" href="classFixedTempoEstimator_1_1D.html">00049</a> <span class="keyword">class </span><a class="code" href="classFixedTempoEstimator_1_1D.html">FixedTempoEstimator::D</a>
71 <a name="l00050"></a>00050 <span class="comment">// this class just avoids us having to declare any data members in the header</span> 77 <a name="l00050"></a>00050 <span class="comment">// this class just avoids us having to declare any data members in the header</span>
72 <a name="l00051"></a>00051 { 78 <a name="l00051"></a>00051 {
73 <a name="l00052"></a>00052 <span class="keyword">public</span>: 79 <a name="l00052"></a>00052 <span class="keyword">public</span>:
74 <a name="l00053"></a>00053 <a class="code" href="classFixedTempoEstimator_1_1D.html#104a9b64d47eca678844584f69ca0b9d">D</a>(<span class="keywordtype">float</span> inputSampleRate); 80 <a name="l00053"></a>00053 <a class="code" href="classFixedTempoEstimator_1_1D.html#0402c780eb7c04cca2c564881c83c877">D</a>(<span class="keywordtype">float</span> inputSampleRate);
75 <a name="l00054"></a>00054 <a class="code" href="classFixedTempoEstimator_1_1D.html#78a63ac8bbf342cb0405747871adf4cc">~D</a>(); 81 <a name="l00054"></a>00054 <a class="code" href="classFixedTempoEstimator_1_1D.html#3fa9243f5a6b2a001e4f4bd4172444a0">~D</a>();
76 <a name="l00055"></a>00055 82 <a name="l00055"></a>00055
77 <a name="l00056"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#dd749be18355ab1ae5c1ccbacfd2e192">00056</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#dd749be18355ab1ae5c1ccbacfd2e192">getPreferredStepSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 64; } 83 <a name="l00056"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#1c9af63373d85e250d56546fff83d2b6">00056</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#1c9af63373d85e250d56546fff83d2b6">getPreferredStepSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 64; }
78 <a name="l00057"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#c02826f981736fc2aa5d835fa14e174d">00057</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#c02826f981736fc2aa5d835fa14e174d">getPreferredBlockSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 256; } 84 <a name="l00057"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#39b70f63c405045398b1cd3ce7ff5d2b">00057</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#39b70f63c405045398b1cd3ce7ff5d2b">getPreferredBlockSize</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 256; }
79 <a name="l00058"></a>00058 85 <a name="l00058"></a>00058
80 <a name="l00059"></a>00059 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">ParameterList</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#06fcf80a9a22c4b90abbc88eb592621a">getParameterDescriptors</a>() <span class="keyword">const</span>; 86 <a name="l00059"></a>00059 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">ParameterList</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#8030d29905a31a20b9019e5dfc388628">getParameterDescriptors</a>() <span class="keyword">const</span>;
81 <a name="l00060"></a>00060 <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#968ef2e555c81e4a3bde89d19fafb31a">getParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>) <span class="keyword">const</span>; 87 <a name="l00060"></a>00060 <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#3e1950da43d6c57b9e9577afb715c338">getParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>) <span class="keyword">const</span>;
82 <a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#6cafa64d4cc8aa3556bc0ce6b0c49bc4">setParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>, <span class="keywordtype">float</span> value); 88 <a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#f66a1106a170c11da1bb24ad54a27ea9">setParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>, <span class="keywordtype">float</span> value);
83 <a name="l00062"></a>00062 89 <a name="l00062"></a>00062
84 <a name="l00063"></a>00063 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#7ce98af800f36045a0dae4b1dbed943f">getOutputDescriptors</a>() <span class="keyword">const</span>; 90 <a name="l00063"></a>00063 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#833b2a87b05ff7cf2852bd37c8d4a09f">getOutputDescriptors</a>() <span class="keyword">const</span>;
85 <a name="l00064"></a>00064 91 <a name="l00064"></a>00064
86 <a name="l00065"></a>00065 <span class="keywordtype">bool</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#f0fcad4493650728babb7e341963c91d">initialise</a>(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize); 92 <a name="l00065"></a>00065 <span class="keywordtype">bool</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#c15e4b26e8a7bc4b53b04bffbe46d65a">initialise</a>(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize);
87 <a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#f5ac8147bfe79371d00aba8a19c2f8fd">reset</a>(); 93 <a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#e2188bc79ddc978b548267a38329527b">reset</a>();
88 <a name="l00067"></a>00067 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#7fac74fc9fc54f436408705d1e125e20">process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a>); 94 <a name="l00067"></a>00067 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#80c7b0f36183d0b595ff482e9096eca1">process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a>);
89 <a name="l00068"></a>00068 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#7f9c3603bb3374d6936885010dbdd82b">getRemainingFeatures</a>(); 95 <a name="l00068"></a>00068 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#0023f5babc813266d60b7916faf019ff">getRemainingFeatures</a>();
90 <a name="l00069"></a>00069 96 <a name="l00069"></a>00069
91 <a name="l00070"></a>00070 <span class="keyword">private</span>: 97 <a name="l00070"></a>00070 <span class="keyword">private</span>:
92 <a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#4f2cbc11fba5bc8af3fd2a0078156091">calculate</a>(); 98 <a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#5f89ac783061563c73dc684ea073cde6">calculate</a>();
93 <a name="l00072"></a>00072 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#20389ba1515f6ce4181d3f41e5c4f347">assembleFeatures</a>(); 99 <a name="l00072"></a>00072 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#29ca062e20df30685c5478b7a68a9a9b">assembleFeatures</a>();
94 <a name="l00073"></a>00073 100 <a name="l00073"></a>00073
95 <a name="l00074"></a>00074 <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(<span class="keywordtype">int</span>); 101 <a name="l00074"></a>00074 <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(<span class="keywordtype">int</span>);
96 <a name="l00075"></a>00075 <span class="keywordtype">int</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#c6a75212293fc855de6ed0c6581a0fb9">tempo2lag</a>(<span class="keywordtype">float</span>); 102 <a name="l00075"></a>00075 <span class="keywordtype">int</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#406aacbd334ef8c4ae40ea8280918f97">tempo2lag</a>(<span class="keywordtype">float</span>);
97 <a name="l00076"></a>00076 103 <a name="l00076"></a>00076
98 <a name="l00077"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">00077</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>; 104 <a name="l00077"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">00077</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>;
99 <a name="l00078"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">00078</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>; 105 <a name="l00078"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">00078</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>;
100 <a name="l00079"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">00079</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">m_blockSize</a>; 106 <a name="l00079"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">00079</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">m_blockSize</a>;
101 <a name="l00080"></a>00080 107 <a name="l00080"></a>00080
102 <a name="l00081"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#768fdbb62e4b21a39897963fdbd486ed">00081</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#768fdbb62e4b21a39897963fdbd486ed">m_minbpm</a>; 108 <a name="l00081"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#0d0e9ff333c6e0e85d2069b730f0f1c2">00081</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#0d0e9ff333c6e0e85d2069b730f0f1c2">m_minbpm</a>;
103 <a name="l00082"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#33e8d045b222addc6173b50df2553ba8">00082</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#33e8d045b222addc6173b50df2553ba8">m_maxbpm</a>; 109 <a name="l00082"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#42f27eb3f218cf57c71b278d5ffd2d8d">00082</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#42f27eb3f218cf57c71b278d5ffd2d8d">m_maxbpm</a>;
104 <a name="l00083"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#ca506973452865d436e07462eabdebad">00083</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#ca506973452865d436e07462eabdebad">m_maxdflen</a>; 110 <a name="l00083"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#fd6ed6bd0ccf828938f3a995757de3b8">00083</a> <span class="keywordtype">float</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#fd6ed6bd0ccf828938f3a995757de3b8">m_maxdflen</a>;
105 <a name="l00084"></a>00084 111 <a name="l00084"></a>00084
106 <a name="l00085"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">00085</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>; 112 <a name="l00085"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">00085</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>;
107 <a name="l00086"></a>00086 113 <a name="l00086"></a>00086
108 <a name="l00087"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">00087</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>; 114 <a name="l00087"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">00087</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>;
109 <a name="l00088"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">00088</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>; 115 <a name="l00088"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">00088</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>;
110 <a name="l00089"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">00089</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>; 116 <a name="l00089"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">00089</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>;
111 <a name="l00090"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">00090</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>; 117 <a name="l00090"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">00090</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>;
112 <a name="l00091"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">00091</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>; 118 <a name="l00091"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">00091</a> <span class="keywordtype">float</span> *<a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>;
113 <a name="l00092"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">00092</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>; 119 <a name="l00092"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">00092</a> <span class="keywordtype">size_t</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>;
114 <a name="l00093"></a>00093 120 <a name="l00093"></a>00093
115 <a name="l00094"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">00094</a> <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">Vamp::RealTime</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a>; 121 <a name="l00094"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">00094</a> <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">Vamp::RealTime</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a>;
116 <a name="l00095"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#bacd5ff19c301020efb99c03136b849a">00095</a> <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">Vamp::RealTime</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#bacd5ff19c301020efb99c03136b849a">m_lasttime</a>; 122 <a name="l00095"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#0043d3c082b20a1506ecf3fbaac5abf8">00095</a> <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">Vamp::RealTime</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#0043d3c082b20a1506ecf3fbaac5abf8">m_lasttime</a>;
117 <a name="l00096"></a>00096 }; 123 <a name="l00096"></a>00096 };
118 <a name="l00097"></a>00097 124 <a name="l00097"></a>00097
119 <a name="l00098"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#104a9b64d47eca678844584f69ca0b9d">00098</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#104a9b64d47eca678844584f69ca0b9d">FixedTempoEstimator::D::D</a>(<span class="keywordtype">float</span> inputSampleRate) : 125 <a name="l00098"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#0402c780eb7c04cca2c564881c83c877">00098</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#0402c780eb7c04cca2c564881c83c877">FixedTempoEstimator::D::D</a>(<span class="keywordtype">float</span> inputSampleRate) :
120 <a name="l00099"></a>00099 m_inputSampleRate(inputSampleRate), 126 <a name="l00099"></a>00099 m_inputSampleRate(inputSampleRate),
121 <a name="l00100"></a>00100 m_stepSize(0), 127 <a name="l00100"></a>00100 m_stepSize(0),
122 <a name="l00101"></a>00101 m_blockSize(0), 128 <a name="l00101"></a>00101 m_blockSize(0),
123 <a name="l00102"></a>00102 m_minbpm(50), 129 <a name="l00102"></a>00102 m_minbpm(50),
124 <a name="l00103"></a>00103 m_maxbpm(190), 130 <a name="l00103"></a>00103 m_maxbpm(190),
130 <a name="l00109"></a>00109 m_t(0), 136 <a name="l00109"></a>00109 m_t(0),
131 <a name="l00110"></a>00110 m_n(0) 137 <a name="l00110"></a>00110 m_n(0)
132 <a name="l00111"></a>00111 { 138 <a name="l00111"></a>00111 {
133 <a name="l00112"></a>00112 } 139 <a name="l00112"></a>00112 }
134 <a name="l00113"></a>00113 140 <a name="l00113"></a>00113
135 <a name="l00114"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#78a63ac8bbf342cb0405747871adf4cc">00114</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#78a63ac8bbf342cb0405747871adf4cc">FixedTempoEstimator::D::~D</a>() 141 <a name="l00114"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#3fa9243f5a6b2a001e4f4bd4172444a0">00114</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#3fa9243f5a6b2a001e4f4bd4172444a0">FixedTempoEstimator::D::~D</a>()
136 <a name="l00115"></a>00115 { 142 <a name="l00115"></a>00115 {
137 <a name="l00116"></a>00116 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>; 143 <a name="l00116"></a>00116 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>;
138 <a name="l00117"></a>00117 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>; 144 <a name="l00117"></a>00117 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>;
139 <a name="l00118"></a>00118 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>; 145 <a name="l00118"></a>00118 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>;
140 <a name="l00119"></a>00119 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>; 146 <a name="l00119"></a>00119 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>;
141 <a name="l00120"></a>00120 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>; 147 <a name="l00120"></a>00120 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>;
142 <a name="l00121"></a>00121 } 148 <a name="l00121"></a>00121 }
143 <a name="l00122"></a>00122 149 <a name="l00122"></a>00122
144 <a name="l00123"></a>00123 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">FixedTempoEstimator::ParameterList</a> 150 <a name="l00123"></a>00123 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">FixedTempoEstimator::ParameterList</a>
145 <a name="l00124"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#06fcf80a9a22c4b90abbc88eb592621a">00124</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#06fcf80a9a22c4b90abbc88eb592621a">FixedTempoEstimator::D::getParameterDescriptors</a>()<span class="keyword"> const</span> 151 <a name="l00124"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#8030d29905a31a20b9019e5dfc388628">00124</a> <a class="code" href="classFixedTempoEstimator.html#e157465a4e07d180bab05b5c3a4d8987" title="Get the controllable parameters of this plugin.">FixedTempoEstimator::D::getParameterDescriptors</a>()<span class="keyword"> const</span>
146 <a name="l00125"></a>00125 <span class="keyword"></span>{ 152 <a name="l00125"></a>00125 <span class="keyword"></span>{
147 <a name="l00126"></a>00126 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">ParameterList</a> list; 153 <a name="l00126"></a>00126 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">ParameterList</a> list;
148 <a name="l00127"></a>00127 154 <a name="l00127"></a>00127
149 <a name="l00128"></a>00128 <a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html">ParameterDescriptor</a> d; 155 <a name="l00128"></a>00128 <a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html">ParameterDescriptor</a> d;
150 <a name="l00129"></a>00129 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#116fd9f0dc94c2bc4bbc60b5443c598c" title="The name of the parameter, in computer-usable form.">identifier</a> = <span class="stringliteral">"minbpm"</span>; 156 <a name="l00129"></a>00129 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b34ea7114875647281ac031021e45d06" title="The name of the parameter, in computer-usable form.">identifier</a> = <span class="stringliteral">"minbpm"</span>;
151 <a name="l00130"></a>00130 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0ecebb94fb4ada4aad2640e20aa57084" title="The human-readable name of the parameter.">name</a> = <span class="stringliteral">"Minimum estimated tempo"</span>; 157 <a name="l00130"></a>00130 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#2c1000e78a6414dab6c5af5201053741" title="The human-readable name of the parameter.">name</a> = <span class="stringliteral">"Minimum estimated tempo"</span>;
152 <a name="l00131"></a>00131 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#780ddad41e433d85c82f9ea4d959cbaf" title="A human-readable short text describing the parameter.">description</a> = <span class="stringliteral">"Minimum beat-per-minute value which the tempo estimator is able to return"</span>; 158 <a name="l00131"></a>00131 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0cbc8fe35b0d15fd8e19de2ade33d147" title="A human-readable short text describing the parameter.">description</a> = <span class="stringliteral">"Minimum beat-per-minute value which the tempo estimator is able to return"</span>;
153 <a name="l00132"></a>00132 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#3bc3df322e4c02e17e96bc6d44982d7b" title="The unit of the parameter, in human-readable form.">unit</a> = <span class="stringliteral">"bpm"</span>; 159 <a name="l00132"></a>00132 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#e0d6c74d915b99bacb55a0622e0ecb1c" title="The unit of the parameter, in human-readable form.">unit</a> = <span class="stringliteral">"bpm"</span>;
154 <a name="l00133"></a>00133 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b3e4d84f5bc199eea8b642b27e425ec8" title="The minimum value of the parameter.">minValue</a> = 10; 160 <a name="l00133"></a>00133 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#18221c4bb5c57332fe6a1393c5ec3b6d" title="The minimum value of the parameter.">minValue</a> = 10;
155 <a name="l00134"></a>00134 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b934b20dd708228a0e3c2811a3e2cec4" title="The maximum value of the parameter.">maxValue</a> = 360; 161 <a name="l00134"></a>00134 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#52e0c1f0acfc7ff8622ca1ccc97ad69d" title="The maximum value of the parameter.">maxValue</a> = 360;
156 <a name="l00135"></a>00135 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#ec4ef77451ec02193ecc4a0856673fbc" title="The default value of the parameter.">defaultValue</a> = 50; 162 <a name="l00135"></a>00135 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#4b36674815777f54846bb7033205bbea" title="The default value of the parameter.">defaultValue</a> = 50;
157 <a name="l00136"></a>00136 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#7c556d58d552f737ee5a34efdf7f9425" title="True if the parameter values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">false</span>; 163 <a name="l00136"></a>00136 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#6e76a119dafbdd26351521ec486550ea" title="True if the parameter values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">false</span>;
158 <a name="l00137"></a>00137 list.push_back(d); 164 <a name="l00137"></a>00137 list.push_back(d);
159 <a name="l00138"></a>00138 165 <a name="l00138"></a>00138
160 <a name="l00139"></a>00139 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#116fd9f0dc94c2bc4bbc60b5443c598c" title="The name of the parameter, in computer-usable form.">identifier</a> = <span class="stringliteral">"maxbpm"</span>; 166 <a name="l00139"></a>00139 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b34ea7114875647281ac031021e45d06" title="The name of the parameter, in computer-usable form.">identifier</a> = <span class="stringliteral">"maxbpm"</span>;
161 <a name="l00140"></a>00140 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0ecebb94fb4ada4aad2640e20aa57084" title="The human-readable name of the parameter.">name</a> = <span class="stringliteral">"Maximum estimated tempo"</span>; 167 <a name="l00140"></a>00140 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#2c1000e78a6414dab6c5af5201053741" title="The human-readable name of the parameter.">name</a> = <span class="stringliteral">"Maximum estimated tempo"</span>;
162 <a name="l00141"></a>00141 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#780ddad41e433d85c82f9ea4d959cbaf" title="A human-readable short text describing the parameter.">description</a> = <span class="stringliteral">"Maximum beat-per-minute value which the tempo estimator is able to return"</span>; 168 <a name="l00141"></a>00141 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0cbc8fe35b0d15fd8e19de2ade33d147" title="A human-readable short text describing the parameter.">description</a> = <span class="stringliteral">"Maximum beat-per-minute value which the tempo estimator is able to return"</span>;
163 <a name="l00142"></a>00142 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#ec4ef77451ec02193ecc4a0856673fbc" title="The default value of the parameter.">defaultValue</a> = 190; 169 <a name="l00142"></a>00142 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#4b36674815777f54846bb7033205bbea" title="The default value of the parameter.">defaultValue</a> = 190;
164 <a name="l00143"></a>00143 list.push_back(d); 170 <a name="l00143"></a>00143 list.push_back(d);
165 <a name="l00144"></a>00144 171 <a name="l00144"></a>00144
166 <a name="l00145"></a>00145 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#116fd9f0dc94c2bc4bbc60b5443c598c" title="The name of the parameter, in computer-usable form.">identifier</a> = <span class="stringliteral">"maxdflen"</span>; 172 <a name="l00145"></a>00145 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b34ea7114875647281ac031021e45d06" title="The name of the parameter, in computer-usable form.">identifier</a> = <span class="stringliteral">"maxdflen"</span>;
167 <a name="l00146"></a>00146 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0ecebb94fb4ada4aad2640e20aa57084" title="The human-readable name of the parameter.">name</a> = <span class="stringliteral">"Input duration to study"</span>; 173 <a name="l00146"></a>00146 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#2c1000e78a6414dab6c5af5201053741" title="The human-readable name of the parameter.">name</a> = <span class="stringliteral">"Input duration to study"</span>;
168 <a name="l00147"></a>00147 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#780ddad41e433d85c82f9ea4d959cbaf" title="A human-readable short text describing the parameter.">description</a> = <span class="stringliteral">"Length of audio input, in seconds, which should be taken into account when estimating tempo. There is no need to supply the plugin with any further input once this time has elapsed since the start of the audio. The tempo estimator may use only the first part of this, up to eight times the slowest beat duration: increasing this value further than that is unlikely to improve results."</span>; 174 <a name="l00147"></a>00147 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#0cbc8fe35b0d15fd8e19de2ade33d147" title="A human-readable short text describing the parameter.">description</a> = <span class="stringliteral">"Length of audio input, in seconds, which should be taken into account when estimating tempo. There is no need to supply the plugin with any further input once this time has elapsed since the start of the audio. The tempo estimator may use only the first part of this, up to eight times the slowest beat duration: increasing this value further than that is unlikely to improve results."</span>;
169 <a name="l00148"></a>00148 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#3bc3df322e4c02e17e96bc6d44982d7b" title="The unit of the parameter, in human-readable form.">unit</a> = <span class="stringliteral">"s"</span>; 175 <a name="l00148"></a>00148 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#e0d6c74d915b99bacb55a0622e0ecb1c" title="The unit of the parameter, in human-readable form.">unit</a> = <span class="stringliteral">"s"</span>;
170 <a name="l00149"></a>00149 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b3e4d84f5bc199eea8b642b27e425ec8" title="The minimum value of the parameter.">minValue</a> = 2; 176 <a name="l00149"></a>00149 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#18221c4bb5c57332fe6a1393c5ec3b6d" title="The minimum value of the parameter.">minValue</a> = 2;
171 <a name="l00150"></a>00150 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#b934b20dd708228a0e3c2811a3e2cec4" title="The maximum value of the parameter.">maxValue</a> = 40; 177 <a name="l00150"></a>00150 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#52e0c1f0acfc7ff8622ca1ccc97ad69d" title="The maximum value of the parameter.">maxValue</a> = 40;
172 <a name="l00151"></a>00151 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#ec4ef77451ec02193ecc4a0856673fbc" title="The default value of the parameter.">defaultValue</a> = 10; 178 <a name="l00151"></a>00151 d.<a class="code" href="structVamp_1_1PluginBase_1_1ParameterDescriptor.html#4b36674815777f54846bb7033205bbea" title="The default value of the parameter.">defaultValue</a> = 10;
173 <a name="l00152"></a>00152 list.push_back(d); 179 <a name="l00152"></a>00152 list.push_back(d);
174 <a name="l00153"></a>00153 180 <a name="l00153"></a>00153
175 <a name="l00154"></a>00154 <span class="keywordflow">return</span> list; 181 <a name="l00154"></a>00154 <span class="keywordflow">return</span> list;
176 <a name="l00155"></a>00155 } 182 <a name="l00155"></a>00155 }
177 <a name="l00156"></a>00156 183 <a name="l00156"></a>00156
178 <a name="l00157"></a>00157 <span class="keywordtype">float</span> 184 <a name="l00157"></a>00157 <span class="keywordtype">float</span>
179 <a name="l00158"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#968ef2e555c81e4a3bde89d19fafb31a">00158</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#968ef2e555c81e4a3bde89d19fafb31a">FixedTempoEstimator::D::getParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>)<span class="keyword"> const</span> 185 <a name="l00158"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#3e1950da43d6c57b9e9577afb715c338">00158</a> <a class="code" href="classFixedTempoEstimator.html#2030b05fb1228b30ace16200780c9152" title="Get the value of a named parameter.">FixedTempoEstimator::D::getParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>)<span class="keyword"> const</span>
180 <a name="l00159"></a>00159 <span class="keyword"></span>{ 186 <a name="l00159"></a>00159 <span class="keyword"></span>{
181 <a name="l00160"></a>00160 <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"minbpm"</span>) { 187 <a name="l00160"></a>00160 <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"minbpm"</span>) {
182 <a name="l00161"></a>00161 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#768fdbb62e4b21a39897963fdbd486ed">m_minbpm</a>; 188 <a name="l00161"></a>00161 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#0d0e9ff333c6e0e85d2069b730f0f1c2">m_minbpm</a>;
183 <a name="l00162"></a>00162 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxbpm"</span>) { 189 <a name="l00162"></a>00162 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxbpm"</span>) {
184 <a name="l00163"></a>00163 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#33e8d045b222addc6173b50df2553ba8">m_maxbpm</a>; 190 <a name="l00163"></a>00163 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#42f27eb3f218cf57c71b278d5ffd2d8d">m_maxbpm</a>;
185 <a name="l00164"></a>00164 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxdflen"</span>) { 191 <a name="l00164"></a>00164 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxdflen"</span>) {
186 <a name="l00165"></a>00165 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#ca506973452865d436e07462eabdebad">m_maxdflen</a>; 192 <a name="l00165"></a>00165 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator_1_1D.html#fd6ed6bd0ccf828938f3a995757de3b8">m_maxdflen</a>;
187 <a name="l00166"></a>00166 } 193 <a name="l00166"></a>00166 }
188 <a name="l00167"></a>00167 <span class="keywordflow">return</span> 0.f; 194 <a name="l00167"></a>00167 <span class="keywordflow">return</span> 0.f;
189 <a name="l00168"></a>00168 } 195 <a name="l00168"></a>00168 }
190 <a name="l00169"></a>00169 196 <a name="l00169"></a>00169
191 <a name="l00170"></a>00170 <span class="keywordtype">void</span> 197 <a name="l00170"></a>00170 <span class="keywordtype">void</span>
192 <a name="l00171"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#6cafa64d4cc8aa3556bc0ce6b0c49bc4">00171</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#6cafa64d4cc8aa3556bc0ce6b0c49bc4">FixedTempoEstimator::D::setParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>, <span class="keywordtype">float</span> value) 198 <a name="l00171"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#f66a1106a170c11da1bb24ad54a27ea9">00171</a> <a class="code" href="classFixedTempoEstimator.html#8a5a413025384cf451c64d2c2ce13a75" title="Set a named parameter.">FixedTempoEstimator::D::setParameter</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>, <span class="keywordtype">float</span> value)
193 <a name="l00172"></a>00172 { 199 <a name="l00172"></a>00172 {
194 <a name="l00173"></a>00173 <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"minbpm"</span>) { 200 <a name="l00173"></a>00173 <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"minbpm"</span>) {
195 <a name="l00174"></a>00174 <a class="code" href="classFixedTempoEstimator_1_1D.html#768fdbb62e4b21a39897963fdbd486ed">m_minbpm</a> = value; 201 <a name="l00174"></a>00174 <a class="code" href="classFixedTempoEstimator_1_1D.html#0d0e9ff333c6e0e85d2069b730f0f1c2">m_minbpm</a> = value;
196 <a name="l00175"></a>00175 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxbpm"</span>) { 202 <a name="l00175"></a>00175 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxbpm"</span>) {
197 <a name="l00176"></a>00176 <a class="code" href="classFixedTempoEstimator_1_1D.html#33e8d045b222addc6173b50df2553ba8">m_maxbpm</a> = value; 203 <a name="l00176"></a>00176 <a class="code" href="classFixedTempoEstimator_1_1D.html#42f27eb3f218cf57c71b278d5ffd2d8d">m_maxbpm</a> = value;
198 <a name="l00177"></a>00177 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxdflen"</span>) { 204 <a name="l00177"></a>00177 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == <span class="stringliteral">"maxdflen"</span>) {
199 <a name="l00178"></a>00178 <a class="code" href="classFixedTempoEstimator_1_1D.html#ca506973452865d436e07462eabdebad">m_maxdflen</a> = value; 205 <a name="l00178"></a>00178 <a class="code" href="classFixedTempoEstimator_1_1D.html#fd6ed6bd0ccf828938f3a995757de3b8">m_maxdflen</a> = value;
200 <a name="l00179"></a>00179 } 206 <a name="l00179"></a>00179 }
201 <a name="l00180"></a>00180 } 207 <a name="l00180"></a>00180 }
202 <a name="l00181"></a>00181 208 <a name="l00181"></a>00181
203 <a name="l00182"></a><a class="code" href="FixedTempoEstimator_8cpp.html#7a8511e62dffb5334ad3b70d57b2fcee">00182</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#7a8511e62dffb5334ad3b70d57b2fcee">TempoOutput</a> = 0; 209 <a name="l00182"></a><a class="code" href="FixedTempoEstimator_8cpp.html#7a8511e62dffb5334ad3b70d57b2fcee">00182</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#7a8511e62dffb5334ad3b70d57b2fcee">TempoOutput</a> = 0;
204 <a name="l00183"></a><a class="code" href="FixedTempoEstimator_8cpp.html#554b16c6b7516530e52c65318bfe08eb">00183</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#554b16c6b7516530e52c65318bfe08eb">CandidatesOutput</a> = 1; 210 <a name="l00183"></a><a class="code" href="FixedTempoEstimator_8cpp.html#554b16c6b7516530e52c65318bfe08eb">00183</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#554b16c6b7516530e52c65318bfe08eb">CandidatesOutput</a> = 1;
205 <a name="l00184"></a><a class="code" href="FixedTempoEstimator_8cpp.html#caa4524f29afce03c812a88ff31159c1">00184</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#caa4524f29afce03c812a88ff31159c1">DFOutput</a> = 2; 211 <a name="l00184"></a><a class="code" href="FixedTempoEstimator_8cpp.html#caa4524f29afce03c812a88ff31159c1">00184</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#caa4524f29afce03c812a88ff31159c1">DFOutput</a> = 2;
206 <a name="l00185"></a><a class="code" href="FixedTempoEstimator_8cpp.html#382c1fe740ac8911c6078cfbceffc870">00185</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#382c1fe740ac8911c6078cfbceffc870">ACFOutput</a> = 3; 212 <a name="l00185"></a><a class="code" href="FixedTempoEstimator_8cpp.html#382c1fe740ac8911c6078cfbceffc870">00185</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#382c1fe740ac8911c6078cfbceffc870">ACFOutput</a> = 3;
207 <a name="l00186"></a><a class="code" href="FixedTempoEstimator_8cpp.html#5b284021783d79785d46b043b458368d">00186</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#5b284021783d79785d46b043b458368d">FilteredACFOutput</a> = 4; 213 <a name="l00186"></a><a class="code" href="FixedTempoEstimator_8cpp.html#5b284021783d79785d46b043b458368d">00186</a> <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="FixedTempoEstimator_8cpp.html#5b284021783d79785d46b043b458368d">FilteredACFOutput</a> = 4;
208 <a name="l00187"></a>00187 214 <a name="l00187"></a>00187
209 <a name="l00188"></a>00188 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">FixedTempoEstimator::OutputList</a> 215 <a name="l00188"></a>00188 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">FixedTempoEstimator::OutputList</a>
210 <a name="l00189"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#7ce98af800f36045a0dae4b1dbed943f">00189</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#7ce98af800f36045a0dae4b1dbed943f">FixedTempoEstimator::D::getOutputDescriptors</a>()<span class="keyword"> const</span> 216 <a name="l00189"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#833b2a87b05ff7cf2852bd37c8d4a09f">00189</a> <a class="code" href="classFixedTempoEstimator.html#83121c205a723fe6297e2bf8870622a4" title="Get the outputs of this plugin.">FixedTempoEstimator::D::getOutputDescriptors</a>()<span class="keyword"> const</span>
211 <a name="l00190"></a>00190 <span class="keyword"></span>{ 217 <a name="l00190"></a>00190 <span class="keyword"></span>{
212 <a name="l00191"></a>00191 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> list; 218 <a name="l00191"></a>00191 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">OutputList</a> list;
213 <a name="l00192"></a>00192 219 <a name="l00192"></a>00192
214 <a name="l00193"></a>00193 <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html">OutputDescriptor</a> d; 220 <a name="l00193"></a>00193 <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html">OutputDescriptor</a> d;
215 <a name="l00194"></a>00194 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"tempo"</span>; 221 <a name="l00194"></a>00194 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"tempo"</span>;
216 <a name="l00195"></a>00195 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Tempo"</span>; 222 <a name="l00195"></a>00195 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Tempo"</span>;
217 <a name="l00196"></a>00196 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Estimated tempo"</span>; 223 <a name="l00196"></a>00196 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Estimated tempo"</span>;
218 <a name="l00197"></a>00197 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"bpm"</span>; 224 <a name="l00197"></a>00197 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"bpm"</span>;
219 <a name="l00198"></a>00198 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">true</span>; 225 <a name="l00198"></a>00198 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0653d3a85fdc226e60fd5e612b399e0c" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">true</span>;
220 <a name="l00199"></a>00199 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> = 1; 226 <a name="l00199"></a>00199 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#238a4781ebb4151832cbf521feb0fedc" title="The number of values per result of the output.">binCount</a> = 1;
221 <a name="l00200"></a>00200 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e9ccb65f99f477096b65dd031f4c5e31" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">false</span>; 227 <a name="l00200"></a>00200 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#4b8d0d88bee613709e91b48402e28c8e" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">false</span>;
222 <a name="l00201"></a>00201 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#1b4858928d23bfd7d5bc557c82a83fb4" title="True if the output values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">false</span>; 228 <a name="l00201"></a>00201 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#43673cd31b2b65af427a8e8b8746b6e8" title="True if the output values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">false</span>;
223 <a name="l00202"></a>00202 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448cdea995a737867f7b22b52f1c43c5432e" title="Results are unevenly spaced and have individual timestamps.">OutputDescriptor::VariableSampleRate</a>; 229 <a name="l00202"></a>00202 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3cd2e0b7a6da19c32bbb6809a83d9adf" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c95be613508cf4009a7dc2f70ddf99547" title="Results are unevenly spaced and have individual timestamps.">OutputDescriptor::VariableSampleRate</a>;
224 <a name="l00203"></a>00203 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#dd0cbbdfa9c91764037c39365b1d42af" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>; 230 <a name="l00203"></a>00203 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e49cc87dcb0f09b59feb85d2b78e80ef" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>;
225 <a name="l00204"></a>00204 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b0d7cc6ab19e53b5bd12ee234f549ea3" title="True if the returned results for this output are known to have a duration field.">hasDuration</a> = <span class="keyword">true</span>; <span class="comment">// our returned tempo spans a certain range</span> 231 <a name="l00204"></a>00204 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#93cc15894c89a142741c2bd088cdd6af" title="True if the returned results for this output are known to have a duration field.">hasDuration</a> = <span class="keyword">true</span>; <span class="comment">// our returned tempo spans a certain range</span>
226 <a name="l00205"></a>00205 list.push_back(d); 232 <a name="l00205"></a>00205 list.push_back(d);
227 <a name="l00206"></a>00206 233 <a name="l00206"></a>00206
228 <a name="l00207"></a>00207 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"candidates"</span>; 234 <a name="l00207"></a>00207 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"candidates"</span>;
229 <a name="l00208"></a>00208 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Tempo candidates"</span>; 235 <a name="l00208"></a>00208 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Tempo candidates"</span>;
230 <a name="l00209"></a>00209 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Possible tempo estimates, one per bin with the most likely in the first bin"</span>; 236 <a name="l00209"></a>00209 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Possible tempo estimates, one per bin with the most likely in the first bin"</span>;
231 <a name="l00210"></a>00210 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"bpm"</span>; 237 <a name="l00210"></a>00210 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"bpm"</span>;
232 <a name="l00211"></a>00211 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">false</span>; 238 <a name="l00211"></a>00211 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0653d3a85fdc226e60fd5e612b399e0c" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = <span class="keyword">false</span>;
233 <a name="l00212"></a>00212 list.push_back(d); 239 <a name="l00212"></a>00212 list.push_back(d);
234 <a name="l00213"></a>00213 240 <a name="l00213"></a>00213
235 <a name="l00214"></a>00214 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"detectionfunction"</span>; 241 <a name="l00214"></a>00214 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"detectionfunction"</span>;
236 <a name="l00215"></a>00215 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Detection Function"</span>; 242 <a name="l00215"></a>00215 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Detection Function"</span>;
237 <a name="l00216"></a>00216 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Onset detection function"</span>; 243 <a name="l00216"></a>00216 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Onset detection function"</span>;
238 <a name="l00217"></a>00217 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">""</span>; 244 <a name="l00217"></a>00217 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">""</span>;
239 <a name="l00218"></a>00218 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f0e577e1a256ff6eed6ea42133fec77d" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = 1; 245 <a name="l00218"></a>00218 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0653d3a85fdc226e60fd5e612b399e0c" title="True if the output has the same number of values per sample for every output sample...">hasFixedBinCount</a> = 1;
240 <a name="l00219"></a>00219 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#fdd006959a995e40ef7d565a3a4df6dc" title="The number of values per result of the output.">binCount</a> = 1; 246 <a name="l00219"></a>00219 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#238a4781ebb4151832cbf521feb0fedc" title="The number of values per result of the output.">binCount</a> = 1;
241 <a name="l00220"></a>00220 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e9ccb65f99f477096b65dd031f4c5e31" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">true</span>; 247 <a name="l00220"></a>00220 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#4b8d0d88bee613709e91b48402e28c8e" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">true</span>;
242 <a name="l00221"></a>00221 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#c9f5924c0be7571bba8e7ae7e7a921f4" title="Minimum value of the results in the output.">minValue</a> = 0.0; 248 <a name="l00221"></a>00221 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#1fc73936c43014393918fe6cce46ac6d" title="Minimum value of the results in the output.">minValue</a> = 0.0;
243 <a name="l00222"></a>00222 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#907b4e8fbb48a46ac5a05f880d72719f" title="Maximum value of the results in the output.">maxValue</a> = 1.0; 249 <a name="l00222"></a>00222 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0df82ce301ad1bc337a272cb730426cf" title="Maximum value of the results in the output.">maxValue</a> = 1.0;
244 <a name="l00223"></a>00223 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#1b4858928d23bfd7d5bc557c82a83fb4" title="True if the output values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">false</span>; 250 <a name="l00223"></a>00223 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#43673cd31b2b65af427a8e8b8746b6e8" title="True if the output values are quantized to a particular resolution.">isQuantized</a> = <span class="keyword">false</span>;
245 <a name="l00224"></a>00224 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3bed37153067b625b95acb40b60dbf0b" title="Quantization resolution of the output values (e.g.">quantizeStep</a> = 0.0; 251 <a name="l00224"></a>00224 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#674cd333889514cf8408c18762fede12" title="Quantization resolution of the output values (e.g.">quantizeStep</a> = 0.0;
246 <a name="l00225"></a>00225 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0d1194980d44e31b25ef3b4b070d6b5d" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448c4c74bd2fc96dfe2815623f94b40e5629" title="Results are evenly spaced in time (sampleRate specified below).">OutputDescriptor::FixedSampleRate</a>; 252 <a name="l00225"></a>00225 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#3cd2e0b7a6da19c32bbb6809a83d9adf" title="Positioning in time of the output results.">sampleType</a> = <a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#bffa9ed50cd756df70fd51f0355f448cecfd91605a3f11c716e822dc696c27a3" title="Results are evenly spaced in time (sampleRate specified below).">OutputDescriptor::FixedSampleRate</a>;
247 <a name="l00226"></a>00226 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>) { 253 <a name="l00226"></a>00226 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>) {
248 <a name="l00227"></a>00227 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#dd0cbbdfa9c91764037c39365b1d42af" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a> / <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>; 254 <a name="l00227"></a>00227 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e49cc87dcb0f09b59feb85d2b78e80ef" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a> / <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>;
249 <a name="l00228"></a>00228 } <span class="keywordflow">else</span> { 255 <a name="l00228"></a>00228 } <span class="keywordflow">else</span> {
250 <a name="l00229"></a>00229 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#dd0cbbdfa9c91764037c39365b1d42af" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a> / (<a class="code" href="classFixedTempoEstimator_1_1D.html#c02826f981736fc2aa5d835fa14e174d">getPreferredBlockSize</a>()/2); 256 <a name="l00229"></a>00229 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e49cc87dcb0f09b59feb85d2b78e80ef" title="Sample rate of the output results, as samples per second.">sampleRate</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a> / (<a class="code" href="classFixedTempoEstimator_1_1D.html#39b70f63c405045398b1cd3ce7ff5d2b">getPreferredBlockSize</a>()/2);
251 <a name="l00230"></a>00230 } 257 <a name="l00230"></a>00230 }
252 <a name="l00231"></a>00231 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b0d7cc6ab19e53b5bd12ee234f549ea3" title="True if the returned results for this output are known to have a duration field.">hasDuration</a> = <span class="keyword">false</span>; 258 <a name="l00231"></a>00231 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#93cc15894c89a142741c2bd088cdd6af" title="True if the returned results for this output are known to have a duration field.">hasDuration</a> = <span class="keyword">false</span>;
253 <a name="l00232"></a>00232 list.push_back(d); 259 <a name="l00232"></a>00232 list.push_back(d);
254 <a name="l00233"></a>00233 260 <a name="l00233"></a>00233
255 <a name="l00234"></a>00234 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"acf"</span>; 261 <a name="l00234"></a>00234 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"acf"</span>;
256 <a name="l00235"></a>00235 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Autocorrelation Function"</span>; 262 <a name="l00235"></a>00235 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Autocorrelation Function"</span>;
257 <a name="l00236"></a>00236 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Autocorrelation of onset detection function"</span>; 263 <a name="l00236"></a>00236 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Autocorrelation of onset detection function"</span>;
258 <a name="l00237"></a>00237 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e9ccb65f99f477096b65dd031f4c5e31" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">false</span>; 264 <a name="l00237"></a>00237 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#4b8d0d88bee613709e91b48402e28c8e" title="True if the results in each output bin fall within a fixed numeric range (minimum...">hasKnownExtents</a> = <span class="keyword">false</span>;
259 <a name="l00238"></a>00238 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"r"</span>; 265 <a name="l00238"></a>00238 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"r"</span>;
260 <a name="l00239"></a>00239 list.push_back(d); 266 <a name="l00239"></a>00239 list.push_back(d);
261 <a name="l00240"></a>00240 267 <a name="l00240"></a>00240
262 <a name="l00241"></a>00241 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#e2c893ddb1860589517ab7eaa989a18b" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"filtered_acf"</span>; 268 <a name="l00241"></a>00241 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#2e6f77bcb12d4c95da25348ac85b8696" title="The name of the output, in computer-usable form.">identifier</a> = <span class="stringliteral">"filtered_acf"</span>;
263 <a name="l00242"></a>00242 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#b824b2b34ee50f897a30901c620e8d87" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Filtered Autocorrelation"</span>; 269 <a name="l00242"></a>00242 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#0992e05ea70425878365ba85663400a7" title="The human-readable name of the output.">name</a> = <span class="stringliteral">"Filtered Autocorrelation"</span>;
264 <a name="l00243"></a>00243 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#f9b4fe8f78e7126ead820ba5dc55efd1" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Filtered autocorrelation of onset detection function"</span>; 270 <a name="l00243"></a>00243 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#8b44602d8ccea8bb862fd766e74efa1c" title="A human-readable short text describing the output.">description</a> = <span class="stringliteral">"Filtered autocorrelation of onset detection function"</span>;
265 <a name="l00244"></a>00244 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#a057a8833fa037f06ac9f7b85b85d5e4" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"r"</span>; 271 <a name="l00244"></a>00244 d.<a class="code" href="structVamp_1_1Plugin_1_1OutputDescriptor.html#52f4b3d8d7070cc9c5ab4aa6ff0c01a0" title="The unit of the output, in human-readable form.">unit</a> = <span class="stringliteral">"r"</span>;
266 <a name="l00245"></a>00245 list.push_back(d); 272 <a name="l00245"></a>00245 list.push_back(d);
267 <a name="l00246"></a>00246 273 <a name="l00246"></a>00246
268 <a name="l00247"></a>00247 <span class="keywordflow">return</span> list; 274 <a name="l00247"></a>00247 <span class="keywordflow">return</span> list;
269 <a name="l00248"></a>00248 } 275 <a name="l00248"></a>00248 }
270 <a name="l00249"></a>00249 276 <a name="l00249"></a>00249
271 <a name="l00250"></a>00250 <span class="keywordtype">bool</span> 277 <a name="l00250"></a>00250 <span class="keywordtype">bool</span>
272 <a name="l00251"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#f0fcad4493650728babb7e341963c91d">00251</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#f0fcad4493650728babb7e341963c91d">FixedTempoEstimator::D::initialise</a>(<span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize) 278 <a name="l00251"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#c15e4b26e8a7bc4b53b04bffbe46d65a">00251</a> <a class="code" href="classFixedTempoEstimator.html#a7500a4ffbc4653baaf5101defdb37f5" title="Initialise a plugin to prepare it for use with the given number of input channels...">FixedTempoEstimator::D::initialise</a>(<span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize)
273 <a name="l00252"></a>00252 { 279 <a name="l00252"></a>00252 {
274 <a name="l00253"></a>00253 <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a> = stepSize; 280 <a name="l00253"></a>00253 <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a> = stepSize;
275 <a name="l00254"></a>00254 <a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">m_blockSize</a> = blockSize; 281 <a name="l00254"></a>00254 <a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">m_blockSize</a> = blockSize;
276 <a name="l00255"></a>00255 282 <a name="l00255"></a>00255
277 <a name="l00256"></a>00256 <span class="keywordtype">float</span> dfLengthSecs = <a class="code" href="classFixedTempoEstimator_1_1D.html#ca506973452865d436e07462eabdebad">m_maxdflen</a>; 283 <a name="l00256"></a>00256 <span class="keywordtype">float</span> dfLengthSecs = <a class="code" href="classFixedTempoEstimator_1_1D.html#fd6ed6bd0ccf828938f3a995757de3b8">m_maxdflen</a>;
278 <a name="l00257"></a>00257 <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a> = (dfLengthSecs * <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>; 284 <a name="l00257"></a>00257 <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a> = (dfLengthSecs * <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>;
279 <a name="l00258"></a>00258 285 <a name="l00258"></a>00258
280 <a name="l00259"></a>00259 <a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[<a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">m_blockSize</a>/2]; 286 <a name="l00259"></a>00259 <a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[<a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">m_blockSize</a>/2];
281 <a name="l00260"></a>00260 <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[<a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>]; 287 <a name="l00260"></a>00260 <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[<a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>];
282 <a name="l00261"></a>00261 288 <a name="l00261"></a>00261
283 <a name="l00262"></a>00262 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">m_blockSize</a>/2; ++i) { 289 <a name="l00262"></a>00262 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">m_blockSize</a>/2; ++i) {
284 <a name="l00263"></a>00263 <a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>[i] = 0.f; 290 <a name="l00263"></a>00263 <a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>[i] = 0.f;
285 <a name="l00264"></a>00264 } 291 <a name="l00264"></a>00264 }
286 <a name="l00265"></a>00265 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>; ++i) { 292 <a name="l00265"></a>00265 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>; ++i) {
287 <a name="l00266"></a>00266 <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>[i] = 0.f; 293 <a name="l00266"></a>00266 <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>[i] = 0.f;
288 <a name="l00267"></a>00267 } 294 <a name="l00267"></a>00267 }
289 <a name="l00268"></a>00268 295 <a name="l00268"></a>00268
290 <a name="l00269"></a>00269 <a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> = 0; 296 <a name="l00269"></a>00269 <a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> = 0;
291 <a name="l00270"></a>00270 297 <a name="l00270"></a>00270
292 <a name="l00271"></a>00271 <span class="keywordflow">return</span> <span class="keyword">true</span>; 298 <a name="l00271"></a>00271 <span class="keywordflow">return</span> <span class="keyword">true</span>;
293 <a name="l00272"></a>00272 } 299 <a name="l00272"></a>00272 }
294 <a name="l00273"></a>00273 300 <a name="l00273"></a>00273
295 <a name="l00274"></a>00274 <span class="keywordtype">void</span> 301 <a name="l00274"></a>00274 <span class="keywordtype">void</span>
296 <a name="l00275"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#f5ac8147bfe79371d00aba8a19c2f8fd">00275</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#f5ac8147bfe79371d00aba8a19c2f8fd">FixedTempoEstimator::D::reset</a>() 302 <a name="l00275"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#e2188bc79ddc978b548267a38329527b">00275</a> <a class="code" href="classFixedTempoEstimator.html#c41708397255400c6682fee6c1b3d45f" title="Reset the plugin after use, to prepare it for another clean run.">FixedTempoEstimator::D::reset</a>()
297 <a name="l00276"></a>00276 { 303 <a name="l00276"></a>00276 {
298 <a name="l00277"></a>00277 <span class="keywordflow">if</span> (!<a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>) <span class="keywordflow">return</span>; 304 <a name="l00277"></a>00277 <span class="keywordflow">if</span> (!<a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>) <span class="keywordflow">return</span>;
299 <a name="l00278"></a>00278 305 <a name="l00278"></a>00278
300 <a name="l00279"></a>00279 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">m_blockSize</a>/2; ++i) { 306 <a name="l00279"></a>00279 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">m_blockSize</a>/2; ++i) {
301 <a name="l00280"></a>00280 <a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>[i] = 0.f; 307 <a name="l00280"></a>00280 <a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>[i] = 0.f;
302 <a name="l00281"></a>00281 } 308 <a name="l00281"></a>00281 }
303 <a name="l00282"></a>00282 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>; ++i) { 309 <a name="l00282"></a>00282 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>; ++i) {
304 <a name="l00283"></a>00283 <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>[i] = 0.f; 310 <a name="l00283"></a>00283 <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>[i] = 0.f;
305 <a name="l00284"></a>00284 } 311 <a name="l00284"></a>00284 }
306 <a name="l00285"></a>00285 312 <a name="l00285"></a>00285
307 <a name="l00286"></a>00286 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>; 313 <a name="l00286"></a>00286 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>;
308 <a name="l00287"></a>00287 <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a> = 0; 314 <a name="l00287"></a>00287 <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a> = 0;
309 <a name="l00288"></a>00288 315 <a name="l00288"></a>00288
310 <a name="l00289"></a>00289 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>; 316 <a name="l00289"></a>00289 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>;
311 <a name="l00290"></a>00290 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a> = 0; 317 <a name="l00290"></a>00290 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a> = 0;
312 <a name="l00291"></a>00291 318 <a name="l00291"></a>00291
313 <a name="l00292"></a>00292 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>; 319 <a name="l00292"></a>00292 <span class="keyword">delete</span>[] <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>;
314 <a name="l00293"></a>00293 <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a> = 0; 320 <a name="l00293"></a>00293 <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a> = 0;
315 <a name="l00294"></a>00294 321 <a name="l00294"></a>00294
316 <a name="l00295"></a>00295 <a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> = 0; 322 <a name="l00295"></a>00295 <a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> = 0;
317 <a name="l00296"></a>00296 323 <a name="l00296"></a>00296
318 <a name="l00297"></a>00297 <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a> = RealTime::zeroTime; 324 <a name="l00297"></a>00297 <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a> = RealTime::zeroTime;
319 <a name="l00298"></a>00298 <a class="code" href="classFixedTempoEstimator_1_1D.html#bacd5ff19c301020efb99c03136b849a">m_lasttime</a> = RealTime::zeroTime; 325 <a name="l00298"></a>00298 <a class="code" href="classFixedTempoEstimator_1_1D.html#0043d3c082b20a1506ecf3fbaac5abf8">m_lasttime</a> = RealTime::zeroTime;
320 <a name="l00299"></a>00299 } 326 <a name="l00299"></a>00299 }
321 <a name="l00300"></a>00300 327 <a name="l00300"></a>00300
322 <a name="l00301"></a>00301 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a> 328 <a name="l00301"></a>00301 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a>
323 <a name="l00302"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#7fac74fc9fc54f436408705d1e125e20">00302</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#7fac74fc9fc54f436408705d1e125e20">FixedTempoEstimator::D::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> ts) 329 <a name="l00302"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#80c7b0f36183d0b595ff482e9096eca1">00302</a> <a class="code" href="classFixedTempoEstimator.html#1cf76b0e55cf4ed3da095cffcdeaec3c" title="Process a single block of input data.">FixedTempoEstimator::D::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> ts)
324 <a name="l00303"></a>00303 { 330 <a name="l00303"></a>00303 {
325 <a name="l00304"></a>00304 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs; 331 <a name="l00304"></a>00304 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs;
326 <a name="l00305"></a>00305 332 <a name="l00305"></a>00305
327 <a name="l00306"></a>00306 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a> == 0) { 333 <a name="l00306"></a>00306 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a> == 0) {
328 <a name="l00307"></a>00307 cerr &lt;&lt; <span class="stringliteral">"ERROR: FixedTempoEstimator::process: "</span> 334 <a name="l00307"></a>00307 cerr &lt;&lt; <span class="stringliteral">"ERROR: FixedTempoEstimator::process: "</span>
329 <a name="l00308"></a>00308 &lt;&lt; <span class="stringliteral">"FixedTempoEstimator has not been initialised"</span> 335 <a name="l00308"></a>00308 &lt;&lt; <span class="stringliteral">"FixedTempoEstimator has not been initialised"</span>
330 <a name="l00309"></a>00309 &lt;&lt; endl; 336 <a name="l00309"></a>00309 &lt;&lt; endl;
331 <a name="l00310"></a>00310 <span class="keywordflow">return</span> fs; 337 <a name="l00310"></a>00310 <span class="keywordflow">return</span> fs;
332 <a name="l00311"></a>00311 } 338 <a name="l00311"></a>00311 }
333 <a name="l00312"></a>00312 339 <a name="l00312"></a>00312
334 <a name="l00313"></a>00313 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> == 0) <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a> = ts; 340 <a name="l00313"></a>00313 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> == 0) <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a> = ts;
335 <a name="l00314"></a>00314 <a class="code" href="classFixedTempoEstimator_1_1D.html#bacd5ff19c301020efb99c03136b849a">m_lasttime</a> = ts; 341 <a name="l00314"></a>00314 <a class="code" href="classFixedTempoEstimator_1_1D.html#0043d3c082b20a1506ecf3fbaac5abf8">m_lasttime</a> = ts;
336 <a name="l00315"></a>00315 342 <a name="l00315"></a>00315
337 <a name="l00316"></a>00316 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> == <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>) { 343 <a name="l00316"></a>00316 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> == <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>) {
338 <a name="l00317"></a>00317 <span class="comment">// If we have seen enough input, do the estimation and return</span> 344 <a name="l00317"></a>00317 <span class="comment">// If we have seen enough input, do the estimation and return</span>
339 <a name="l00318"></a>00318 <a class="code" href="classFixedTempoEstimator_1_1D.html#4f2cbc11fba5bc8af3fd2a0078156091">calculate</a>(); 345 <a name="l00318"></a>00318 <a class="code" href="classFixedTempoEstimator_1_1D.html#5f89ac783061563c73dc684ea073cde6">calculate</a>();
340 <a name="l00319"></a>00319 fs = <a class="code" href="classFixedTempoEstimator_1_1D.html#20389ba1515f6ce4181d3f41e5c4f347">assembleFeatures</a>(); 346 <a name="l00319"></a>00319 fs = <a class="code" href="classFixedTempoEstimator_1_1D.html#29ca062e20df30685c5478b7a68a9a9b">assembleFeatures</a>();
341 <a name="l00320"></a>00320 ++<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>; 347 <a name="l00320"></a>00320 ++<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>;
342 <a name="l00321"></a>00321 <span class="keywordflow">return</span> fs; 348 <a name="l00321"></a>00321 <span class="keywordflow">return</span> fs;
343 <a name="l00322"></a>00322 } 349 <a name="l00322"></a>00322 }
344 <a name="l00323"></a>00323 350 <a name="l00323"></a>00323
345 <a name="l00324"></a>00324 <span class="comment">// If we have seen more than enough, just discard and return!</span> 351 <a name="l00324"></a>00324 <span class="comment">// If we have seen more than enough, just discard and return!</span>
346 <a name="l00325"></a>00325 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>) <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a>(); 352 <a name="l00325"></a>00325 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>) <span class="keywordflow">return</span> <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a>();
347 <a name="l00326"></a>00326 353 <a name="l00326"></a>00326
348 <a name="l00327"></a>00327 <span class="keywordtype">float</span> value = 0.f; 354 <a name="l00327"></a>00327 <span class="keywordtype">float</span> value = 0.f;
349 <a name="l00328"></a>00328 355 <a name="l00328"></a>00328
350 <a name="l00329"></a>00329 <span class="comment">// m_df will contain an onset detection function based on the rise</span> 356 <a name="l00329"></a>00329 <span class="comment">// m_df will contain an onset detection function based on the rise</span>
351 <a name="l00330"></a>00330 <span class="comment">// in overall power from one spectral frame to the next --</span> 357 <a name="l00330"></a>00330 <span class="comment">// in overall power from one spectral frame to the next --</span>
352 <a name="l00331"></a>00331 <span class="comment">// simplistic but reasonably effective for our purposes.</span> 358 <a name="l00331"></a>00331 <span class="comment">// simplistic but reasonably effective for our purposes.</span>
353 <a name="l00332"></a>00332 359 <a name="l00332"></a>00332
354 <a name="l00333"></a>00333 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 1; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#0b9bf37e600f0564b9f305f73a9517c8">m_blockSize</a>/2; ++i) { 360 <a name="l00333"></a>00333 <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 1; i &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#d6a062426d0b8f9766e9d4da91cf7db0">m_blockSize</a>/2; ++i) {
355 <a name="l00334"></a>00334 361 <a name="l00334"></a>00334
356 <a name="l00335"></a>00335 <span class="keywordtype">float</span> real = inputBuffers[0][i*2]; 362 <a name="l00335"></a>00335 <span class="keywordtype">float</span> real = inputBuffers[0][i*2];
357 <a name="l00336"></a>00336 <span class="keywordtype">float</span> imag = inputBuffers[0][i*2 + 1]; 363 <a name="l00336"></a>00336 <span class="keywordtype">float</span> imag = inputBuffers[0][i*2 + 1];
358 <a name="l00337"></a>00337 364 <a name="l00337"></a>00337
359 <a name="l00338"></a>00338 <span class="keywordtype">float</span> sqrmag = real * real + imag * imag; 365 <a name="l00338"></a>00338 <span class="keywordtype">float</span> sqrmag = real * real + imag * imag;
360 <a name="l00339"></a>00339 value += fabsf(sqrmag - <a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>[i]); 366 <a name="l00339"></a>00339 value += fabsf(sqrmag - <a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>[i]);
361 <a name="l00340"></a>00340 367 <a name="l00340"></a>00340
362 <a name="l00341"></a>00341 <a class="code" href="classFixedTempoEstimator_1_1D.html#a59cf1cb5640a910c70884579e5d99ad">m_priorMagnitudes</a>[i] = sqrmag; 368 <a name="l00341"></a>00341 <a class="code" href="classFixedTempoEstimator_1_1D.html#abf03ffd36a8681592bb602c1b8d212f">m_priorMagnitudes</a>[i] = sqrmag;
363 <a name="l00342"></a>00342 } 369 <a name="l00342"></a>00342 }
364 <a name="l00343"></a>00343 370 <a name="l00343"></a>00343
365 <a name="l00344"></a>00344 <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>[<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>] = value; 371 <a name="l00344"></a>00344 <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>[<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>] = value;
366 <a name="l00345"></a>00345 372 <a name="l00345"></a>00345
367 <a name="l00346"></a>00346 ++<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>; 373 <a name="l00346"></a>00346 ++<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>;
368 <a name="l00347"></a>00347 <span class="keywordflow">return</span> fs; 374 <a name="l00347"></a>00347 <span class="keywordflow">return</span> fs;
369 <a name="l00348"></a>00348 } 375 <a name="l00348"></a>00348 }
370 <a name="l00349"></a>00349 376 <a name="l00349"></a>00349
371 <a name="l00350"></a>00350 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a> 377 <a name="l00350"></a>00350 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a>
372 <a name="l00351"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#7f9c3603bb3374d6936885010dbdd82b">00351</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#7f9c3603bb3374d6936885010dbdd82b">FixedTempoEstimator::D::getRemainingFeatures</a>() 378 <a name="l00351"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#0023f5babc813266d60b7916faf019ff">00351</a> <a class="code" href="classFixedTempoEstimator.html#4965cf99be77fc4d1de51e11d83936b0" title="After all blocks have been processed, calculate and return any remaining features...">FixedTempoEstimator::D::getRemainingFeatures</a>()
373 <a name="l00352"></a>00352 { 379 <a name="l00352"></a>00352 {
374 <a name="l00353"></a>00353 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs; 380 <a name="l00353"></a>00353 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs;
375 <a name="l00354"></a>00354 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a>) <span class="keywordflow">return</span> fs; 381 <a name="l00354"></a>00354 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a>) <span class="keywordflow">return</span> fs;
376 <a name="l00355"></a>00355 <a class="code" href="classFixedTempoEstimator_1_1D.html#4f2cbc11fba5bc8af3fd2a0078156091">calculate</a>(); 382 <a name="l00355"></a>00355 <a class="code" href="classFixedTempoEstimator_1_1D.html#5f89ac783061563c73dc684ea073cde6">calculate</a>();
377 <a name="l00356"></a>00356 fs = <a class="code" href="classFixedTempoEstimator_1_1D.html#20389ba1515f6ce4181d3f41e5c4f347">assembleFeatures</a>(); 383 <a name="l00356"></a>00356 fs = <a class="code" href="classFixedTempoEstimator_1_1D.html#29ca062e20df30685c5478b7a68a9a9b">assembleFeatures</a>();
378 <a name="l00357"></a>00357 ++<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>; 384 <a name="l00357"></a>00357 ++<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>;
379 <a name="l00358"></a>00358 <span class="keywordflow">return</span> fs; 385 <a name="l00358"></a>00358 <span class="keywordflow">return</span> fs;
380 <a name="l00359"></a>00359 } 386 <a name="l00359"></a>00359 }
381 <a name="l00360"></a>00360 387 <a name="l00360"></a>00360
382 <a name="l00361"></a>00361 <span class="keywordtype">float</span> 388 <a name="l00361"></a>00361 <span class="keywordtype">float</span>
383 <a name="l00362"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">00362</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">FixedTempoEstimator::D::lag2tempo</a>(<span class="keywordtype">int</span> lag) 389 <a name="l00362"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">00362</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">FixedTempoEstimator::D::lag2tempo</a>(<span class="keywordtype">int</span> lag)
384 <a name="l00363"></a>00363 { 390 <a name="l00363"></a>00363 {
385 <a name="l00364"></a>00364 <span class="keywordflow">return</span> 60.f / ((lag * <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>); 391 <a name="l00364"></a>00364 <span class="keywordflow">return</span> 60.f / ((lag * <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>);
386 <a name="l00365"></a>00365 } 392 <a name="l00365"></a>00365 }
387 <a name="l00366"></a>00366 393 <a name="l00366"></a>00366
388 <a name="l00367"></a>00367 <span class="keywordtype">int</span> 394 <a name="l00367"></a>00367 <span class="keywordtype">int</span>
389 <a name="l00368"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#c6a75212293fc855de6ed0c6581a0fb9">00368</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#c6a75212293fc855de6ed0c6581a0fb9">FixedTempoEstimator::D::tempo2lag</a>(<span class="keywordtype">float</span> tempo) 395 <a name="l00368"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#406aacbd334ef8c4ae40ea8280918f97">00368</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#406aacbd334ef8c4ae40ea8280918f97">FixedTempoEstimator::D::tempo2lag</a>(<span class="keywordtype">float</span> tempo)
390 <a name="l00369"></a>00369 { 396 <a name="l00369"></a>00369 {
391 <a name="l00370"></a>00370 <span class="keywordflow">return</span> ((60.f / tempo) * <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>; 397 <a name="l00370"></a>00370 <span class="keywordflow">return</span> ((60.f / tempo) * <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>;
392 <a name="l00371"></a>00371 } 398 <a name="l00371"></a>00371 }
393 <a name="l00372"></a>00372 399 <a name="l00372"></a>00372
394 <a name="l00373"></a>00373 <span class="keywordtype">void</span> 400 <a name="l00373"></a>00373 <span class="keywordtype">void</span>
395 <a name="l00374"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#4f2cbc11fba5bc8af3fd2a0078156091">00374</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#4f2cbc11fba5bc8af3fd2a0078156091">FixedTempoEstimator::D::calculate</a>() 401 <a name="l00374"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#5f89ac783061563c73dc684ea073cde6">00374</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#5f89ac783061563c73dc684ea073cde6">FixedTempoEstimator::D::calculate</a>()
396 <a name="l00375"></a>00375 { 402 <a name="l00375"></a>00375 {
397 <a name="l00376"></a>00376 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>) { 403 <a name="l00376"></a>00376 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>) {
398 <a name="l00377"></a>00377 cerr &lt;&lt; <span class="stringliteral">"FixedTempoEstimator::calculate: calculation already happened?"</span> &lt;&lt; endl; 404 <a name="l00377"></a>00377 cerr &lt;&lt; <span class="stringliteral">"FixedTempoEstimator::calculate: calculation already happened?"</span> &lt;&lt; endl;
399 <a name="l00378"></a>00378 <span class="keywordflow">return</span>; 405 <a name="l00378"></a>00378 <span class="keywordflow">return</span>;
400 <a name="l00379"></a>00379 } 406 <a name="l00379"></a>00379 }
401 <a name="l00380"></a>00380 407 <a name="l00380"></a>00380
402 <a name="l00381"></a>00381 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#e739e006f2d10ef2b13677770b23e663">m_dfsize</a> / 9 &amp;&amp; 408 <a name="l00381"></a>00381 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> &lt; <a class="code" href="classFixedTempoEstimator_1_1D.html#cede51fef42d9a32cdec257261f2c783">m_dfsize</a> / 9 &amp;&amp;
403 <a name="l00382"></a>00382 <a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a> &lt; (1.0 * <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>) { <span class="comment">// 1 second</span> 409 <a name="l00382"></a>00382 <a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a> &lt; (1.0 * <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>) / <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>) { <span class="comment">// 1 second</span>
404 <a name="l00383"></a>00383 cerr &lt;&lt; <span class="stringliteral">"FixedTempoEstimator::calculate: Input is too short"</span> &lt;&lt; endl; 410 <a name="l00383"></a>00383 cerr &lt;&lt; <span class="stringliteral">"FixedTempoEstimator::calculate: Input is too short"</span> &lt;&lt; endl;
405 <a name="l00384"></a>00384 <span class="keywordflow">return</span>; 411 <a name="l00384"></a>00384 <span class="keywordflow">return</span>;
406 <a name="l00385"></a>00385 } 412 <a name="l00385"></a>00385 }
407 <a name="l00386"></a>00386 413 <a name="l00386"></a>00386
408 <a name="l00387"></a>00387 <span class="comment">// This function takes m_df (the detection function array filled</span> 414 <a name="l00387"></a>00387 <span class="comment">// This function takes m_df (the detection function array filled</span>
409 <a name="l00388"></a>00388 <span class="comment">// out in process()) and calculates m_r (the raw autocorrelation)</span> 415 <a name="l00388"></a>00388 <span class="comment">// out in process()) and calculates m_r (the raw autocorrelation)</span>
410 <a name="l00389"></a>00389 <span class="comment">// and m_fr (the filtered autocorrelation from whose peaks tempo</span> 416 <a name="l00389"></a>00389 <span class="comment">// and m_fr (the filtered autocorrelation from whose peaks tempo</span>
411 <a name="l00390"></a>00390 <span class="comment">// estimates will be taken).</span> 417 <a name="l00390"></a>00390 <span class="comment">// estimates will be taken).</span>
412 <a name="l00391"></a>00391 418 <a name="l00391"></a>00391
413 <a name="l00392"></a>00392 <span class="keywordtype">int</span> n = <a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>; <span class="comment">// length of actual df array (m_dfsize is the theoretical max)</span> 419 <a name="l00392"></a>00392 <span class="keywordtype">int</span> n = <a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>; <span class="comment">// length of actual df array (m_dfsize is the theoretical max)</span>
414 <a name="l00393"></a>00393 420 <a name="l00393"></a>00393
415 <a name="l00394"></a>00394 <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[n/2]; <span class="comment">// raw autocorrelation</span> 421 <a name="l00394"></a>00394 <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[n/2]; <span class="comment">// raw autocorrelation</span>
416 <a name="l00395"></a>00395 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[n/2]; <span class="comment">// filtered autocorrelation</span> 422 <a name="l00395"></a>00395 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[n/2]; <span class="comment">// filtered autocorrelation</span>
417 <a name="l00396"></a>00396 <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[n/2]; <span class="comment">// averaged tempo estimate for each lag value</span> 423 <a name="l00396"></a>00396 <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a> = <span class="keyword">new</span> <span class="keywordtype">float</span>[n/2]; <span class="comment">// averaged tempo estimate for each lag value</span>
418 <a name="l00397"></a>00397 424 <a name="l00397"></a>00397
419 <a name="l00398"></a>00398 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n/2; ++i) { 425 <a name="l00398"></a>00398 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n/2; ++i) {
420 <a name="l00399"></a>00399 <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[i] = 0.f; 426 <a name="l00399"></a>00399 <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[i] = 0.f;
421 <a name="l00400"></a>00400 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] = 0.f; 427 <a name="l00400"></a>00400 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] = 0.f;
422 <a name="l00401"></a>00401 <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[i] = <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(i); 428 <a name="l00401"></a>00401 <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[i] = <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(i);
423 <a name="l00402"></a>00402 } 429 <a name="l00402"></a>00402 }
424 <a name="l00403"></a>00403 430 <a name="l00403"></a>00403
425 <a name="l00404"></a>00404 <span class="comment">// Calculate the raw autocorrelation of the detection function</span> 431 <a name="l00404"></a>00404 <span class="comment">// Calculate the raw autocorrelation of the detection function</span>
426 <a name="l00405"></a>00405 432 <a name="l00405"></a>00405
427 <a name="l00406"></a>00406 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n/2; ++i) { 433 <a name="l00406"></a>00406 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n/2; ++i) {
428 <a name="l00407"></a>00407 434 <a name="l00407"></a>00407
429 <a name="l00408"></a>00408 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i; j &lt; n; ++j) { 435 <a name="l00408"></a>00408 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = i; j &lt; n; ++j) {
430 <a name="l00409"></a>00409 <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[i] += <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>[j] * <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>[j - i]; 436 <a name="l00409"></a>00409 <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[i] += <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>[j] * <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>[j - i];
431 <a name="l00410"></a>00410 } 437 <a name="l00410"></a>00410 }
432 <a name="l00411"></a>00411 438 <a name="l00411"></a>00411
433 <a name="l00412"></a>00412 <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[i] /= n - i - 1; 439 <a name="l00412"></a>00412 <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[i] /= n - i - 1;
434 <a name="l00413"></a>00413 } 440 <a name="l00413"></a>00413 }
435 <a name="l00414"></a>00414 441 <a name="l00414"></a>00414
436 <a name="l00415"></a>00415 <span class="comment">// Filter the autocorrelation and average out the tempo estimates</span> 442 <a name="l00415"></a>00415 <span class="comment">// Filter the autocorrelation and average out the tempo estimates</span>
437 <a name="l00416"></a>00416 443 <a name="l00416"></a>00416
438 <a name="l00417"></a>00417 <span class="keywordtype">float</span> related[] = { 0.5, 2, 4, 8 }; 444 <a name="l00417"></a>00417 <span class="keywordtype">float</span> related[] = { 0.5, 2, 4, 8 };
439 <a name="l00418"></a>00418 445 <a name="l00418"></a>00418
440 <a name="l00419"></a>00419 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; n/2-1; ++i) { 446 <a name="l00419"></a>00419 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; n/2-1; ++i) {
441 <a name="l00420"></a>00420 447 <a name="l00420"></a>00420
442 <a name="l00421"></a>00421 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] = <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[i]; 448 <a name="l00421"></a>00421 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] = <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[i];
443 <a name="l00422"></a>00422 449 <a name="l00422"></a>00422
444 <a name="l00423"></a>00423 <span class="keywordtype">int</span> div = 1; 450 <a name="l00423"></a>00423 <span class="keywordtype">int</span> div = 1;
445 <a name="l00424"></a>00424 451 <a name="l00424"></a>00424
446 <a name="l00425"></a>00425 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; int(<span class="keyword">sizeof</span>(related)/<span class="keyword">sizeof</span>(related[0])); ++j) { 452 <a name="l00425"></a>00425 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; int(<span class="keyword">sizeof</span>(related)/<span class="keyword">sizeof</span>(related[0])); ++j) {
447 <a name="l00426"></a>00426 453 <a name="l00426"></a>00426
457 <a name="l00436"></a>00436 463 <a name="l00436"></a>00436
458 <a name="l00437"></a>00437 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = k0 - 1; k &lt;= k0 + 1; ++k) { 464 <a name="l00437"></a>00437 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = k0 - 1; k &lt;= k0 + 1; ++k) {
459 <a name="l00438"></a>00438 465 <a name="l00438"></a>00438
460 <a name="l00439"></a>00439 <span class="keywordflow">if</span> (k &lt; 0 || k &gt;= n/2) <span class="keywordflow">continue</span>; 466 <a name="l00439"></a>00439 <span class="keywordflow">if</span> (k &lt; 0 || k &gt;= n/2) <span class="keywordflow">continue</span>;
461 <a name="l00440"></a>00440 467 <a name="l00440"></a>00440
462 <a name="l00441"></a>00441 <span class="keywordflow">if</span> (!have || (<a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[k] &gt; kvmax)) { kmax = k; kvmax = <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[k]; } 468 <a name="l00441"></a>00441 <span class="keywordflow">if</span> (!have || (<a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[k] &gt; kvmax)) { kmax = k; kvmax = <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[k]; }
463 <a name="l00442"></a>00442 <span class="keywordflow">if</span> (!have || (<a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[k] &lt; kvmin)) { kmin = k; kvmin = <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[k]; } 469 <a name="l00442"></a>00442 <span class="keywordflow">if</span> (!have || (<a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[k] &lt; kvmin)) { kmin = k; kvmin = <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[k]; }
464 <a name="l00443"></a>00443 470 <a name="l00443"></a>00443
465 <a name="l00444"></a>00444 have = <span class="keyword">true</span>; 471 <a name="l00444"></a>00444 have = <span class="keyword">true</span>;
466 <a name="l00445"></a>00445 } 472 <a name="l00445"></a>00445 }
467 <a name="l00446"></a>00446 473 <a name="l00446"></a>00446
468 <a name="l00447"></a>00447 <span class="comment">// Boost the original lag according to the strongest</span> 474 <a name="l00447"></a>00447 <span class="comment">// Boost the original lag according to the strongest</span>
469 <a name="l00448"></a>00448 <span class="comment">// value found close to this related lag</span> 475 <a name="l00448"></a>00448 <span class="comment">// value found close to this related lag</span>
470 <a name="l00449"></a>00449 476 <a name="l00449"></a>00449
471 <a name="l00450"></a>00450 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] += <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[kmax] / 5; 477 <a name="l00450"></a>00450 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] += <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[kmax] / 5;
472 <a name="l00451"></a>00451 478 <a name="l00451"></a>00451
473 <a name="l00452"></a>00452 <span class="keywordflow">if</span> ((kmax == 0 || <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[kmax] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[kmax-1]) &amp;&amp; 479 <a name="l00452"></a>00452 <span class="keywordflow">if</span> ((kmax == 0 || <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[kmax] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[kmax-1]) &amp;&amp;
474 <a name="l00453"></a>00453 (kmax == n/2-1 || <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[kmax] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[kmax+1]) &amp;&amp; 480 <a name="l00453"></a>00453 (kmax == n/2-1 || <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[kmax] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[kmax+1]) &amp;&amp;
475 <a name="l00454"></a>00454 kvmax &gt; kvmin * 1.05) { 481 <a name="l00454"></a>00454 kvmax &gt; kvmin * 1.05) {
476 <a name="l00455"></a>00455 482 <a name="l00455"></a>00455
477 <a name="l00456"></a>00456 <span class="comment">// The strongest value close to the related lag is</span> 483 <a name="l00456"></a>00456 <span class="comment">// The strongest value close to the related lag is</span>
478 <a name="l00457"></a>00457 <span class="comment">// also a pretty good looking peak, so use it to</span> 484 <a name="l00457"></a>00457 <span class="comment">// also a pretty good looking peak, so use it to</span>
479 <a name="l00458"></a>00458 <span class="comment">// improve our tempo estimate for the original lag</span> 485 <a name="l00458"></a>00458 <span class="comment">// improve our tempo estimate for the original lag</span>
480 <a name="l00459"></a>00459 486 <a name="l00459"></a>00459
481 <a name="l00460"></a>00460 <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[i] = <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[i] + <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(kmax) * related[j]; 487 <a name="l00460"></a>00460 <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[i] = <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[i] + <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(kmax) * related[j];
482 <a name="l00461"></a>00461 ++div; 488 <a name="l00461"></a>00461 ++div;
483 <a name="l00462"></a>00462 } 489 <a name="l00462"></a>00462 }
484 <a name="l00463"></a>00463 } 490 <a name="l00463"></a>00463 }
485 <a name="l00464"></a>00464 } 491 <a name="l00464"></a>00464 }
486 <a name="l00465"></a>00465 492 <a name="l00465"></a>00465
487 <a name="l00466"></a>00466 <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[i] /= div; 493 <a name="l00466"></a>00466 <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[i] /= div;
488 <a name="l00467"></a>00467 494 <a name="l00467"></a>00467
489 <a name="l00468"></a>00468 <span class="comment">// Finally apply a primitive perceptual weighting (to prefer</span> 495 <a name="l00468"></a>00468 <span class="comment">// Finally apply a primitive perceptual weighting (to prefer</span>
490 <a name="l00469"></a>00469 <span class="comment">// tempi of around 120-130)</span> 496 <a name="l00469"></a>00469 <span class="comment">// tempi of around 120-130)</span>
491 <a name="l00470"></a>00470 497 <a name="l00470"></a>00470
492 <a name="l00471"></a>00471 <span class="keywordtype">float</span> weight = 1.f - fabsf(128.f - <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(i)) * 0.005; 498 <a name="l00471"></a>00471 <span class="keywordtype">float</span> weight = 1.f - fabsf(128.f - <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(i)) * 0.005;
493 <a name="l00472"></a>00472 <span class="keywordflow">if</span> (weight &lt; 0.f) weight = 0.f; 499 <a name="l00472"></a>00472 <span class="keywordflow">if</span> (weight &lt; 0.f) weight = 0.f;
494 <a name="l00473"></a>00473 weight = weight * weight * weight; 500 <a name="l00473"></a>00473 weight = weight * weight * weight;
495 <a name="l00474"></a>00474 501 <a name="l00474"></a>00474
496 <a name="l00475"></a>00475 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] += <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] * (weight / 3); 502 <a name="l00475"></a>00475 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] += <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] * (weight / 3);
497 <a name="l00476"></a>00476 } 503 <a name="l00476"></a>00476 }
498 <a name="l00477"></a>00477 } 504 <a name="l00477"></a>00477 }
499 <a name="l00478"></a>00478 505 <a name="l00478"></a>00478
500 <a name="l00479"></a>00479 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a> 506 <a name="l00479"></a>00479 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a>
501 <a name="l00480"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#20389ba1515f6ce4181d3f41e5c4f347">00480</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#20389ba1515f6ce4181d3f41e5c4f347">FixedTempoEstimator::D::assembleFeatures</a>() 507 <a name="l00480"></a><a class="code" href="classFixedTempoEstimator_1_1D.html#29ca062e20df30685c5478b7a68a9a9b">00480</a> <a class="code" href="classFixedTempoEstimator_1_1D.html#29ca062e20df30685c5478b7a68a9a9b">FixedTempoEstimator::D::assembleFeatures</a>()
502 <a name="l00481"></a>00481 { 508 <a name="l00481"></a>00481 {
503 <a name="l00482"></a>00482 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs; 509 <a name="l00482"></a>00482 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FeatureSet</a> fs;
504 <a name="l00483"></a>00483 <span class="keywordflow">if</span> (!<a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>) <span class="keywordflow">return</span> fs; <span class="comment">// No autocorrelation: no results</span> 510 <a name="l00483"></a>00483 <span class="keywordflow">if</span> (!<a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>) <span class="keywordflow">return</span> fs; <span class="comment">// No autocorrelation: no results</span>
505 <a name="l00484"></a>00484 511 <a name="l00484"></a>00484
506 <a name="l00485"></a>00485 <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature; 512 <a name="l00485"></a>00485 <a class="code" href="structVamp_1_1Plugin_1_1Feature.html">Feature</a> feature;
507 <a name="l00486"></a>00486 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#98907091d0b6a589720ae35ae588a82b" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">true</span>; 513 <a name="l00486"></a>00486 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#116bb1b3420a067fc1290b75982fdf62" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">true</span>;
508 <a name="l00487"></a>00487 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#33686757bd4481c72494122e9bfb9fba" title="True if an output feature has a specified duration.">hasDuration</a> = <span class="keyword">false</span>; 514 <a name="l00487"></a>00487 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#2a962f4b26d6417ad1b72ae29949332e" title="True if an output feature has a specified duration.">hasDuration</a> = <span class="keyword">false</span>;
509 <a name="l00488"></a>00488 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>; 515 <a name="l00488"></a>00488 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>;
510 <a name="l00489"></a>00489 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.clear(); 516 <a name="l00489"></a>00489 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.clear();
511 <a name="l00490"></a>00490 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.push_back(0.f); 517 <a name="l00490"></a>00490 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.push_back(0.f);
512 <a name="l00491"></a>00491 518 <a name="l00491"></a>00491
513 <a name="l00492"></a>00492 <span class="keywordtype">char</span> buffer[40]; 519 <a name="l00492"></a>00492 <span class="keywordtype">char</span> buffer[40];
514 <a name="l00493"></a>00493 520 <a name="l00493"></a>00493
515 <a name="l00494"></a>00494 <span class="keywordtype">int</span> n = <a class="code" href="classFixedTempoEstimator_1_1D.html#b73af7f1943b76388de04cbb4696a983">m_n</a>; 521 <a name="l00494"></a>00494 <span class="keywordtype">int</span> n = <a class="code" href="classFixedTempoEstimator_1_1D.html#e0372359fa0d6f00ef8af731460ad5b4">m_n</a>;
516 <a name="l00495"></a>00495 522 <a name="l00495"></a>00495
517 <a name="l00496"></a>00496 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) { 523 <a name="l00496"></a>00496 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; n; ++i) {
518 <a name="l00497"></a>00497 524 <a name="l00497"></a>00497
519 <a name="l00498"></a>00498 <span class="comment">// Return the detection function in the DF output</span> 525 <a name="l00498"></a>00498 <span class="comment">// Return the detection function in the DF output</span>
520 <a name="l00499"></a>00499 526 <a name="l00499"></a>00499
521 <a name="l00500"></a>00500 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#caa605f36839c07e76f4882f5e22d8d7" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a> + 527 <a name="l00500"></a>00500 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#aaf212bd458dc5e6f441bf7606121311" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a> +
522 <a name="l00501"></a>00501 RealTime::frame2RealTime(i * <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>, <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>); 528 <a name="l00501"></a>00501 RealTime::frame2RealTime(i * <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>, <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>);
523 <a name="l00502"></a>00502 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#8e2312120e87ad9a48fedeebbaefa396">m_df</a>[i]; 529 <a name="l00502"></a>00502 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#8ab6f840c8a0b77954bacc5e22e06f10">m_df</a>[i];
524 <a name="l00503"></a>00503 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>; 530 <a name="l00503"></a>00503 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>;
525 <a name="l00504"></a>00504 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#caa4524f29afce03c812a88ff31159c1">DFOutput</a>].push_back(feature); 531 <a name="l00504"></a>00504 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#caa4524f29afce03c812a88ff31159c1">DFOutput</a>].push_back(feature);
526 <a name="l00505"></a>00505 } 532 <a name="l00505"></a>00505 }
527 <a name="l00506"></a>00506 533 <a name="l00506"></a>00506
528 <a name="l00507"></a>00507 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; n/2; ++i) { 534 <a name="l00507"></a>00507 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i &lt; n/2; ++i) {
529 <a name="l00508"></a>00508 535 <a name="l00508"></a>00508
530 <a name="l00509"></a>00509 <span class="comment">// Return the raw autocorrelation in the ACF output, each</span> 536 <a name="l00509"></a>00509 <span class="comment">// Return the raw autocorrelation in the ACF output, each</span>
531 <a name="l00510"></a>00510 <span class="comment">// value labelled according to its corresponding tempo</span> 537 <a name="l00510"></a>00510 <span class="comment">// value labelled according to its corresponding tempo</span>
532 <a name="l00511"></a>00511 538 <a name="l00511"></a>00511
533 <a name="l00512"></a>00512 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#caa605f36839c07e76f4882f5e22d8d7" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a> + 539 <a name="l00512"></a>00512 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#aaf212bd458dc5e6f441bf7606121311" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a> +
534 <a name="l00513"></a>00513 RealTime::frame2RealTime(i * <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>, <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>); 540 <a name="l00513"></a>00513 RealTime::frame2RealTime(i * <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>, <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>);
535 <a name="l00514"></a>00514 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#7a8c8658ecfeec98962078df89fcd538">m_r</a>[i]; 541 <a name="l00514"></a>00514 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#1608202e4efc8174ac07086303dc111c">m_r</a>[i];
536 <a name="l00515"></a>00515 sprintf(buffer, <span class="stringliteral">"%.1f bpm"</span>, <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(i)); 542 <a name="l00515"></a>00515 sprintf(buffer, <span class="stringliteral">"%.1f bpm"</span>, <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(i));
537 <a name="l00516"></a>00516 <span class="keywordflow">if</span> (i == n/2-1) feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>; 543 <a name="l00516"></a>00516 <span class="keywordflow">if</span> (i == n/2-1) feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>;
538 <a name="l00517"></a>00517 <span class="keywordflow">else</span> feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = buffer; 544 <a name="l00517"></a>00517 <span class="keywordflow">else</span> feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = buffer;
539 <a name="l00518"></a>00518 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#382c1fe740ac8911c6078cfbceffc870">ACFOutput</a>].push_back(feature); 545 <a name="l00518"></a>00518 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#382c1fe740ac8911c6078cfbceffc870">ACFOutput</a>].push_back(feature);
540 <a name="l00519"></a>00519 } 546 <a name="l00519"></a>00519 }
541 <a name="l00520"></a>00520 547 <a name="l00520"></a>00520
542 <a name="l00521"></a>00521 <span class="keywordtype">float</span> t0 = <a class="code" href="classFixedTempoEstimator_1_1D.html#768fdbb62e4b21a39897963fdbd486ed">m_minbpm</a>; <span class="comment">// our minimum detected tempo</span> 548 <a name="l00521"></a>00521 <span class="keywordtype">float</span> t0 = <a class="code" href="classFixedTempoEstimator_1_1D.html#0d0e9ff333c6e0e85d2069b730f0f1c2">m_minbpm</a>; <span class="comment">// our minimum detected tempo</span>
543 <a name="l00522"></a>00522 <span class="keywordtype">float</span> t1 = <a class="code" href="classFixedTempoEstimator_1_1D.html#33e8d045b222addc6173b50df2553ba8">m_maxbpm</a>; <span class="comment">// our maximum detected tempo</span> 549 <a name="l00522"></a>00522 <span class="keywordtype">float</span> t1 = <a class="code" href="classFixedTempoEstimator_1_1D.html#42f27eb3f218cf57c71b278d5ffd2d8d">m_maxbpm</a>; <span class="comment">// our maximum detected tempo</span>
544 <a name="l00523"></a>00523 550 <a name="l00523"></a>00523
545 <a name="l00524"></a>00524 <span class="keywordtype">int</span> p0 = <a class="code" href="classFixedTempoEstimator_1_1D.html#c6a75212293fc855de6ed0c6581a0fb9">tempo2lag</a>(t1); 551 <a name="l00524"></a>00524 <span class="keywordtype">int</span> p0 = <a class="code" href="classFixedTempoEstimator_1_1D.html#406aacbd334ef8c4ae40ea8280918f97">tempo2lag</a>(t1);
546 <a name="l00525"></a>00525 <span class="keywordtype">int</span> p1 = <a class="code" href="classFixedTempoEstimator_1_1D.html#c6a75212293fc855de6ed0c6581a0fb9">tempo2lag</a>(t0); 552 <a name="l00525"></a>00525 <span class="keywordtype">int</span> p1 = <a class="code" href="classFixedTempoEstimator_1_1D.html#406aacbd334ef8c4ae40ea8280918f97">tempo2lag</a>(t0);
547 <a name="l00526"></a>00526 553 <a name="l00526"></a>00526
548 <a name="l00527"></a>00527 std::map&lt;float, int&gt; candidates; 554 <a name="l00527"></a>00527 std::map&lt;float, int&gt; candidates;
549 <a name="l00528"></a>00528 555 <a name="l00528"></a>00528
550 <a name="l00529"></a>00529 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = p0; i &lt;= p1 &amp;&amp; i+1 &lt; n/2; ++i) { 556 <a name="l00529"></a>00529 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = p0; i &lt;= p1 &amp;&amp; i+1 &lt; n/2; ++i) {
551 <a name="l00530"></a>00530 557 <a name="l00530"></a>00530
552 <a name="l00531"></a>00531 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i-1] &amp;&amp; 558 <a name="l00531"></a>00531 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i-1] &amp;&amp;
553 <a name="l00532"></a>00532 <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i+1]) { 559 <a name="l00532"></a>00532 <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i] &gt; <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i+1]) {
554 <a name="l00533"></a>00533 560 <a name="l00533"></a>00533
555 <a name="l00534"></a>00534 <span class="comment">// This is a peak in the filtered autocorrelation: stick</span> 561 <a name="l00534"></a>00534 <span class="comment">// This is a peak in the filtered autocorrelation: stick</span>
556 <a name="l00535"></a>00535 <span class="comment">// it into the map from filtered autocorrelation to lag</span> 562 <a name="l00535"></a>00535 <span class="comment">// it into the map from filtered autocorrelation to lag</span>
557 <a name="l00536"></a>00536 <span class="comment">// index -- this sorts our peaks by filtered acf value</span> 563 <a name="l00536"></a>00536 <span class="comment">// index -- this sorts our peaks by filtered acf value</span>
558 <a name="l00537"></a>00537 564 <a name="l00537"></a>00537
559 <a name="l00538"></a>00538 candidates[<a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i]] = i; 565 <a name="l00538"></a>00538 candidates[<a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i]] = i;
560 <a name="l00539"></a>00539 } 566 <a name="l00539"></a>00539 }
561 <a name="l00540"></a>00540 567 <a name="l00540"></a>00540
562 <a name="l00541"></a>00541 <span class="comment">// Also return the filtered autocorrelation in its own output</span> 568 <a name="l00541"></a>00541 <span class="comment">// Also return the filtered autocorrelation in its own output</span>
563 <a name="l00542"></a>00542 569 <a name="l00542"></a>00542
564 <a name="l00543"></a>00543 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#caa605f36839c07e76f4882f5e22d8d7" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a> + 570 <a name="l00543"></a>00543 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#aaf212bd458dc5e6f441bf7606121311" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a> +
565 <a name="l00544"></a>00544 RealTime::frame2RealTime(i * <a class="code" href="classFixedTempoEstimator_1_1D.html#837da9722c63fe3c66c738255990c45f">m_stepSize</a>, <a class="code" href="classFixedTempoEstimator_1_1D.html#072a0fc30b3912a54858eefdd47f4d4f">m_inputSampleRate</a>); 571 <a name="l00544"></a>00544 RealTime::frame2RealTime(i * <a class="code" href="classFixedTempoEstimator_1_1D.html#43af246598757e4e21d4a8f3a023715a">m_stepSize</a>, <a class="code" href="classFixedTempoEstimator_1_1D.html#d014ad2638522492cfa1a9989dafbddb">m_inputSampleRate</a>);
566 <a name="l00545"></a>00545 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#b255006072672653e645fc315eea6167">m_fr</a>[i]; 572 <a name="l00545"></a>00545 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#9e5eeec948d2eedf27cd3d8bf1b0b10e">m_fr</a>[i];
567 <a name="l00546"></a>00546 sprintf(buffer, <span class="stringliteral">"%.1f bpm"</span>, <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(i)); 573 <a name="l00546"></a>00546 sprintf(buffer, <span class="stringliteral">"%.1f bpm"</span>, <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(i));
568 <a name="l00547"></a>00547 <span class="keywordflow">if</span> (i == p1 || i == n/2-2) feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>; 574 <a name="l00547"></a>00547 <span class="keywordflow">if</span> (i == p1 || i == n/2-2) feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>;
569 <a name="l00548"></a>00548 <span class="keywordflow">else</span> feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = buffer; 575 <a name="l00548"></a>00548 <span class="keywordflow">else</span> feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = buffer;
570 <a name="l00549"></a>00549 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#5b284021783d79785d46b043b458368d">FilteredACFOutput</a>].push_back(feature); 576 <a name="l00549"></a>00549 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#5b284021783d79785d46b043b458368d">FilteredACFOutput</a>].push_back(feature);
571 <a name="l00550"></a>00550 } 577 <a name="l00550"></a>00550 }
572 <a name="l00551"></a>00551 578 <a name="l00551"></a>00551
573 <a name="l00552"></a>00552 <span class="keywordflow">if</span> (candidates.empty()) { 579 <a name="l00552"></a>00552 <span class="keywordflow">if</span> (candidates.empty()) {
574 <a name="l00553"></a>00553 cerr &lt;&lt; <span class="stringliteral">"No tempo candidates!"</span> &lt;&lt; endl; 580 <a name="l00553"></a>00553 cerr &lt;&lt; <span class="stringliteral">"No tempo candidates!"</span> &lt;&lt; endl;
575 <a name="l00554"></a>00554 <span class="keywordflow">return</span> fs; 581 <a name="l00554"></a>00554 <span class="keywordflow">return</span> fs;
576 <a name="l00555"></a>00555 } 582 <a name="l00555"></a>00555 }
577 <a name="l00556"></a>00556 583 <a name="l00556"></a>00556
578 <a name="l00557"></a>00557 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#98907091d0b6a589720ae35ae588a82b" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">true</span>; 584 <a name="l00557"></a>00557 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#116bb1b3420a067fc1290b75982fdf62" title="True if an output feature has its own timestamp.">hasTimestamp</a> = <span class="keyword">true</span>;
579 <a name="l00558"></a>00558 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#caa605f36839c07e76f4882f5e22d8d7" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a>; 585 <a name="l00558"></a>00558 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#aaf212bd458dc5e6f441bf7606121311" title="Timestamp of the output feature.">timestamp</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a>;
580 <a name="l00559"></a>00559 586 <a name="l00559"></a>00559
581 <a name="l00560"></a>00560 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#33686757bd4481c72494122e9bfb9fba" title="True if an output feature has a specified duration.">hasDuration</a> = <span class="keyword">true</span>; 587 <a name="l00560"></a>00560 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#2a962f4b26d6417ad1b72ae29949332e" title="True if an output feature has a specified duration.">hasDuration</a> = <span class="keyword">true</span>;
582 <a name="l00561"></a>00561 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#f687c0a7fe041757e922ec296862b115" title="Duration of the output feature.">duration</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#bacd5ff19c301020efb99c03136b849a">m_lasttime</a> - <a class="code" href="classFixedTempoEstimator_1_1D.html#3a3a0b4a4c259087f02d0046241674d0">m_start</a>; 588 <a name="l00561"></a>00561 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#f09e2624341f81c8f1f9c2d9137b4230" title="Duration of the output feature.">duration</a> = <a class="code" href="classFixedTempoEstimator_1_1D.html#0043d3c082b20a1506ecf3fbaac5abf8">m_lasttime</a> - <a class="code" href="classFixedTempoEstimator_1_1D.html#13e48c42618c55f21200ef99bdadc333">m_start</a>;
583 <a name="l00562"></a>00562 589 <a name="l00562"></a>00562
584 <a name="l00563"></a>00563 <span class="comment">// The map contains only peaks and is sorted by filtered acf</span> 590 <a name="l00563"></a>00563 <span class="comment">// The map contains only peaks and is sorted by filtered acf</span>
585 <a name="l00564"></a>00564 <span class="comment">// value, so the final element in it is our "best" tempo guess</span> 591 <a name="l00564"></a>00564 <span class="comment">// value, so the final element in it is our "best" tempo guess</span>
586 <a name="l00565"></a>00565 592 <a name="l00565"></a>00565
587 <a name="l00566"></a>00566 std::map&lt;float, int&gt;::const_iterator ci = candidates.end(); 593 <a name="l00566"></a>00566 std::map&lt;float, int&gt;::const_iterator ci = candidates.end();
588 <a name="l00567"></a>00567 --ci; 594 <a name="l00567"></a>00567 --ci;
589 <a name="l00568"></a>00568 <span class="keywordtype">int</span> maxpi = ci-&gt;second; 595 <a name="l00568"></a>00568 <span class="keywordtype">int</span> maxpi = ci-&gt;second;
590 <a name="l00569"></a>00569 596 <a name="l00569"></a>00569
591 <a name="l00570"></a>00570 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[maxpi] &gt; 0) { 597 <a name="l00570"></a>00570 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[maxpi] &gt; 0) {
592 <a name="l00571"></a>00571 598 <a name="l00571"></a>00571
593 <a name="l00572"></a>00572 <span class="comment">// This lag has an adjusted tempo from the averaging process:</span> 599 <a name="l00572"></a>00572 <span class="comment">// This lag has an adjusted tempo from the averaging process:</span>
594 <a name="l00573"></a>00573 <span class="comment">// use it</span> 600 <a name="l00573"></a>00573 <span class="comment">// use it</span>
595 <a name="l00574"></a>00574 601 <a name="l00574"></a>00574
596 <a name="l00575"></a>00575 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[maxpi]; 602 <a name="l00575"></a>00575 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[maxpi];
597 <a name="l00576"></a>00576 603 <a name="l00576"></a>00576
598 <a name="l00577"></a>00577 } <span class="keywordflow">else</span> { 604 <a name="l00577"></a>00577 } <span class="keywordflow">else</span> {
599 <a name="l00578"></a>00578 605 <a name="l00578"></a>00578
600 <a name="l00579"></a>00579 <span class="comment">// shouldn't happen -- it would imply that this high value was</span> 606 <a name="l00579"></a>00579 <span class="comment">// shouldn't happen -- it would imply that this high value was</span>
601 <a name="l00580"></a>00580 <span class="comment">// not a peak!</span> 607 <a name="l00580"></a>00580 <span class="comment">// not a peak!</span>
602 <a name="l00581"></a>00581 608 <a name="l00581"></a>00581
603 <a name="l00582"></a>00582 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(maxpi); 609 <a name="l00582"></a>00582 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>[0] = <a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(maxpi);
604 <a name="l00583"></a>00583 cerr &lt;&lt; <span class="stringliteral">"WARNING: No stored tempo for index "</span> &lt;&lt; maxpi &lt;&lt; endl; 610 <a name="l00583"></a>00583 cerr &lt;&lt; <span class="stringliteral">"WARNING: No stored tempo for index "</span> &lt;&lt; maxpi &lt;&lt; endl;
605 <a name="l00584"></a>00584 } 611 <a name="l00584"></a>00584 }
606 <a name="l00585"></a>00585 612 <a name="l00585"></a>00585
607 <a name="l00586"></a>00586 sprintf(buffer, <span class="stringliteral">"%.1f bpm"</span>, feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>[0]); 613 <a name="l00586"></a>00586 sprintf(buffer, <span class="stringliteral">"%.1f bpm"</span>, feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>[0]);
608 <a name="l00587"></a>00587 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = buffer; 614 <a name="l00587"></a>00587 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = buffer;
609 <a name="l00588"></a>00588 615 <a name="l00588"></a>00588
610 <a name="l00589"></a>00589 <span class="comment">// Return the best tempo in the main output</span> 616 <a name="l00589"></a>00589 <span class="comment">// Return the best tempo in the main output</span>
611 <a name="l00590"></a>00590 617 <a name="l00590"></a>00590
612 <a name="l00591"></a>00591 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#7a8511e62dffb5334ad3b70d57b2fcee">TempoOutput</a>].push_back(feature); 618 <a name="l00591"></a>00591 fs[<a class="code" href="FixedTempoEstimator_8cpp.html#7a8511e62dffb5334ad3b70d57b2fcee">TempoOutput</a>].push_back(feature);
613 <a name="l00592"></a>00592 619 <a name="l00592"></a>00592
614 <a name="l00593"></a>00593 <span class="comment">// And return the other estimates (up to the arbitrarily chosen</span> 620 <a name="l00593"></a>00593 <span class="comment">// And return the other estimates (up to the arbitrarily chosen</span>
615 <a name="l00594"></a>00594 <span class="comment">// number of 10 of them) in the candidates output</span> 621 <a name="l00594"></a>00594 <span class="comment">// number of 10 of them) in the candidates output</span>
616 <a name="l00595"></a>00595 622 <a name="l00595"></a>00595
617 <a name="l00596"></a>00596 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.clear(); 623 <a name="l00596"></a>00596 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.clear();
618 <a name="l00597"></a>00597 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#8eb1fb35f73b247ed13de9527c18f036" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>; 624 <a name="l00597"></a>00597 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#14ff2ab7442f508fc3bd3d96c3e85eb5" title="Label for the sample of this feature.">label</a> = <span class="stringliteral">""</span>;
619 <a name="l00598"></a>00598 625 <a name="l00598"></a>00598
620 <a name="l00599"></a>00599 <span class="keywordflow">while</span> (feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.size() &lt; 10) { 626 <a name="l00599"></a>00599 <span class="keywordflow">while</span> (feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.size() &lt; 10) {
621 <a name="l00600"></a>00600 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[ci-&gt;second] &gt; 0) { 627 <a name="l00600"></a>00600 <span class="keywordflow">if</span> (<a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[ci-&gt;second] &gt; 0) {
622 <a name="l00601"></a>00601 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.push_back(<a class="code" href="classFixedTempoEstimator_1_1D.html#698446aad2c0f737732a392fb86a612c">m_t</a>[ci-&gt;second]); 628 <a name="l00601"></a>00601 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.push_back(<a class="code" href="classFixedTempoEstimator_1_1D.html#fcde0fa72ac4030892457e6e65d29474">m_t</a>[ci-&gt;second]);
623 <a name="l00602"></a>00602 } <span class="keywordflow">else</span> { 629 <a name="l00602"></a>00602 } <span class="keywordflow">else</span> {
624 <a name="l00603"></a>00603 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#60b9f3057386820dbcaec0eb1189ce71" title="Results for a single sample of this feature.">values</a>.push_back(<a class="code" href="classFixedTempoEstimator_1_1D.html#0a7cb0705938097ab23a6f9187e6bae5">lag2tempo</a>(ci-&gt;second)); 630 <a name="l00603"></a>00603 feature.<a class="code" href="structVamp_1_1Plugin_1_1Feature.html#106162977cdc92a02146fcb5ed18a34d" title="Results for a single sample of this feature.">values</a>.push_back(<a class="code" href="classFixedTempoEstimator_1_1D.html#d06bac4a07652b2599fb3c3b8ea17736">lag2tempo</a>(ci-&gt;second));
625 <a name="l00604"></a>00604 } 631 <a name="l00604"></a>00604 }
626 <a name="l00605"></a>00605 <span class="keywordflow">if</span> (ci == candidates.begin()) <span class="keywordflow">break</span>; 632 <a name="l00605"></a>00605 <span class="keywordflow">if</span> (ci == candidates.begin()) <span class="keywordflow">break</span>;
627 <a name="l00606"></a>00606 --ci; 633 <a name="l00606"></a>00606 --ci;
628 <a name="l00607"></a>00607 } 634 <a name="l00607"></a>00607 }
629 <a name="l00608"></a>00608 635 <a name="l00608"></a>00608
682 <a name="l00661"></a>00661 } 688 <a name="l00661"></a>00661 }
683 <a name="l00662"></a>00662 689 <a name="l00662"></a>00662
684 <a name="l00663"></a>00663 <span class="keywordtype">size_t</span> 690 <a name="l00663"></a>00663 <span class="keywordtype">size_t</span>
685 <a name="l00664"></a><a class="code" href="classFixedTempoEstimator.html#d450bb7e7df559ae3d68dfbfb085676f">00664</a> <a class="code" href="classFixedTempoEstimator.html#d450bb7e7df559ae3d68dfbfb085676f" title="Get the preferred step size (window increment -- the distance in sample frames between...">FixedTempoEstimator::getPreferredStepSize</a>()<span class="keyword"> const</span> 691 <a name="l00664"></a><a class="code" href="classFixedTempoEstimator.html#d450bb7e7df559ae3d68dfbfb085676f">00664</a> <a class="code" href="classFixedTempoEstimator.html#d450bb7e7df559ae3d68dfbfb085676f" title="Get the preferred step size (window increment -- the distance in sample frames between...">FixedTempoEstimator::getPreferredStepSize</a>()<span class="keyword"> const</span>
686 <a name="l00665"></a>00665 <span class="keyword"></span>{ 692 <a name="l00665"></a>00665 <span class="keyword"></span>{
687 <a name="l00666"></a>00666 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#dd749be18355ab1ae5c1ccbacfd2e192">getPreferredStepSize</a>(); 693 <a name="l00666"></a>00666 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#1c9af63373d85e250d56546fff83d2b6">getPreferredStepSize</a>();
688 <a name="l00667"></a>00667 } 694 <a name="l00667"></a>00667 }
689 <a name="l00668"></a>00668 695 <a name="l00668"></a>00668
690 <a name="l00669"></a>00669 <span class="keywordtype">size_t</span> 696 <a name="l00669"></a>00669 <span class="keywordtype">size_t</span>
691 <a name="l00670"></a><a class="code" href="classFixedTempoEstimator.html#68b8569b71504a0478caf990dbe30683">00670</a> <a class="code" href="classFixedTempoEstimator.html#68b8569b71504a0478caf990dbe30683" title="Get the preferred block size (window size -- the number of sample frames passed in...">FixedTempoEstimator::getPreferredBlockSize</a>()<span class="keyword"> const</span> 697 <a name="l00670"></a><a class="code" href="classFixedTempoEstimator.html#68b8569b71504a0478caf990dbe30683">00670</a> <a class="code" href="classFixedTempoEstimator.html#68b8569b71504a0478caf990dbe30683" title="Get the preferred block size (window size -- the number of sample frames passed in...">FixedTempoEstimator::getPreferredBlockSize</a>()<span class="keyword"> const</span>
692 <a name="l00671"></a>00671 <span class="keyword"></span>{ 698 <a name="l00671"></a>00671 <span class="keyword"></span>{
693 <a name="l00672"></a>00672 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#c02826f981736fc2aa5d835fa14e174d">getPreferredBlockSize</a>(); 699 <a name="l00672"></a>00672 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#39b70f63c405045398b1cd3ce7ff5d2b">getPreferredBlockSize</a>();
694 <a name="l00673"></a>00673 } 700 <a name="l00673"></a>00673 }
695 <a name="l00674"></a>00674 701 <a name="l00674"></a>00674
696 <a name="l00675"></a>00675 <span class="keywordtype">bool</span> 702 <a name="l00675"></a>00675 <span class="keywordtype">bool</span>
697 <a name="l00676"></a><a class="code" href="classFixedTempoEstimator.html#a7500a4ffbc4653baaf5101defdb37f5">00676</a> <a class="code" href="classFixedTempoEstimator.html#a7500a4ffbc4653baaf5101defdb37f5" title="Initialise a plugin to prepare it for use with the given number of input channels...">FixedTempoEstimator::initialise</a>(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize) 703 <a name="l00676"></a><a class="code" href="classFixedTempoEstimator.html#a7500a4ffbc4653baaf5101defdb37f5">00676</a> <a class="code" href="classFixedTempoEstimator.html#a7500a4ffbc4653baaf5101defdb37f5" title="Initialise a plugin to prepare it for use with the given number of input channels...">FixedTempoEstimator::initialise</a>(<span class="keywordtype">size_t</span> channels, <span class="keywordtype">size_t</span> stepSize, <span class="keywordtype">size_t</span> blockSize)
698 <a name="l00677"></a>00677 { 704 <a name="l00677"></a>00677 {
699 <a name="l00678"></a>00678 <span class="keywordflow">if</span> (channels &lt; <a class="code" href="classVamp_1_1Plugin.html#267b42e866df3cf0d190893e8096f525" title="Get the minimum supported number of input channels.">getMinChannelCount</a>() || 705 <a name="l00678"></a>00678 <span class="keywordflow">if</span> (channels &lt; <a class="code" href="classVamp_1_1Plugin.html#267b42e866df3cf0d190893e8096f525" title="Get the minimum supported number of input channels.">getMinChannelCount</a>() ||
700 <a name="l00679"></a>00679 channels &gt; <a class="code" href="classVamp_1_1Plugin.html#2c5ab12b6fa4847cb244bd1e9cb3ae5e" title="Get the maximum supported number of input channels.">getMaxChannelCount</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>; 706 <a name="l00679"></a>00679 channels &gt; <a class="code" href="classVamp_1_1Plugin.html#2c5ab12b6fa4847cb244bd1e9cb3ae5e" title="Get the maximum supported number of input channels.">getMaxChannelCount</a>()) <span class="keywordflow">return</span> <span class="keyword">false</span>;
701 <a name="l00680"></a>00680 707 <a name="l00680"></a>00680
702 <a name="l00681"></a>00681 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#f0fcad4493650728babb7e341963c91d">initialise</a>(channels, stepSize, blockSize); 708 <a name="l00681"></a>00681 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#c15e4b26e8a7bc4b53b04bffbe46d65a">initialise</a>(channels, stepSize, blockSize);
703 <a name="l00682"></a>00682 } 709 <a name="l00682"></a>00682 }
704 <a name="l00683"></a>00683 710 <a name="l00683"></a>00683
705 <a name="l00684"></a>00684 <span class="keywordtype">void</span> 711 <a name="l00684"></a>00684 <span class="keywordtype">void</span>
706 <a name="l00685"></a><a class="code" href="classFixedTempoEstimator.html#c41708397255400c6682fee6c1b3d45f">00685</a> <a class="code" href="classFixedTempoEstimator.html#c41708397255400c6682fee6c1b3d45f" title="Reset the plugin after use, to prepare it for another clean run.">FixedTempoEstimator::reset</a>() 712 <a name="l00685"></a><a class="code" href="classFixedTempoEstimator.html#c41708397255400c6682fee6c1b3d45f">00685</a> <a class="code" href="classFixedTempoEstimator.html#c41708397255400c6682fee6c1b3d45f" title="Reset the plugin after use, to prepare it for another clean run.">FixedTempoEstimator::reset</a>()
707 <a name="l00686"></a>00686 { 713 <a name="l00686"></a>00686 {
708 <a name="l00687"></a>00687 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#f5ac8147bfe79371d00aba8a19c2f8fd">reset</a>(); 714 <a name="l00687"></a>00687 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#e2188bc79ddc978b548267a38329527b">reset</a>();
709 <a name="l00688"></a>00688 } 715 <a name="l00688"></a>00688 }
710 <a name="l00689"></a>00689 716 <a name="l00689"></a>00689
711 <a name="l00690"></a>00690 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">FixedTempoEstimator::ParameterList</a> 717 <a name="l00690"></a>00690 <a class="code" href="classVamp_1_1PluginBase.html#3b6bb4bbd86affe1ca9deceea1aad4f8">FixedTempoEstimator::ParameterList</a>
712 <a name="l00691"></a><a class="code" href="classFixedTempoEstimator.html#e157465a4e07d180bab05b5c3a4d8987">00691</a> <a class="code" href="classFixedTempoEstimator.html#e157465a4e07d180bab05b5c3a4d8987" title="Get the controllable parameters of this plugin.">FixedTempoEstimator::getParameterDescriptors</a>()<span class="keyword"> const</span> 718 <a name="l00691"></a><a class="code" href="classFixedTempoEstimator.html#e157465a4e07d180bab05b5c3a4d8987">00691</a> <a class="code" href="classFixedTempoEstimator.html#e157465a4e07d180bab05b5c3a4d8987" title="Get the controllable parameters of this plugin.">FixedTempoEstimator::getParameterDescriptors</a>()<span class="keyword"> const</span>
713 <a name="l00692"></a>00692 <span class="keyword"></span>{ 719 <a name="l00692"></a>00692 <span class="keyword"></span>{
714 <a name="l00693"></a>00693 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#06fcf80a9a22c4b90abbc88eb592621a">getParameterDescriptors</a>(); 720 <a name="l00693"></a>00693 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#8030d29905a31a20b9019e5dfc388628">getParameterDescriptors</a>();
715 <a name="l00694"></a>00694 } 721 <a name="l00694"></a>00694 }
716 <a name="l00695"></a>00695 722 <a name="l00695"></a>00695
717 <a name="l00696"></a>00696 <span class="keywordtype">float</span> 723 <a name="l00696"></a>00696 <span class="keywordtype">float</span>
718 <a name="l00697"></a><a class="code" href="classFixedTempoEstimator.html#2030b05fb1228b30ace16200780c9152">00697</a> <a class="code" href="classFixedTempoEstimator.html#2030b05fb1228b30ace16200780c9152" title="Get the value of a named parameter.">FixedTempoEstimator::getParameter</a>(std::string <span class="keywordtype">id</span>)<span class="keyword"> const</span> 724 <a name="l00697"></a><a class="code" href="classFixedTempoEstimator.html#2030b05fb1228b30ace16200780c9152">00697</a> <a class="code" href="classFixedTempoEstimator.html#2030b05fb1228b30ace16200780c9152" title="Get the value of a named parameter.">FixedTempoEstimator::getParameter</a>(std::string <span class="keywordtype">id</span>)<span class="keyword"> const</span>
719 <a name="l00698"></a>00698 <span class="keyword"></span>{ 725 <a name="l00698"></a>00698 <span class="keyword"></span>{
720 <a name="l00699"></a>00699 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#968ef2e555c81e4a3bde89d19fafb31a">getParameter</a>(<span class="keywordtype">id</span>); 726 <a name="l00699"></a>00699 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#3e1950da43d6c57b9e9577afb715c338">getParameter</a>(<span class="keywordtype">id</span>);
721 <a name="l00700"></a>00700 } 727 <a name="l00700"></a>00700 }
722 <a name="l00701"></a>00701 728 <a name="l00701"></a>00701
723 <a name="l00702"></a>00702 <span class="keywordtype">void</span> 729 <a name="l00702"></a>00702 <span class="keywordtype">void</span>
724 <a name="l00703"></a><a class="code" href="classFixedTempoEstimator.html#8a5a413025384cf451c64d2c2ce13a75">00703</a> <a class="code" href="classFixedTempoEstimator.html#8a5a413025384cf451c64d2c2ce13a75" title="Set a named parameter.">FixedTempoEstimator::setParameter</a>(std::string <span class="keywordtype">id</span>, <span class="keywordtype">float</span> value) 730 <a name="l00703"></a><a class="code" href="classFixedTempoEstimator.html#8a5a413025384cf451c64d2c2ce13a75">00703</a> <a class="code" href="classFixedTempoEstimator.html#8a5a413025384cf451c64d2c2ce13a75" title="Set a named parameter.">FixedTempoEstimator::setParameter</a>(std::string <span class="keywordtype">id</span>, <span class="keywordtype">float</span> value)
725 <a name="l00704"></a>00704 { 731 <a name="l00704"></a>00704 {
726 <a name="l00705"></a>00705 <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#6cafa64d4cc8aa3556bc0ce6b0c49bc4">setParameter</a>(<span class="keywordtype">id</span>, value); 732 <a name="l00705"></a>00705 <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#f66a1106a170c11da1bb24ad54a27ea9">setParameter</a>(<span class="keywordtype">id</span>, value);
727 <a name="l00706"></a>00706 } 733 <a name="l00706"></a>00706 }
728 <a name="l00707"></a>00707 734 <a name="l00707"></a>00707
729 <a name="l00708"></a>00708 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">FixedTempoEstimator::OutputList</a> 735 <a name="l00708"></a>00708 <a class="code" href="classVamp_1_1Plugin.html#30f531b8fb69fac41a24e3d2a6a08ed9">FixedTempoEstimator::OutputList</a>
730 <a name="l00709"></a><a class="code" href="classFixedTempoEstimator.html#83121c205a723fe6297e2bf8870622a4">00709</a> <a class="code" href="classFixedTempoEstimator.html#83121c205a723fe6297e2bf8870622a4" title="Get the outputs of this plugin.">FixedTempoEstimator::getOutputDescriptors</a>()<span class="keyword"> const</span> 736 <a name="l00709"></a><a class="code" href="classFixedTempoEstimator.html#83121c205a723fe6297e2bf8870622a4">00709</a> <a class="code" href="classFixedTempoEstimator.html#83121c205a723fe6297e2bf8870622a4" title="Get the outputs of this plugin.">FixedTempoEstimator::getOutputDescriptors</a>()<span class="keyword"> const</span>
731 <a name="l00710"></a>00710 <span class="keyword"></span>{ 737 <a name="l00710"></a>00710 <span class="keyword"></span>{
732 <a name="l00711"></a>00711 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#7ce98af800f36045a0dae4b1dbed943f">getOutputDescriptors</a>(); 738 <a name="l00711"></a>00711 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#833b2a87b05ff7cf2852bd37c8d4a09f">getOutputDescriptors</a>();
733 <a name="l00712"></a>00712 } 739 <a name="l00712"></a>00712 }
734 <a name="l00713"></a>00713 740 <a name="l00713"></a>00713
735 <a name="l00714"></a>00714 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a> 741 <a name="l00714"></a>00714 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a>
736 <a name="l00715"></a><a class="code" href="classFixedTempoEstimator.html#1cf76b0e55cf4ed3da095cffcdeaec3c">00715</a> <a class="code" href="classFixedTempoEstimator.html#1cf76b0e55cf4ed3da095cffcdeaec3c" title="Process a single block of input data.">FixedTempoEstimator::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> ts) 742 <a name="l00715"></a><a class="code" href="classFixedTempoEstimator.html#1cf76b0e55cf4ed3da095cffcdeaec3c">00715</a> <a class="code" href="classFixedTempoEstimator.html#1cf76b0e55cf4ed3da095cffcdeaec3c" title="Process a single block of input data.">FixedTempoEstimator::process</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *<span class="keyword">const</span> *inputBuffers, <a class="code" href="structVamp_1_1RealTime.html" title="RealTime represents time values to nanosecond precision with accurate arithmetic...">RealTime</a> ts)
737 <a name="l00716"></a>00716 { 743 <a name="l00716"></a>00716 {
738 <a name="l00717"></a>00717 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#7fac74fc9fc54f436408705d1e125e20">process</a>(inputBuffers, ts); 744 <a name="l00717"></a>00717 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#80c7b0f36183d0b595ff482e9096eca1">process</a>(inputBuffers, ts);
739 <a name="l00718"></a>00718 } 745 <a name="l00718"></a>00718 }
740 <a name="l00719"></a>00719 746 <a name="l00719"></a>00719
741 <a name="l00720"></a>00720 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a> 747 <a name="l00720"></a>00720 <a class="code" href="classVamp_1_1Plugin.html#448fb57dc245d47923ec9eeaf9856c5f">FixedTempoEstimator::FeatureSet</a>
742 <a name="l00721"></a><a class="code" href="classFixedTempoEstimator.html#4965cf99be77fc4d1de51e11d83936b0">00721</a> <a class="code" href="classFixedTempoEstimator.html#4965cf99be77fc4d1de51e11d83936b0" title="After all blocks have been processed, calculate and return any remaining features...">FixedTempoEstimator::getRemainingFeatures</a>() 748 <a name="l00721"></a><a class="code" href="classFixedTempoEstimator.html#4965cf99be77fc4d1de51e11d83936b0">00721</a> <a class="code" href="classFixedTempoEstimator.html#4965cf99be77fc4d1de51e11d83936b0" title="After all blocks have been processed, calculate and return any remaining features...">FixedTempoEstimator::getRemainingFeatures</a>()
743 <a name="l00722"></a>00722 { 749 <a name="l00722"></a>00722 {
744 <a name="l00723"></a>00723 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#7f9c3603bb3374d6936885010dbdd82b">getRemainingFeatures</a>(); 750 <a name="l00723"></a>00723 <span class="keywordflow">return</span> <a class="code" href="classFixedTempoEstimator.html#5e1c9abaf33e9f48eb7d3b48f8af3308">m_d</a>-&gt;<a class="code" href="classFixedTempoEstimator_1_1D.html#0023f5babc813266d60b7916faf019ff">getRemainingFeatures</a>();
745 <a name="l00724"></a>00724 } 751 <a name="l00724"></a>00724 }
746 </pre></div></div> 752 </pre></div></div>
747 <hr size="1"><address style="text-align: right;"><small>Generated on Mon Dec 8 14:37:18 2008 for VampPluginSDK by&nbsp; 753 <hr size="1"><address style="text-align: right;"><small>Generated on Thu Sep 24 13:40:13 2009 for VampPluginSDK by&nbsp;
748 <a href="http://www.doxygen.org/index.html"> 754 <a href="http://www.doxygen.org/index.html">
749 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> 755 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
750 </body> 756 </body>
751 </html> 757 </html>