-
-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathchroma.h
47 lines (35 loc) · 1.01 KB
/
chroma.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (C) 2010-2016 Lukas Lalinsky
// Distributed under the MIT license, see the LICENSE file for details.
#ifndef CHROMAPRINT_CHROMA_H_
#define CHROMAPRINT_CHROMA_H_
#include <math.h>
#include <vector>
#include "utils.h"
#include "fft_frame_consumer.h"
#include "feature_vector_consumer.h"
namespace chromaprint {
class Chroma : public FFTFrameConsumer {
public:
Chroma(int min_freq, int max_freq, int frame_size, int sample_rate, FeatureVectorConsumer *consumer);
~Chroma();
bool interpolate() const {
return m_interpolate;
}
void set_interpolate(bool interpolate) {
m_interpolate = interpolate;
}
void Reset();
void Consume(const FFTFrame &frame);
private:
CHROMAPRINT_DISABLE_COPY(Chroma);
void PrepareNotes(int min_freq, int max_freq, int frame_size, int sample_rate);
bool m_interpolate;
std::vector<char> m_notes;
std::vector<double> m_notes_frac;
int m_min_index;
int m_max_index;
std::vector<double> m_features;
FeatureVectorConsumer *m_consumer;
};
}; // namespace chromaprint
#endif