48 Plugin(inputSampleRate),
67 return "percussiononsets";
73 return "Simple Percussion Onset Detector";
79 return "Detect percussive note onsets by identifying broadband energy rises";
85 return "Vamp SDK Example Plugins";
97 return "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005. Freely redistributable (BSD license)";
151 d.
name =
"Energy rise threshold";
152 d.
description =
"Energy rise within a frequency bin necessary to count toward broadband total";
161 d.
name =
"Sensitivity";
162 d.
description =
"Sensitivity of peak detector applied to broadband detection function";
184 if (
id ==
"threshold") {
185 if (value < 0) value = 0;
186 if (value > 20) value = 20;
188 }
else if (
id ==
"sensitivity") {
189 if (value < 0) value = 0;
190 if (value > 100) value = 100;
214 d.
name =
"Detection Function";
215 d.
description =
"Broadband energy rise detection function";
230 cerr <<
"ERROR: PercussionOnsetDetector::process: "
231 <<
"PercussionOnsetDetector has not been initialised"
240 float real = inputBuffers[0][i*2];
241 float imag = inputBuffers[0][i*2 + 1];
243 float sqrmag = real * real + imag * imag;
260 detectionFunction.
values.push_back(count);
261 returnFeatures[1].push_back(detectionFunction);
273 returnFeatures[0].push_back(onset);
279 return returnFeatures;
std::vector< OutputDescriptor > OutputList
FeatureSet getRemainingFeatures()
After all blocks have been processed, calculate and return any remaining features derived from the co...
std::string getIdentifier() const
Get the computer-usable name of the plugin.
OutputList getOutputDescriptors() const
Get the outputs of this plugin.
float sampleRate
Sample rate of the output results, as samples per second.
bool hasFixedBinCount
True if the output has the same number of values per sample for every output sample.
std::vector< float > values
Results for a single sample of this feature.
std::map< int, FeatureList > FeatureSet
float quantizeStep
Quantization resolution of the output values (e.g.
bool initialise(size_t channels, size_t stepSize, size_t blockSize)
Initialise a plugin to prepare it for use with the given number of input channels, step size (window increment, in sample frames) and block size (window size, in sample frames).
RealTime timestamp
Timestamp of the output feature.
std::string identifier
The name of the parameter, in computer-usable form.
std::string description
A human-readable short text describing the output.
std::string identifier
The name of the output, in computer-usable form.
std::string name
The human-readable name of the parameter.
std::string getMaker() const
Get the name of the author or vendor of the plugin in human-readable form.
std::string getCopyright() const
Get the copyright statement or licensing summary for the plugin.
float minValue
The minimum value of the parameter.
std::string unit
The unit of the parameter, in human-readable form.
std::string unit
The unit of the output, in human-readable form.
std::string name
The human-readable name of the output.
std::string getName() const
Get a human-readable name or title of the plugin.
ParameterList getParameterDescriptors() const
Get the controllable parameters of this plugin.
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...
bool hasTimestamp
True if an output feature has its own timestamp.
int getPluginVersion() const
Get the version number of the plugin.
std::string description
A human-readable short text describing the parameter.
float maxValue
The maximum value of the parameter.
size_t getPreferredBlockSize() const
Get the preferred block size (window size – the number of sample frames passed in each block to the ...
std::string getDescription() const
Get a human-readable description for the plugin, typically a line of text that may optionally be disp...
static RealTime frame2RealTime(long frame, unsigned int sampleRate)
Convert a sample frame at the given sample rate into a RealTime.
void reset()
Reset the plugin after use, to prepare it for another clean run.
size_t getPreferredStepSize() const
Get the preferred step size (window increment – the distance in sample frames between the start fram...
void setParameter(std::string id, float value)
Set a named parameter.
Results from each process() align with that call's block start.
virtual size_t getMaxChannelCount() const
Get the maximum supported number of input channels.
size_t binCount
The number of values per result of the output.
PercussionOnsetDetector(float inputSampleRate)
float getParameter(std::string id) const
Get the value of a named parameter.
bool isQuantized
True if the output values are quantized to a particular resolution.
float defaultValue
The default value of the parameter.
FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp)
Process a single block of input data.
virtual size_t getMinChannelCount() const
Get the minimum supported number of input channels.
bool isQuantized
True if the parameter values are quantized to a particular resolution.
SampleType sampleType
Positioning in time of the output results.
virtual ~PercussionOnsetDetector()
Results are unevenly spaced and have individual timestamps.
bool hasKnownExtents
True if the results in each output bin fall within a fixed numeric range (minimum and maximum values)...
std::vector< ParameterDescriptor > ParameterList
float * m_priorMagnitudes