annotate vamp-example-plugins/vamp-example-plugins.cpp @ 21:ac94242cf562

Update .cpp main files with metadata from generator
author Chris Cannam
date Wed, 14 Jun 2017 13:58:45 +0100
parents d81d02140d43
children
rev   line source
Chris@13 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@13 2
Chris@13 3 /*
Chris@13 4 Piper
Chris@13 5
Chris@13 6 Centre for Digital Music, Queen Mary, University of London.
Chris@21 7 Copyright 2015-2017 QMUL.
Chris@13 8
Chris@13 9 Permission is hereby granted, free of charge, to any person
Chris@13 10 obtaining a copy of this software and associated documentation
Chris@13 11 files (the "Software"), to deal in the Software without
Chris@13 12 restriction, including without limitation the rights to use, copy,
Chris@13 13 modify, merge, publish, distribute, sublicense, and/or sell copies
Chris@13 14 of the Software, and to permit persons to whom the Software is
Chris@13 15 furnished to do so, subject to the following conditions:
Chris@13 16
Chris@13 17 The above copyright notice and this permission notice shall be
Chris@13 18 included in all copies or substantial portions of the Software.
Chris@13 19
Chris@13 20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Chris@13 21 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Chris@13 22 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Chris@13 23 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
Chris@13 24 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Chris@13 25 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Chris@13 26 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chris@13 27
Chris@13 28 Except as contained in this notice, the names of the Centre for
Chris@13 29 Digital Music; Queen Mary, University of London; and Chris Cannam
Chris@13 30 shall not be used in advertising or otherwise to promote the sale,
Chris@13 31 use or other dealings in this Software without prior written
Chris@13 32 authorization.
Chris@13 33 */
Chris@13 34
Chris@13 35 #include "PiperExport.h"
Chris@13 36
Chris@13 37 #include "ZeroCrossing.h"
Chris@13 38 #include "SpectralCentroid.h"
Chris@13 39 #include "PercussionOnsetDetector.h"
Chris@13 40 #include "FixedTempoEstimator.h"
Chris@13 41 #include "AmplitudeFollower.h"
Chris@13 42 #include "PowerSpectrum.h"
Chris@13 43
Chris@13 44 using piper_vamp_js::PiperAdapter;
Chris@13 45 using piper_vamp_js::PiperPluginLibrary;
Chris@13 46
Chris@21 47 static std::string libname("vamp-example-plugins");
Chris@13 48
Chris@21 49 static PiperAdapter<ZeroCrossing>
Chris@21 50 zeroCrossingAdapter(
Chris@21 51 libname,
Chris@21 52 { "Low Level Features" },
Chris@21 53 {
Chris@21 54 { "counts",
Chris@21 55 { "http://purl.org/ontology/af/ZeroCrossingCount" }
Chris@21 56 },
Chris@21 57 { "zerocrossings",
Chris@21 58 { "http://purl.org/ontology/af/ZeroCrossing" }
Chris@21 59 }
Chris@21 60 }
Chris@21 61 );
Chris@21 62
Chris@21 63 static PiperAdapter<SpectralCentroid>
Chris@21 64 spectralCentroidAdapter(
Chris@21 65 libname,
Chris@21 66 { "Low Level Features" },
Chris@21 67 {
Chris@21 68 { "logcentroid",
Chris@21 69 { "http://purl.org/ontology/af/LogFrequencyCentroid" }
Chris@21 70 },
Chris@21 71 { "linearcentroid",
Chris@21 72 { "http://purl.org/ontology/af/LinearFrequencyCentroid" }
Chris@21 73 }
Chris@21 74 }
Chris@21 75 );
Chris@21 76
Chris@21 77 static PiperAdapter<PercussionOnsetDetector>
Chris@21 78 percussionOnsetsAdapter(
Chris@21 79 libname,
Chris@21 80 { "Time", "Onsets" },
Chris@21 81 {
Chris@21 82 { "onsets",
Chris@21 83 { "http://purl.org/ontology/af/Onset" }
Chris@21 84 },
Chris@21 85 { "detectionfunction",
Chris@21 86 { "http://purl.org/ontology/af/OnsetDetectionFunction" }
Chris@21 87 }
Chris@21 88 }
Chris@21 89 );
Chris@21 90
Chris@21 91 static PiperAdapter<AmplitudeFollower>
Chris@21 92 amplitudeFollowerAdapter(
Chris@21 93 libname,
Chris@21 94 { "Low Level Features" },
Chris@21 95 {
Chris@21 96 { "amplitude",
Chris@21 97 { "http://purl.org/ontology/af/Signal" }
Chris@21 98 }
Chris@21 99 }
Chris@21 100 );
Chris@21 101
Chris@21 102 static PiperAdapter<FixedTempoEstimator>
Chris@21 103 fixedTempoAdapter(
Chris@21 104 libname,
Chris@21 105 { "Time", "Tempo" },
Chris@21 106 {
Chris@21 107 { "tempo",
Chris@21 108 { "http://purl.org/ontology/af/Tempo" }
Chris@21 109 },
Chris@21 110 { "candidates",
Chris@21 111 { "http://purl.org/ontology/af/Tempo" }
Chris@21 112 },
Chris@21 113 { "detectionfunction",
Chris@21 114 { "http://purl.org/ontology/af/OnsetDetectionFunction" }
Chris@21 115 },
Chris@21 116 { "acf",
Chris@21 117 { "http://purl.org/ontology/af/Signal" }
Chris@21 118 },
Chris@21 119 { "filtered_acf",
Chris@21 120 { "http://purl.org/ontology/af/Signal" }
Chris@21 121 }
Chris@21 122 }
Chris@21 123 );
Chris@21 124
Chris@21 125 static PiperAdapter<PowerSpectrum>
Chris@21 126 powerSpectrumAdapter(
Chris@21 127 libname,
Chris@21 128 { "Visualisation" },
Chris@21 129 {
Chris@21 130 { "powerspectrum",
Chris@21 131 { "http://purl.org/ontology/af/Signal" }
Chris@21 132 }
Chris@21 133 }
Chris@21 134 );
Chris@13 135
Chris@13 136 static PiperPluginLibrary library({
Chris@13 137 &zeroCrossingAdapter,
Chris@13 138 &spectralCentroidAdapter,
Chris@21 139 &percussionOnsetsAdapter,
Chris@21 140 &amplitudeFollowerAdapter,
Chris@13 141 &fixedTempoAdapter,
Chris@13 142 &powerSpectrumAdapter
Chris@13 143 });
Chris@13 144
Chris@13 145 PIPER_EXPORT_LIBRARY(library);
Chris@13 146