annotate plugins/Pitch.h @ 30:7fd8f7a0b088

Start overhaul for (current git, presumably later v0.4.0) aubio API
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 09 Jul 2012 15:10:35 +0100
parents 1a7563c56d88
children 2e979622bd93
rev   line source
cannam@0 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@0 2
cannam@0 3 /*
cannam@0 4 Vamp feature extraction plugins using Paul Brossier's Aubio library.
cannam@0 5
cannam@0 6 Centre for Digital Music, Queen Mary, University of London.
cannam@0 7 This file copyright 2006 Chris Cannam.
cannam@0 8
cannam@0 9 This program is free software; you can redistribute it and/or
cannam@0 10 modify it under the terms of the GNU General Public License as
cannam@0 11 published by the Free Software Foundation; either version 2 of the
cannam@0 12 License, or (at your option) any later version. See the file
cannam@0 13 COPYING included with this distribution for more information.
cannam@0 14
cannam@0 15 */
cannam@0 16
cannam@0 17 #ifndef _PITCH_PLUGIN_H_
cannam@0 18 #define _PITCH_PLUGIN_H_
cannam@0 19
cannam@0 20 #include <vamp-sdk/Plugin.h>
cannam@0 21 #include <aubio/aubio.h>
cannam@0 22
cannam@0 23 class Pitch : public Vamp::Plugin
cannam@0 24 {
cannam@0 25 public:
cannam@0 26 Pitch(float inputSampleRate);
cannam@0 27 virtual ~Pitch();
cannam@0 28
cannam@0 29 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
cannam@0 30 void reset();
cannam@0 31
cannam@0 32 InputDomain getInputDomain() const { return TimeDomain; }
cannam@0 33
cannam@13 34 std::string getIdentifier() const;
cannam@0 35 std::string getName() const;
cannam@0 36 std::string getDescription() const;
cannam@0 37 std::string getMaker() const;
cannam@0 38 int getPluginVersion() const;
cannam@0 39 std::string getCopyright() const;
cannam@0 40
cannam@0 41 ParameterList getParameterDescriptors() const;
cannam@0 42 float getParameter(std::string) const;
cannam@0 43 void setParameter(std::string, float);
cannam@0 44
cannam@0 45 size_t getPreferredStepSize() const;
cannam@0 46 size_t getPreferredBlockSize() const;
cannam@0 47
cannam@0 48 OutputList getOutputDescriptors() const;
cannam@0 49
cannam@12 50 FeatureSet process(const float *const *inputBuffers,
cannam@12 51 Vamp::RealTime timestamp);
cannam@0 52
cannam@0 53 FeatureSet getRemainingFeatures();
cannam@0 54
cannam@0 55 protected:
cannam@0 56 fvec_t *m_ibuf;
cannam@30 57 aubio_pitch_t *m_pitchdet;
cannam@30 58 PitchType m_pitchtype;
cannam@23 59 float m_minfreq;
cannam@23 60 float m_maxfreq;
cannam@23 61 float m_silence;
cannam@23 62 bool m_wrapRange;
cannam@23 63
cannam@0 64 size_t m_stepSize;
cannam@0 65 size_t m_blockSize;
cannam@0 66 size_t m_channelCount;
cannam@0 67 };
cannam@0 68
cannam@0 69
cannam@0 70 #endif