57 Plugin(inputSampleRate),
72 return "amplitudefollower";
78 return "Amplitude Follower";
84 return "Track the amplitude of the audio signal";
90 return "Vamp SDK Example Plugins";
102 return "Code copyright 2006 Dan Stowell; method from SuperCollider. Freely redistributable (BSD license)";
110 cerr <<
"ERROR: AmplitudeFollower::initialise: "
111 <<
"channel count " << channels <<
" out of supported range"
140 sca.
name =
"Amplitude";
141 sca.
description =
"The peak tracked amplitude for the current processing block";
147 sca.
sampleType = OutputDescriptor::OneSamplePerStep;
160 att.
name =
"Attack time";
161 att.
description =
"The 60dB convergence time for an increase in amplitude";
172 dec.
name =
"Release time";
173 dec.
description =
"The 60dB convergence time for a decrease in amplitude";
187 if (paramid ==
"attack") {
189 }
else if (paramid ==
"release") {
196 if (paramid ==
"attack") {
198 }
else if (paramid ==
"release") {
210 cerr <<
"ERROR: AmplitudeFollower::process: "
211 <<
"AmplitudeFollower has not been initialised"
225 val = fabs(inputBuffers[0][i]);
233 if (val > peak) peak = val;
242 feature.
values.push_back(peak);
243 returnFeatures[0].push_back(feature);
245 return returnFeatures;
AmplitudeFollower(float inputSampleRate)
An implementation of SuperCollider's amplitude-follower algorithm as a simple Vamp plugin.
FeatureSet getRemainingFeatures()
After all blocks have been processed, calculate and return any remaining features derived from the co...
OutputList getOutputDescriptors() const
Get the outputs of this plugin.
FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp)
Process a single block of input data.
std::string getName() const
Get a human-readable name or title of the plugin.
ParameterList getParameterDescriptors() const
Get the controllable parameters of this plugin.
float getParameter(std::string paramid) const
Get the value of a named parameter.
virtual ~AmplitudeFollower()
std::string getDescription() const
Get a human-readable description for the plugin, typically a line of text that may optionally be disp...
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.
void reset()
Reset the plugin after use, to prepare it for another clean run.
std::string getIdentifier() const
Get the computer-usable name of the plugin.
int getPluginVersion() const
Get the version number of the plugin.
void setParameter(std::string paramid, float newval)
Set a named parameter.
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,...
std::vector< ParameterDescriptor > ParameterList
virtual size_t getMaxChannelCount() const
Get the maximum supported number of input channels.
std::vector< OutputDescriptor > OutputList
std::map< int, FeatureList > FeatureSet
virtual size_t getMinChannelCount() const
Get the minimum supported number of input channels.
std::string name
The human-readable name of the parameter.
std::string identifier
The name of the parameter, in computer-usable form.
std::string unit
The unit of the parameter, in human-readable form.
std::string description
A human-readable short text describing the parameter.
bool isQuantized
True if the parameter values are quantized to a particular resolution.
float minValue
The minimum value of the parameter.
float maxValue
The maximum value of the parameter.
float defaultValue
The default value of the parameter.
std::vector< float > values
Results for a single sample of this feature.
bool hasTimestamp
True if an output feature has its own timestamp.
SampleType sampleType
Positioning in time of the output results.
bool isQuantized
True if the output values are quantized to a particular resolution.
std::string unit
The unit of the output, in human-readable form.
std::string name
The human-readable name of the output.
std::string identifier
The name of the output, in computer-usable form.
bool hasKnownExtents
True if the results in each output bin fall within a fixed numeric range (minimum and maximum values)...
bool hasFixedBinCount
True if the output has the same number of values per sample for every output sample.
std::string description
A human-readable short text describing the output.
size_t binCount
The number of values per result of the output.
RealTime represents time values to nanosecond precision with accurate arithmetic and frame-rate conve...