Add an Interface for Pitchtrackers and set VolTresholds

This commit is contained in:
Flamefire committed 2014-04-16 21:05:57 +02:00
1 parent 5f79406cf2
commit d04cbe7ceb
16 files changed
+344 -173

No files matched your search

+7 -2
View File
@@ -29,7 +29,9 @@ public:
_AnalysisBuf.insert(begin, end);
}
int GetNote(double* restrict maxVolume, float* restrict weights);
int GetNote(float* restrict maxVolume, float* restrict weights);
void SetVolumeThreshold(float threshold);
float GetVolumeThreshold(){return _VolTreshold;}
static int GetNumHalfTones(){ return _MaxHalfTone - _MinHalfTone + 1;}
private:
@@ -48,8 +50,11 @@ private:
constexpr static size_t _SampleCt = 2048;
RingBuffer<_SampleCt * 2> _AnalysisBuf;
unsigned _Step;
float _VolTreshold;
float _LastMaxVol;
int _GetNote(float* restrict samples, float* restrict maxVolume, float* restrict weights);
static int _GetNote(float* restrict samples, double* restrict maxVolume, float* restrict weights);
static float _AnalyzeBySampleCt(float* restrict samples, float* restrict samplesWindowed, float samplesPerPeriodD);
static inline float _AnalyzeByTone(float* restrict samples, float* restrict samplesWindowed, int toneIndex);
static float _AKFBySampleCt(float* restrict samples, float samplesPerPeriodD);