summaryrefslogtreecommitdiffhomepage
path: root/tuner.h
diff options
context:
space:
mode:
Diffstat (limited to 'tuner.h')
-rw-r--r--tuner.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/tuner.h b/tuner.h
new file mode 100644
index 0000000..df17c0f
--- /dev/null
+++ b/tuner.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include <complex>
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace RIT {
+
+struct Pitch {
+ double f{}; // in Hz
+ double deviation{}; // 0.0 == perfect, +/-1.0: at next note
+ std::string name; // "" for none, "A", "A#", ... for notes
+};
+
+class Tuner {
+public:
+ Tuner(int size, int f_sample);
+ ~Tuner();
+
+ Pitch operator() (const std::vector<std::complex<double>> &v);
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> mImpl;
+}; // class Tuner
+
+} // namespace RIT