From fef594c82518a8fe4c96794852c1fc849c0ed3b3 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Sun, 17 Feb 2019 12:55:13 +0100 Subject: Added tunerdemo --- tuner.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tuner.h (limited to 'tuner.h') 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 +#include +#include +#include + +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> &v); + +private: + struct Impl; + std::unique_ptr mImpl; +}; // class Tuner + +} // namespace RIT -- cgit v1.2.3