To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / CepstralPitchTracker.h @ 55:b32290646213

History | View | Annotate | Download (2.76 KB)

1
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
2
/*
3
    This file is Copyright (c) 2012 Chris Cannam
4
  
5
    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
#ifndef _CEPSTRAL_PITCH_H_
26
#define _CEPSTRAL_PITCH_H_
27

    
28
#include <vamp-sdk/Plugin.h>
29

    
30
#include "NoteHypothesis.h"
31

    
32
class AgentFeeder;
33

    
34
class CepstralPitchTracker : public Vamp::Plugin
35
{
36
public:
37
    CepstralPitchTracker(float inputSampleRate);
38
    virtual ~CepstralPitchTracker();
39

    
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
    int m_vflen;
78

    
79
    int m_binFrom;
80
    int m_binTo;
81
    int m_bins; // count of "interesting" bins, those returned in m_cepOutput
82

    
83
    AgentFeeder *m_feeder;
84
    void addFeaturesFrom(NoteHypothesis h, FeatureSet &fs);
85
};
86

    
87
#endif