21 #define _USE_MATH_DEFINES 27 #include <vamp-sdk/Plugin.h> 156 Rhythm(
float inputSampleRate);
158 string getIdentifier()
const;
159 string getName()
const;
160 string getDescription()
const;
161 string getMaker()
const;
162 int getPluginVersion()
const;
163 string getCopyright()
const;
164 InputDomain getInputDomain()
const;
165 size_t getPreferredBlockSize()
const;
166 size_t getPreferredStepSize()
const;
167 size_t getMinChannelCount()
const;
168 size_t getMaxChannelCount()
const;
169 ParameterList getParameterDescriptors()
const;
170 float getParameter(
string identifier)
const;
171 void setParameter(
string identifier,
float value);
172 ProgramList getPrograms()
const;
173 string getCurrentProgram()
const;
174 void selectProgram(
string name);
175 OutputList getOutputDescriptors()
const;
176 bool initialise(
size_t channels,
size_t stepSize,
size_t blockSize);
178 FeatureSet process(
const float *
const *inputBuffers,
179 Vamp::RealTime timestamp);
180 FeatureSet getRemainingFeatures();
185 float halfHanning(
float n);
186 float canny(
float n);
187 float findRemainder(vector<int> peaks,
int thisPeak);
188 float findTempo(vector<int> peaks);
189 float findMeanPeak(vector<float> signal, vector<int> peaks,
int shift);
190 void findCorrelationPeaks(vector<float> autocor_in,
float percentile_in,
191 int windowLength_in,
int shift_in,
192 vector<int>& peaks_out, vector<int>& valleys_out);
193 void autocorrelation(vector<float> signal_in,
int startShift_in,
194 int endShift_in, vector<float>& autocor_out);
195 void findOnsetPeaks(vector<float> onset_in,
int windowLength_in,
196 vector<int>& peaks_out);
197 void movingAverage(vector<float> signal_in,
int windowLength_in,
198 float threshold_in, vector<float>& average_out,
199 vector<float>& difference_out);
200 void normalise(vector<float> signal_in, vector<float>& normalised_out);
201 void halfHannConvolve(vector<vector<float> >& envelope_out);
202 void cannyConvolve(vector<vector<float> > envelope_in,
203 vector<float>& onset_out);
206 int m_blockSize, m_stepSize;
int halfHannLength
Definition: Rhythm.h:212
vector< vector< float > > intensity
Definition: Rhythm.h:217
float threshold
Definition: Rhythm.h:218
Calculates rhythmic features of a signal, including onsets and tempo.
Definition: Rhythm.h:153
float * bandHighFreq
Definition: Rhythm.h:211
int min_bpm
Definition: Rhythm.h:222
int cannyLength
Definition: Rhythm.h:214
void calculateBandFreqs()
Definition: Rhythm.cpp:565
int average_window
Definition: Rhythm.h:219
int peak_window
Definition: Rhythm.h:220
int max_bpm
Definition: Rhythm.h:221
float * cannyWindow
Definition: Rhythm.h:216
float * halfHannWindow
Definition: Rhythm.h:213
int numBands
Definition: Rhythm.h:210
float cannyShape
Definition: Rhythm.h:215