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