To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / CepstralPitchTracker.h @ 66:7ad142c710c6
History | View | Annotate | Download (2.89 KB)
| 1 | 3:9366c8a58778 | Chris | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
|---|---|---|---|
| 2 | /*
|
||
| 3 | 31:2c175adf8736 | Chris | This file is Copyright (c) 2012 Chris Cannam
|
| 4 | |||
| 5 | 3:9366c8a58778 | Chris | Permission is hereby granted, free of charge, to any person
|
| 6 | obtaining a copy of this software and associated documentation
|
||
| 7 | files (the "Software"), to deal in the Software without
|
||
| 8 | restriction, including without limitation the rights to use, copy,
|
||
| 9 | modify, merge, publish, distribute, sublicense, and/or sell copies
|
||
| 10 | of the Software, and to permit persons to whom the Software is
|
||
| 11 | furnished to do so, subject to the following conditions:
|
||
| 12 | |||
| 13 | The above copyright notice and this permission notice shall be
|
||
| 14 | included in all copies or substantial portions of the Software.
|
||
| 15 | |||
| 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
| 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
| 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||
| 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
||
| 20 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||
| 21 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||
| 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
| 23 | */
|
||
| 24 | |||
| 25 | 35:2f5b169e4a3b | Chris | #ifndef _CEPSTRAL_PITCH_H_
|
| 26 | #define _CEPSTRAL_PITCH_H_
|
||
| 27 | 3:9366c8a58778 | Chris | |
| 28 | #include <vamp-sdk/Plugin.h> |
||
| 29 | |||
| 30 | 35:2f5b169e4a3b | Chris | #include "NoteHypothesis.h" |
| 31 | |||
| 32 | 55:b32290646213 | Chris | class AgentFeeder; |
| 33 | |||
| 34 | 31:2c175adf8736 | Chris | class CepstralPitchTracker : public Vamp::Plugin |
| 35 | 3:9366c8a58778 | Chris | {
|
| 36 | public:
|
||
| 37 | 31:2c175adf8736 | Chris | CepstralPitchTracker(float inputSampleRate);
|
| 38 | virtual ~CepstralPitchTracker(); |
||
| 39 | 3:9366c8a58778 | Chris | |
| 40 | std::string getIdentifier() const;
|
||
| 41 | std::string getName() const;
|
||
| 42 | std::string getDescription() const;
|
||
| 43 | std::string getMaker() const;
|
||
| 44 | int getPluginVersion() const; |
||
| 45 | std::string getCopyright() const;
|
||
| 46 | |||
| 47 | InputDomain getInputDomain() const;
|
||
| 48 | size_t getPreferredBlockSize() const;
|
||
| 49 | size_t getPreferredStepSize() const;
|
||
| 50 | size_t getMinChannelCount() const;
|
||
| 51 | size_t getMaxChannelCount() const;
|
||
| 52 | |||
| 53 | ParameterList getParameterDescriptors() const;
|
||
| 54 | float getParameter(std::string identifier) const; |
||
| 55 | void setParameter(std::string identifier, float value); |
||
| 56 | |||
| 57 | ProgramList getPrograms() const;
|
||
| 58 | std::string getCurrentProgram() const;
|
||
| 59 | void selectProgram(std::string name);
|
||
| 60 | |||
| 61 | OutputList getOutputDescriptors() const;
|
||
| 62 | |||
| 63 | bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
||
| 64 | void reset();
|
||
| 65 | |||
| 66 | FeatureSet process(const float *const *inputBuffers, |
||
| 67 | Vamp::RealTime timestamp); |
||
| 68 | |||
| 69 | FeatureSet getRemainingFeatures(); |
||
| 70 | |||
| 71 | protected:
|
||
| 72 | size_t m_channels; |
||
| 73 | size_t m_stepSize; |
||
| 74 | size_t m_blockSize; |
||
| 75 | float m_fmin;
|
||
| 76 | float m_fmax;
|
||
| 77 | 5:383c5b497f4a | Chris | int m_vflen;
|
| 78 | 3:9366c8a58778 | Chris | |
| 79 | 66:7ad142c710c6 | Chris | float m_slack;
|
| 80 | float m_sensitivity;
|
||
| 81 | float m_threshold;
|
||
| 82 | |||
| 83 | 3:9366c8a58778 | Chris | int m_binFrom;
|
| 84 | int m_binTo;
|
||
| 85 | int m_bins; // count of "interesting" bins, those returned in m_cepOutput |
||
| 86 | |||
| 87 | 57:82b3cdf6ca6b | Chris | int m_nAccepted;
|
| 88 | |||
| 89 | 55:b32290646213 | Chris | AgentFeeder *m_feeder; |
| 90 | 35:2f5b169e4a3b | Chris | void addFeaturesFrom(NoteHypothesis h, FeatureSet &fs);
|
| 91 | 57:82b3cdf6ca6b | Chris | void addNewFeatures(FeatureSet &fs);
|
| 92 | 3:9366c8a58778 | Chris | }; |
| 93 | |||
| 94 | #endif |