annotate examples/vamp-example-plugins/vamp-example-plugins.cpp @ 176:eaf46e7647a0 tip master

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