Mercurial > hg > beatroot-vamp
comparison BeatRootVampPlugin.cpp @ 36:937432fc2898
Add output for un-filled (pre-interpolation) beats
author | Chris Cannam |
---|---|
date | Thu, 16 Jan 2014 12:19:05 +0000 |
parents | b9c2f444cdaa |
children |
comparison
equal
deleted
inserted
replaced
35:1d750999a9db | 36:937432fc2898 |
---|---|
237 d.sampleType = OutputDescriptor::VariableSampleRate; | 237 d.sampleType = OutputDescriptor::VariableSampleRate; |
238 d.sampleRate = m_inputSampleRate; | 238 d.sampleRate = m_inputSampleRate; |
239 d.hasDuration = false; | 239 d.hasDuration = false; |
240 list.push_back(d); | 240 list.push_back(d); |
241 | 241 |
242 d.identifier = "unfilled"; | |
243 d.name = "Un-interpolated beats"; | |
244 d.description = "Locations of detected beats, before agent interpolation occurs"; | |
245 list.push_back(d); | |
246 | |
242 return list; | 247 return list; |
243 } | 248 } |
244 | 249 |
245 bool | 250 bool |
246 BeatRootVampPlugin::initialise(size_t channels, size_t stepSize, size_t blockSize) | 251 BeatRootVampPlugin::initialise(size_t channels, size_t stepSize, size_t blockSize) |
298 } | 303 } |
299 | 304 |
300 BeatRootVampPlugin::FeatureSet | 305 BeatRootVampPlugin::FeatureSet |
301 BeatRootVampPlugin::getRemainingFeatures() | 306 BeatRootVampPlugin::getRemainingFeatures() |
302 { | 307 { |
303 EventList el = m_processor->beatTrack(); | 308 EventList unfilled; |
309 EventList el = m_processor->beatTrack(&unfilled); | |
304 | 310 |
305 Feature f; | 311 Feature f; |
306 f.hasTimestamp = true; | 312 f.hasTimestamp = true; |
307 f.hasDuration = false; | 313 f.hasDuration = false; |
308 f.label = ""; | 314 f.label = ""; |
313 for (EventList::const_iterator i = el.begin(); i != el.end(); ++i) { | 319 for (EventList::const_iterator i = el.begin(); i != el.end(); ++i) { |
314 f.timestamp = m_origin + Vamp::RealTime::fromSeconds(i->time); | 320 f.timestamp = m_origin + Vamp::RealTime::fromSeconds(i->time); |
315 fs[0].push_back(f); | 321 fs[0].push_back(f); |
316 } | 322 } |
317 | 323 |
324 for (EventList::const_iterator i = unfilled.begin(); | |
325 i != unfilled.end(); ++i) { | |
326 f.timestamp = m_origin + Vamp::RealTime::fromSeconds(i->time); | |
327 fs[1].push_back(f); | |
328 } | |
329 | |
318 return fs; | 330 return fs; |
319 } | 331 } |
320 | 332 |
321 | 333 |
322 static Vamp::PluginAdapter<BeatRootVampPlugin> brAdapter; | 334 static Vamp::PluginAdapter<BeatRootVampPlugin> brAdapter; |