From: Chris Cannam Date: Mon, 9 Jul 2012 14:50:30 +0000 (+0100) Subject: (Start to) remove the channel counts from everywhere: they should always be 1 anyway... X-Git-Tag: hgimport~18 X-Git-Url: https://git.aubio.org/?p=vamp-aubio-plugins.git;a=commitdiff_plain;h=725f87970c672a65702181b6330057e25e36213b (Start to) remove the channel counts from everywhere: they should always be 1 anyway as that's what Vamp::Plugin::getMaxChannelCount always defaulted to --- diff --git a/plugins/Notes.cpp b/plugins/Notes.cpp index 30ba640..d338690 100644 --- a/plugins/Notes.cpp +++ b/plugins/Notes.cpp @@ -96,7 +96,11 @@ Notes::getCopyright() const 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; @@ -108,17 +112,16 @@ Notes::initialise(size_t channels, size_t stepSize, size_t 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); diff --git a/plugins/Notes.h b/plugins/Notes.h index 9550350..723a81e 100644 --- a/plugins/Notes.h +++ b/plugins/Notes.h @@ -71,7 +71,6 @@ protected: 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; diff --git a/plugins/Onset.cpp b/plugins/Onset.cpp index daf0567..3e3f8d9 100644 --- a/plugins/Onset.cpp +++ b/plugins/Onset.cpp @@ -32,8 +32,7 @@ Onset::Onset(float inputSampleRate) : m_onsetdet(0), m_onsettype(aubio_onset_complex), m_threshold(0.3), - m_silence(-90), - m_channelCount(1) + m_silence(-90) { } @@ -86,17 +85,21 @@ Onset::getCopyright() const 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)); @@ -221,7 +224,7 @@ Onset::getOutputDescriptors() const 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; diff --git a/plugins/Onset.h b/plugins/Onset.h index a88409c..80fd0e6 100644 --- a/plugins/Onset.h +++ b/plugins/Onset.h @@ -66,7 +66,6 @@ protected: float m_silence; size_t m_stepSize; size_t m_blockSize; - size_t m_channelCount; Vamp::RealTime m_delay; Vamp::RealTime m_lastOnset; }; diff --git a/plugins/Pitch.cpp b/plugins/Pitch.cpp index 054c69c..40c310e 100644 --- a/plugins/Pitch.cpp +++ b/plugins/Pitch.cpp @@ -38,8 +38,7 @@ Pitch::Pitch(float inputSampleRate) : m_silence(-90), m_wrapRange(false), m_stepSize(0), - m_blockSize(0), - m_channelCount(0) + m_blockSize(0) { } @@ -88,11 +87,15 @@ Pitch::getCopyright() const 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, diff --git a/plugins/Pitch.h b/plugins/Pitch.h index f8d7b48..e7b0ec5 100644 --- a/plugins/Pitch.h +++ b/plugins/Pitch.h @@ -65,7 +65,6 @@ protected: size_t m_stepSize; size_t m_blockSize; - size_t m_channelCount; }; diff --git a/plugins/Silence.cpp b/plugins/Silence.cpp index 084ac02..cf3dda4 100644 --- a/plugins/Silence.cpp +++ b/plugins/Silence.cpp @@ -78,12 +78,16 @@ Silence::getCopyright() const 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; diff --git a/plugins/Silence.h b/plugins/Silence.h index 2a3faca..5b1e4cf 100644 --- a/plugins/Silence.h +++ b/plugins/Silence.h @@ -59,7 +59,6 @@ protected: 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; diff --git a/plugins/Tempo.cpp b/plugins/Tempo.cpp index 58b35f0..27b817d 100644 --- a/plugins/Tempo.cpp +++ b/plugins/Tempo.cpp @@ -38,8 +38,7 @@ Tempo::Tempo(float inputSampleRate) : m_btout(0), m_btcounter(0), m_threshold(0.3), - m_silence(-90), - m_channelCount(1) + m_silence(-90) { } @@ -95,17 +94,21 @@ Tempo::getCopyright() const 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)); diff --git a/plugins/Tempo.h b/plugins/Tempo.h index ac8f6de..c70c068 100644 --- a/plugins/Tempo.h +++ b/plugins/Tempo.h @@ -71,7 +71,6 @@ protected: float m_silence; size_t m_stepSize; size_t m_blockSize; - size_t m_channelCount; Vamp::RealTime m_delay; Vamp::RealTime m_lastBeat; };