bool
Notes::initialise(size_t channels, size_t stepSize, size_t blockSize)
{
- m_channelCount = channels;
+ if (channels != 1) {
+ std::cerr << "Notes::initialise: channels must be 1" << std::endl;
+ return false;
+ }
+
m_stepSize = stepSize;
m_blockSize = blockSize;
processingBlockSize = stepSize * 4;
}
- m_ibuf = new_fvec(stepSize, channels);
- m_onset = new_fvec(1, channels);
- m_fftgrain = new_cvec(processingBlockSize, channels);
- m_pv = new_aubio_pvoc(processingBlockSize, stepSize, channels);
+ m_ibuf = new_fvec(stepSize);
+ m_onset = new_fvec(1);
+ m_fftgrain = new_cvec(processingBlockSize);
+ m_pv = new_aubio_pvoc(processingBlockSize, stepSize);
m_peakpick = new_aubio_peakpicker(m_threshold);
- m_onsetdet = new_aubio_onsetdetection(m_onsettype, processingBlockSize, channels);
+ m_onsetdet = new_aubio_onsetdetection(m_onsettype, processingBlockSize);
m_pitchdet = new_aubio_pitchdetection(processingBlockSize * 4,
stepSize,
- channels,
lrintf(m_inputSampleRate),
m_pitchtype,
m_pitchmode);
size_t m_median;
size_t m_stepSize;
size_t m_blockSize;
- size_t m_channelCount;
int m_minpitch;
int m_maxpitch;
bool m_wrapRange;
m_onsetdet(0),
m_onsettype(aubio_onset_complex),
m_threshold(0.3),
- m_silence(-90),
- m_channelCount(1)
+ m_silence(-90)
{
}
bool
Onset::initialise(size_t channels, size_t stepSize, size_t blockSize)
{
- m_channelCount = channels;
+ if (channels != 1) {
+ std::cerr << "Onset::initialise: channels must be 1" << std::endl;
+ return false;
+ }
+
m_stepSize = stepSize;
m_blockSize = blockSize;
- m_ibuf = new_fvec(stepSize, channels);
- m_onset = new_fvec(1, channels);
- m_fftgrain = new_cvec(blockSize, channels);
- m_pv = new_aubio_pvoc(blockSize, stepSize, channels);
+ m_ibuf = new_fvec(stepSize);
+ m_onset = new_fvec(1);
+ m_fftgrain = new_cvec(blockSize);
+ m_pv = new_aubio_pvoc(blockSize, stepSize);
m_peakpick = new_aubio_peakpicker(m_threshold);
- m_onsetdet = new_aubio_onsetdetection(m_onsettype, blockSize, channels);
+ m_onsetdet = new_aubio_onsetdetection(m_onsettype, blockSize);
m_delay = Vamp::RealTime::frame2RealTime(4 * stepSize,
lrintf(m_inputSampleRate));
d.name = "Onset Detection Function";
d.unit = "";
d.hasFixedBinCount = true;
- d.binCount = m_channelCount;
+ d.binCount = 1;
d.hasKnownExtents = false;
d.isQuantized = false;
d.sampleType = OutputDescriptor::OneSamplePerStep;
float m_silence;
size_t m_stepSize;
size_t m_blockSize;
- size_t m_channelCount;
Vamp::RealTime m_delay;
Vamp::RealTime m_lastOnset;
};
m_silence(-90),
m_wrapRange(false),
m_stepSize(0),
- m_blockSize(0),
- m_channelCount(0)
+ m_blockSize(0)
{
}
bool
Pitch::initialise(size_t channels, size_t stepSize, size_t blockSize)
{
- m_channelCount = channels;
+ if (channels != 1) {
+ std::cerr << "Pitch::initialise: channels must be 1" << std::endl;
+ return false;
+ }
+
m_stepSize = stepSize;
m_blockSize = blockSize;
- m_ibuf = new_fvec(stepSize, channels);
+ m_ibuf = new_fvec(stepSize);
m_pitchdet = new_aubio_pitchdetection(blockSize,
stepSize,
size_t m_stepSize;
size_t m_blockSize;
- size_t m_channelCount;
};
bool
Silence::initialise(size_t channels, size_t stepSize, size_t blockSize)
{
- m_channelCount = channels;
+ if (channels != 1) {
+ std::cerr << "Silence::initialise: channels must be 1" << std::endl;
+ return false;
+ }
+
m_stepSize = stepSize;
m_blockSize = blockSize;
- m_ibuf = new_fvec(stepSize, channels);
- m_pbuf = new_fvec(stepSize, channels);
+ m_ibuf = new_fvec(stepSize);
+ m_pbuf = new_fvec(stepSize);
m_tmpptrs = new smpl_t *[channels];
return true;
float m_threshold;
size_t m_stepSize;
size_t m_blockSize;
- size_t m_channelCount;
bool m_prevSilent;
bool m_first;
Vamp::RealTime m_lastChange;
m_btout(0),
m_btcounter(0),
m_threshold(0.3),
- m_silence(-90),
- m_channelCount(1)
+ m_silence(-90)
{
}
bool
Tempo::initialise(size_t channels, size_t stepSize, size_t blockSize)
{
- m_channelCount = channels;
+ if (channels != 1) {
+ std::cerr << "Tempo::initialise: channels must be 1" << std::endl;
+ return false;
+ }
+
m_stepSize = stepSize;
m_blockSize = blockSize;
- m_ibuf = new_fvec(stepSize, channels);
- m_onset = new_fvec(1, channels);
- m_fftgrain = new_cvec(blockSize, channels);
- m_pv = new_aubio_pvoc(blockSize, stepSize, channels);
+ m_ibuf = new_fvec(stepSize);
+ m_onset = new_fvec(1);
+ m_fftgrain = new_cvec(blockSize);
+ m_pv = new_aubio_pvoc(blockSize, stepSize);
m_peakpick = new_aubio_peakpicker(m_threshold);
- m_onsetdet = new_aubio_onsetdetection(m_onsettype, blockSize, channels);
+ m_onsetdet = new_aubio_onsetdetection(m_onsettype, blockSize);
m_delay = Vamp::RealTime::frame2RealTime(3 * stepSize,
lrintf(m_inputSampleRate));
float m_silence;
size_t m_stepSize;
size_t m_blockSize;
- size_t m_channelCount;
Vamp::RealTime m_delay;
Vamp::RealTime m_lastBeat;
};