Mercurial > hg > vamp-tempogram
comparison TempogramPlugin.cpp @ 43:4cf2d163127b
Copyrights and tidying
author | Chris Cannam |
---|---|
date | Thu, 25 Sep 2014 15:13:45 +0100 |
parents | d4b74059a005 |
children | a908a5a56267 |
comparison
equal
deleted
inserted
replaced
42:d4b74059a005 | 43:4cf2d163127b |
---|---|
1 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
2 // This is a skeleton file for use in creating your own plugin | 2 |
3 // libraries. Replace MyPlugin and myPlugin throughout with the name | 3 /* |
4 // of your first plugin class, and fill in the gaps as appropriate. | 4 Vamp Tempogram Plugin |
5 | 5 Carl Bussey, Centre for Digital Music, Queen Mary University of London |
6 Copyright 2014 Queen Mary University of London. | |
7 | |
8 This program is free software; you can redistribute it and/or | |
9 modify it under the terms of the GNU General Public License as | |
10 published by the Free Software Foundation; either version 2 of the | |
11 License, or (at your option) any later version. See the file | |
12 COPYING included with this distribution for more information. | |
13 */ | |
6 | 14 |
7 #include "TempogramPlugin.h" | 15 #include "TempogramPlugin.h" |
8 | |
9 | 16 |
10 using Vamp::FFT; | 17 using Vamp::FFT; |
11 using Vamp::RealTime; | 18 using Vamp::RealTime; |
12 using namespace std; | 19 using namespace std; |
13 | 20 |
330 float d_sampleRate; | 337 float d_sampleRate; |
331 float tempogramInputSampleRate = (float)m_inputSampleRate/m_inputStepSize; | 338 float tempogramInputSampleRate = (float)m_inputSampleRate/m_inputStepSize; |
332 OutputDescriptor d1; | 339 OutputDescriptor d1; |
333 d1.identifier = "cyclicTempogram"; | 340 d1.identifier = "cyclicTempogram"; |
334 d1.name = "Cyclic Tempogram"; | 341 d1.name = "Cyclic Tempogram"; |
335 d1.description = "Cyclic Tempogram"; | 342 d1.description = "Cyclic tempogram calculated by \"octave folding\" the DFT tempogram"; |
336 d1.unit = ""; | 343 d1.unit = ""; |
337 d1.hasFixedBinCount = true; | 344 d1.hasFixedBinCount = true; |
338 d1.binCount = m_cyclicTempogramOctaveDivider > 0 && !isnan(m_cyclicTempogramOctaveDivider) ? m_cyclicTempogramOctaveDivider : 0; | 345 d1.binCount = m_cyclicTempogramOctaveDivider > 0 && !isnan(m_cyclicTempogramOctaveDivider) ? m_cyclicTempogramOctaveDivider : 0; |
339 d1.hasKnownExtents = false; | 346 d1.hasKnownExtents = false; |
340 d1.isQuantized = false; | 347 d1.isQuantized = false; |
345 list.push_back(d1); | 352 list.push_back(d1); |
346 | 353 |
347 OutputDescriptor d2; | 354 OutputDescriptor d2; |
348 d2.identifier = "tempogramDFT"; | 355 d2.identifier = "tempogramDFT"; |
349 d2.name = "Tempogram via DFT"; | 356 d2.name = "Tempogram via DFT"; |
350 d2.description = "Tempogram via DFT"; | 357 d2.description = "Tempogram calculated using Discrete Fourier Transform method"; |
351 d2.unit = "BPM"; | 358 d2.unit = ""; // unit of bin contents, not of "bin label", so not bpm |
352 d2.hasFixedBinCount = true; | 359 d2.hasFixedBinCount = true; |
353 d2.binCount = m_tempogramMaxBin - m_tempogramMinBin + 1; | 360 d2.binCount = m_tempogramMaxBin - m_tempogramMinBin + 1; |
354 d2.hasKnownExtents = false; | 361 d2.hasKnownExtents = false; |
355 d2.isQuantized = false; | 362 d2.isQuantized = false; |
356 d2.sampleType = OutputDescriptor::FixedSampleRate; | 363 d2.sampleType = OutputDescriptor::FixedSampleRate; |
364 list.push_back(d2); | 371 list.push_back(d2); |
365 | 372 |
366 OutputDescriptor d3; | 373 OutputDescriptor d3; |
367 d3.identifier = "tempogramACT"; | 374 d3.identifier = "tempogramACT"; |
368 d3.name = "Tempogram via ACT"; | 375 d3.name = "Tempogram via ACT"; |
369 d3.description = "Tempogram via ACT"; | 376 d3.description = "Tempogram calculated using autocorrelation method"; |
370 d3.unit = "BPM"; | 377 d3.unit = ""; // unit of bin contents, not of "bin label", so not bpm |
371 d3.hasFixedBinCount = true; | 378 d3.hasFixedBinCount = true; |
372 d3.binCount = m_tempogramMaxLag - m_tempogramMinLag + 1; | 379 d3.binCount = m_tempogramMaxLag - m_tempogramMinLag + 1; |
373 d3.hasKnownExtents = false; | 380 d3.hasKnownExtents = false; |
374 d3.isQuantized = false; | 381 d3.isQuantized = false; |
375 d3.sampleType = OutputDescriptor::FixedSampleRate; | 382 d3.sampleType = OutputDescriptor::FixedSampleRate; |
382 list.push_back(d3); | 389 list.push_back(d3); |
383 | 390 |
384 OutputDescriptor d4; | 391 OutputDescriptor d4; |
385 d4.identifier = "nc"; | 392 d4.identifier = "nc"; |
386 d4.name = "Novelty Curve"; | 393 d4.name = "Novelty Curve"; |
387 d4.description = "Novelty Curve"; | 394 d4.description = "Novelty curve underlying the tempogram calculations"; |
388 d4.unit = ""; | 395 d4.unit = ""; |
389 d4.hasFixedBinCount = true; | 396 d4.hasFixedBinCount = true; |
390 d4.binCount = 1; | 397 d4.binCount = 1; |
391 d4.hasKnownExtents = false; | 398 d4.hasKnownExtents = false; |
392 d4.isQuantized = false; | 399 d4.isQuantized = false; |