Mercurial > hg > silvet
comparison src/Silvet.h @ 267:a8c05709e486
Merge from branch "norm"
author | Chris Cannam |
---|---|
date | Wed, 23 Jul 2014 17:51:58 +0100 |
parents | 34e69544691b |
children | e5f897b2d5e8 |
comparison
equal
deleted
inserted
replaced
250:ec296f783a6f | 267:a8c05709e486 |
---|---|
30 using std::set; | 30 using std::set; |
31 using std::map; | 31 using std::map; |
32 | 32 |
33 class Resampler; | 33 class Resampler; |
34 class CQSpectrogram; | 34 class CQSpectrogram; |
35 class FlattenDynamics; | |
35 | 36 |
36 class Silvet : public Vamp::Plugin | 37 class Silvet : public Vamp::Plugin |
37 { | 38 { |
38 public: | 39 public: |
39 Silvet(float inputSampleRate); | 40 Silvet(float inputSampleRate); |
72 | 73 |
73 protected: | 74 protected: |
74 const std::vector<InstrumentPack> m_instruments; | 75 const std::vector<InstrumentPack> m_instruments; |
75 | 76 |
76 Resampler *m_resampler; | 77 Resampler *m_resampler; |
78 FlattenDynamics *m_flattener; | |
77 CQSpectrogram *m_cq; | 79 CQSpectrogram *m_cq; |
78 | 80 |
79 bool m_hqMode; | 81 bool m_hqMode; |
80 bool m_fineTuning; | 82 bool m_fineTuning; |
81 int m_instrument; | 83 int m_instrument; |
84 typedef vector<vector<double> > Grid; | 86 typedef vector<vector<double> > Grid; |
85 | 87 |
86 vector<MedianFilter<double> *> m_postFilter; | 88 vector<MedianFilter<double> *> m_postFilter; |
87 vector<map<int, double> > m_pianoRoll; | 89 vector<map<int, double> > m_pianoRoll; |
88 vector<map<int, int> > m_pianoRollShifts; | 90 vector<map<int, int> > m_pianoRollShifts; |
91 map<Vamp::RealTime, float> m_inputGains; | |
89 | 92 |
90 Grid preProcess(const Grid &); | 93 Grid preProcess(const Grid &); |
91 | 94 |
92 void postProcess(const vector<double> &pitches, | 95 void postProcess(const vector<double> &pitches, |
93 const vector<int> &bestShifts, | 96 const vector<int> &bestShifts, |
95 | 98 |
96 FeatureList noteTrack(int shiftCount); | 99 FeatureList noteTrack(int shiftCount); |
97 | 100 |
98 void emitNote(int start, int end, int note, int shiftCount, | 101 void emitNote(int start, int end, int note, int shiftCount, |
99 FeatureList ¬eFeatures); | 102 FeatureList ¬eFeatures); |
103 | |
104 Feature makeNoteFeature(int start, int end, int note, int shift, | |
105 int shiftCount, int velocity); | |
106 | |
107 float getInputGainAt(Vamp::RealTime t); | |
100 | 108 |
101 FeatureSet transcribe(const Grid &); | 109 FeatureSet transcribe(const Grid &); |
102 | 110 |
103 string noteName(int n, int shift, int shiftCount) const; | 111 string noteName(int n, int shift, int shiftCount) const; |
104 float noteFrequency(int n, int shift, int shiftCount) const; | 112 float noteFrequency(int n, int shift, int shiftCount) const; |