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 _NOTES_PLUGIN_H_
|
cannam@0
|
18 #define _NOTES_PLUGIN_H_
|
cannam@0
|
19
|
cannam@0
|
20 #include <vamp-sdk/Plugin.h>
|
piem@51
|
21 #include <aubio/aubio.h>
|
cannam@0
|
22
|
cannam@0
|
23 #include <deque>
|
cannam@0
|
24
|
cannam@30
|
25 #include "Types.h"
|
cannam@30
|
26
|
cannam@0
|
27 class Notes : public Vamp::Plugin
|
cannam@0
|
28 {
|
cannam@0
|
29 public:
|
cannam@31
|
30 Notes(float inputSampleRate);
|
cannam@0
|
31 virtual ~Notes();
|
cannam@0
|
32
|
cannam@0
|
33 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
cannam@0
|
34 void reset();
|
cannam@0
|
35
|
cannam@0
|
36 InputDomain getInputDomain() const { return TimeDomain; }
|
cannam@0
|
37
|
cannam@13
|
38 std::string getIdentifier() const;
|
cannam@0
|
39 std::string getName() const;
|
cannam@0
|
40 std::string getDescription() const;
|
cannam@0
|
41 std::string getMaker() const;
|
cannam@0
|
42 int getPluginVersion() const;
|
cannam@0
|
43 std::string getCopyright() const;
|
cannam@0
|
44
|
cannam@0
|
45 ParameterList getParameterDescriptors() const;
|
cannam@0
|
46 float getParameter(std::string) const;
|
cannam@0
|
47 void setParameter(std::string, float);
|
cannam@0
|
48
|
cannam@0
|
49 size_t getPreferredStepSize() const;
|
cannam@0
|
50 size_t getPreferredBlockSize() const;
|
cannam@0
|
51
|
cannam@0
|
52 OutputList getOutputDescriptors() const;
|
cannam@0
|
53
|
cannam@12
|
54 FeatureSet process(const float *const *inputBuffers,
|
cannam@12
|
55 Vamp::RealTime timestamp);
|
cannam@0
|
56
|
cannam@0
|
57 FeatureSet getRemainingFeatures();
|
cannam@0
|
58
|
cannam@0
|
59 protected:
|
cannam@0
|
60 fvec_t *m_ibuf;
|
cannam@0
|
61 fvec_t *m_onset;
|
cannam@34
|
62 fvec_t *m_pitch;
|
cannam@30
|
63 aubio_onset_t *m_onsetdet;
|
cannam@30
|
64 OnsetType m_onsettype;
|
cannam@30
|
65 aubio_pitch_t *m_pitchdet;
|
cannam@30
|
66 PitchType m_pitchtype;
|
cannam@0
|
67 float m_threshold;
|
cannam@0
|
68 float m_silence;
|
cannam@34
|
69 float m_minioi;
|
cannam@0
|
70 size_t m_median;
|
cannam@0
|
71 size_t m_stepSize;
|
cannam@0
|
72 size_t m_blockSize;
|
cannam@7
|
73 int m_minpitch;
|
cannam@7
|
74 int m_maxpitch;
|
cannam@7
|
75 bool m_wrapRange;
|
cannam@7
|
76 bool m_avoidLeaps;
|
cannam@0
|
77 std::deque<float> m_notebuf;
|
cannam@0
|
78 size_t m_count;
|
piem@5
|
79 Vamp::RealTime m_delay;
|
cannam@0
|
80 Vamp::RealTime m_currentOnset;
|
cannam@0
|
81 Vamp::RealTime m_lastTimeStamp;
|
cannam@0
|
82 float m_currentLevel;
|
cannam@0
|
83 bool m_haveCurrent;
|
cannam@7
|
84 int m_prevPitch;
|
cannam@0
|
85
|
cannam@0
|
86 void pushNote(FeatureSet &, const Vamp::RealTime &);
|
cannam@0
|
87 };
|
cannam@0
|
88
|
cannam@0
|
89
|
cannam@0
|
90 #endif
|