diff options
author | Roland Stigge <stigge@antcom.de> | 2019-02-17 12:55:13 +0100 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2019-02-17 12:55:13 +0100 |
commit | fef594c82518a8fe4c96794852c1fc849c0ed3b3 (patch) | |
tree | 2efbedc8b126a77d91633ce8b9201dc4a7db764c /tuner.h | |
parent | 1a219839034e9b11a4771fb84c90d4a2667365ce (diff) |
Added tunerdemo
Diffstat (limited to 'tuner.h')
-rw-r--r-- | tuner.h | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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 |