cannam@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0:
cannam@0: /*
cannam@0: Vamp feature extraction plugins using Paul Brossier's Aubio library.
cannam@0:
cannam@0: Centre for Digital Music, Queen Mary, University of London.
cannam@0: This file copyright 2006 Chris Cannam.
cannam@0:
piem@112: This file is part of vamp-aubio-plugins.
piem@112:
piem@112: vamp-aubio is free software: you can redistribute it and/or modify
piem@112: it under the terms of the GNU General Public License as published by
piem@112: the Free Software Foundation, either version 3 of the License, or
piem@112: (at your option) any later version.
piem@112:
piem@112: vamp-aubio is distributed in the hope that it will be useful,
piem@112: but WITHOUT ANY WARRANTY; without even the implied warranty of
piem@112: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
piem@112: GNU General Public License for more details.
piem@112:
piem@112: You should have received a copy of the GNU General Public License
piem@112: along with aubio. If not, see .
cannam@0:
cannam@0: */
cannam@0:
cannam@0: #ifndef _NOTES_PLUGIN_H_
cannam@0: #define _NOTES_PLUGIN_H_
cannam@0:
cannam@0: #include
piem@51: #include
cannam@0:
cannam@0: #include
cannam@0:
cannam@30: #include "Types.h"
cannam@30:
cannam@0: class Notes : public Vamp::Plugin
cannam@0: {
cannam@0: public:
cannam@31: Notes(float inputSampleRate);
cannam@0: virtual ~Notes();
cannam@0:
cannam@0: bool initialise(size_t channels, size_t stepSize, size_t blockSize);
cannam@0: void reset();
cannam@0:
cannam@0: InputDomain getInputDomain() const { return TimeDomain; }
cannam@0:
cannam@13: std::string getIdentifier() const;
cannam@0: std::string getName() const;
cannam@0: std::string getDescription() const;
cannam@0: std::string getMaker() const;
cannam@0: int getPluginVersion() const;
cannam@0: std::string getCopyright() const;
cannam@0:
cannam@0: ParameterList getParameterDescriptors() const;
cannam@0: float getParameter(std::string) const;
cannam@0: void setParameter(std::string, float);
cannam@0:
cannam@0: size_t getPreferredStepSize() const;
cannam@0: size_t getPreferredBlockSize() const;
cannam@0:
cannam@0: OutputList getOutputDescriptors() const;
cannam@0:
cannam@12: FeatureSet process(const float *const *inputBuffers,
cannam@12: Vamp::RealTime timestamp);
cannam@0:
cannam@0: FeatureSet getRemainingFeatures();
cannam@0:
cannam@0: protected:
cannam@0: fvec_t *m_ibuf;
cannam@0: fvec_t *m_onset;
cannam@34: fvec_t *m_pitch;
cannam@30: aubio_onset_t *m_onsetdet;
cannam@30: OnsetType m_onsettype;
cannam@30: aubio_pitch_t *m_pitchdet;
cannam@30: PitchType m_pitchtype;
cannam@0: float m_threshold;
cannam@0: float m_silence;
cannam@34: float m_minioi;
cannam@0: size_t m_median;
cannam@0: size_t m_stepSize;
cannam@0: size_t m_blockSize;
cannam@7: int m_minpitch;
cannam@7: int m_maxpitch;
cannam@7: bool m_wrapRange;
cannam@7: bool m_avoidLeaps;
cannam@0: std::deque m_notebuf;
cannam@0: size_t m_count;
piem@5: Vamp::RealTime m_delay;
cannam@0: Vamp::RealTime m_currentOnset;
cannam@0: Vamp::RealTime m_lastTimeStamp;
cannam@0: float m_currentLevel;
cannam@0: bool m_haveCurrent;
cannam@7: int m_prevPitch;
cannam@0:
cannam@0: void pushNote(FeatureSet &, const Vamp::RealTime &);
cannam@0: };
cannam@0:
cannam@0:
cannam@0: #endif