Mercurial > hg > vamp-tempogram
changeset 43:4cf2d163127b
Copyrights and tidying
author | Chris Cannam |
---|---|
date | Thu, 25 Sep 2014 15:13:45 +0100 |
parents | d4b74059a005 |
children | a908a5a56267 |
files | AutocorrelationProcessor.cpp AutocorrelationProcessor.h FIRFilter.cpp FIRFilter.h NoveltyCurveProcessor.cpp NoveltyCurveProcessor.h SpectrogramProcessor.cpp SpectrogramProcessor.h TempogramPlugin.cpp TempogramPlugin.h WindowFunction.cpp WindowFunction.h plugins.cpp |
diffstat | 13 files changed, 172 insertions(+), 101 deletions(-) [+] |
line wrap: on
line diff
--- a/AutocorrelationProcessor.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/AutocorrelationProcessor.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// AutocorrelationProcessor.cpp -// Tempogram -// -// Created by Carl Bussey on 20/08/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #include "AutocorrelationProcessor.h" using namespace std;
--- a/AutocorrelationProcessor.h Fri Sep 12 18:02:08 2014 +0100 +++ b/AutocorrelationProcessor.h Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// AutocorrelationProcessor.h -// Tempogram -// -// Created by Carl Bussey on 20/08/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #ifndef __Tempogram__Autocorrelation__ #define __Tempogram__Autocorrelation__
--- a/FIRFilter.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/FIRFilter.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// FIRFilter.cpp -// Tempogram -// -// Created by Carl Bussey on 25/06/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #include "FIRFilter.h"
--- a/FIRFilter.h Fri Sep 12 18:02:08 2014 +0100 +++ b/FIRFilter.h Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// FIRFilter.h -// Tempogram -// -// Created by Carl Bussey on 25/06/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #ifndef __Tempogram__FIRFilter__ #define __Tempogram__FIRFilter__
--- a/NoveltyCurveProcessor.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/NoveltyCurveProcessor.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// NoveltyCurveProcessor.cpp -// Tempogram -// -// Created by Carl Bussey on 10/07/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ //Spectrogram dimensions should be flipped?
--- a/NoveltyCurveProcessor.h Fri Sep 12 18:02:08 2014 +0100 +++ b/NoveltyCurveProcessor.h Thu Sep 25 15:13:45 2014 +0100 @@ -1,12 +1,16 @@ -// -// NoveltyCurveProcessor.h -// Tempogram -// -// Created by Carl Bussey on 10/07/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -// Don't new delete objects +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #ifndef __Tempogram__NoveltyCurve__ #define __Tempogram__NoveltyCurve__
--- a/SpectrogramProcessor.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/SpectrogramProcessor.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// SpectrogramProcessor.cpp -// Tempogram -// -// Created by Carl Bussey on 07/08/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #include "SpectrogramProcessor.h" using namespace std;
--- a/SpectrogramProcessor.h Fri Sep 12 18:02:08 2014 +0100 +++ b/SpectrogramProcessor.h Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// SpectrogramProcessor.h -// Tempogram -// -// Created by Carl Bussey on 07/08/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #ifndef __Tempogram__Spectrogram__ #define __Tempogram__Spectrogram__
--- a/TempogramPlugin.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/TempogramPlugin.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,12 +1,19 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -// This is a skeleton file for use in creating your own plugin -// libraries. Replace MyPlugin and myPlugin throughout with the name -// of your first plugin class, and fill in the gaps as appropriate. - +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #include "TempogramPlugin.h" - using Vamp::FFT; using Vamp::RealTime; using namespace std; @@ -332,7 +339,7 @@ OutputDescriptor d1; d1.identifier = "cyclicTempogram"; d1.name = "Cyclic Tempogram"; - d1.description = "Cyclic Tempogram"; + d1.description = "Cyclic tempogram calculated by \"octave folding\" the DFT tempogram"; d1.unit = ""; d1.hasFixedBinCount = true; d1.binCount = m_cyclicTempogramOctaveDivider > 0 && !isnan(m_cyclicTempogramOctaveDivider) ? m_cyclicTempogramOctaveDivider : 0; @@ -347,8 +354,8 @@ OutputDescriptor d2; d2.identifier = "tempogramDFT"; d2.name = "Tempogram via DFT"; - d2.description = "Tempogram via DFT"; - d2.unit = "BPM"; + d2.description = "Tempogram calculated using Discrete Fourier Transform method"; + d2.unit = ""; // unit of bin contents, not of "bin label", so not bpm d2.hasFixedBinCount = true; d2.binCount = m_tempogramMaxBin - m_tempogramMinBin + 1; d2.hasKnownExtents = false; @@ -366,8 +373,8 @@ OutputDescriptor d3; d3.identifier = "tempogramACT"; d3.name = "Tempogram via ACT"; - d3.description = "Tempogram via ACT"; - d3.unit = "BPM"; + d3.description = "Tempogram calculated using autocorrelation method"; + d3.unit = ""; // unit of bin contents, not of "bin label", so not bpm d3.hasFixedBinCount = true; d3.binCount = m_tempogramMaxLag - m_tempogramMinLag + 1; d3.hasKnownExtents = false; @@ -384,7 +391,7 @@ OutputDescriptor d4; d4.identifier = "nc"; d4.name = "Novelty Curve"; - d4.description = "Novelty Curve"; + d4.description = "Novelty curve underlying the tempogram calculations"; d4.unit = ""; d4.hasFixedBinCount = true; d4.binCount = 1;
--- a/TempogramPlugin.h Fri Sep 12 18:02:08 2014 +0100 +++ b/TempogramPlugin.h Thu Sep 25 15:13:45 2014 +0100 @@ -1,7 +1,16 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -// This is a skeleton file for use in creating your own plugin -// libraries. Replace MyPlugin and myPlugin throughout with the name -// of your first plugin class, and fill in the gaps as appropriate. +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ //* Should I use initialiseForGRF()? I generally think it's nicer to initialise stuff before processing. It just means that for some reason if somebody needs to process quickly (and have preparation time before) it's a bit easier on the load. //* I've taken this approach with NoveltyCurve, Spectrogram and FIRFilter too. Is this a good approach?
--- a/WindowFunction.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/WindowFunction.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// WindowFunction.cpp -// Tempogram -// -// Created by Carl Bussey on 26/06/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #include "WindowFunction.h" using std::vector; @@ -23,4 +29,4 @@ window[i] /= sum; } } -} \ No newline at end of file +}
--- a/WindowFunction.h Fri Sep 12 18:02:08 2014 +0100 +++ b/WindowFunction.h Thu Sep 25 15:13:45 2014 +0100 @@ -1,10 +1,16 @@ -// -// WindowFunction.h -// Tempogram -// -// Created by Carl Bussey on 26/06/2014. -// Copyright (c) 2014 Carl Bussey. All rights reserved. -// +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #ifndef __Tempogram__WindowFunction__ #define __Tempogram__WindowFunction__
--- a/plugins.cpp Fri Sep 12 18:02:08 2014 +0100 +++ b/plugins.cpp Thu Sep 25 15:13:45 2014 +0100 @@ -1,33 +1,30 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ -// This is a skeleton file for use in creating your own plugin -// libraries. Replace MyPlugin and myPlugin throughout with the name -// of your first plugin class, and fill in the gaps as appropriate. - +/* + Vamp Tempogram Plugin + Carl Bussey, Centre for Digital Music, Queen Mary University of London + Copyright 2014 Queen Mary University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ #include <vamp/vamp.h> #include <vamp-sdk/PluginAdapter.h> #include "TempogramPlugin.h" - -// Declare one static adapter here for each plugin class in this library. - static Vamp::PluginAdapter<TempogramPlugin> myPluginAdapter; -// This is the entry-point for the library, and the only function that -// needs to be publicly exported. - const VampPluginDescriptor * vampGetPluginDescriptor(unsigned int version, unsigned int index) { if (version < 1) return 0; - // Return a different plugin adaptor's descriptor for each index, - // and return 0 for the first index after you run out of plugins. - // (That's how the host finds out how many plugins are in this - // library.) - switch (index) { case 0: return myPluginAdapter.getDescriptor(); default: return 0;