annotate plugins/KeyDetect.h @ 63:b084e87b83e4

* Add README files for the various platform packages * Fix typo in cat file * Return simpler key names from key detector * Chromagram and constant Q default to unnormalized * Permit up to 48 bpo in constant Q
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 07 Feb 2008 10:03:04 +0000
parents 90fa946fda40
children 3602e755b696
rev   line source
c@21 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@21 2
c@21 3 /*
c@21 4 Vamp
c@21 5
c@21 6 An API for audio analysis and feature extraction plugins.
c@21 7
c@21 8 Centre for Digital Music, Queen Mary, University of London.
c@21 9 Copyright 2006-2007 QMUL.
c@21 10
c@21 11 Permission is hereby granted, free of charge, to any person
c@21 12 obtaining a copy of this software and associated documentation
c@21 13 files (the "Software"), to deal in the Software without
c@21 14 restriction, including without limitation the rights to use, copy,
c@21 15 modify, merge, publish, distribute, sublicense, and/or sell copies
c@21 16 of the Software, and to permit persons to whom the Software is
c@21 17 furnished to do so, subject to the following conditions:
c@21 18
c@21 19 The above copyright notice and this permission notice shall be
c@21 20 included in all copies or substantial portions of the Software.
c@21 21
c@21 22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
c@21 23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c@21 24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c@21 25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
c@21 26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
c@21 27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
c@21 28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
c@21 29
c@21 30 Except as contained in this notice, the names of the Centre for
c@21 31 Digital Music; Queen Mary, University of London; and Chris Cannam
c@21 32 shall not be used in advertising or otherwise to promote the sale,
c@21 33 use or other dealings in this Software without prior written
c@21 34 authorization.
c@21 35 */
c@21 36
c@21 37 #ifndef _GETMODE_PLUGIN_H_
c@21 38 #define _GETMODE_PLUGIN_H_
c@21 39
c@21 40 #include <vamp-sdk/Plugin.h>
c@21 41
c@21 42 #include <dsp/keydetection/GetKeyMode.h>
c@21 43
c@21 44 class KeyDetector : public Vamp::Plugin
c@21 45 {
c@21 46 public:
c@21 47 KeyDetector(float inputSampleRate);
c@21 48 virtual ~KeyDetector();
c@21 49
c@21 50 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
c@21 51 void reset();
c@21 52
c@21 53 InputDomain getInputDomain() const { return TimeDomain; }
c@21 54
c@22 55 std::string getIdentifier() const;
c@21 56 std::string getName() const;
c@21 57 std::string getDescription() const;
c@21 58 std::string getMaker() const;
c@21 59 int getPluginVersion() const;
c@21 60 std::string getCopyright() const;
c@21 61
c@21 62 ParameterList getParameterDescriptors() const;
c@21 63 float getParameter(std::string) const;
c@21 64 void setParameter(std::string, float);
c@21 65
c@21 66 OutputList getOutputDescriptors() const;
c@21 67
c@21 68 FeatureSet process(const float *const *inputBuffers,
c@21 69 Vamp::RealTime timestamp);
c@21 70
c@21 71 FeatureSet getRemainingFeatures();
c@21 72
c@21 73 size_t getPreferredStepSize() const;
c@21 74 size_t getPreferredBlockSize() const;
c@21 75
c@21 76 protected:
c@21 77 mutable size_t m_stepSize;
c@21 78 mutable size_t m_blockSize;
c@21 79 float m_tuningFrequency;
c@21 80 int m_length;
c@21 81
c@63 82 std::string getKeyName(int index, bool minor, bool includeMajMin) const;
c@21 83
c@21 84 GetKeyMode* m_getKeyMode;
c@21 85 double* m_inputFrame;
c@21 86 int m_prevKey;
c@21 87 };
c@21 88
c@21 89
c@21 90 #endif