summaryrefslogtreecommitdiffhomepage
path: root/tunerdemo.cpp
diff options
context:
space:
mode:
authorRoland Stigge <stigge@antcom.de>2019-02-17 14:53:33 +0100
committerRoland Stigge <stigge@antcom.de>2019-02-17 14:53:33 +0100
commit308a53c389cdc2631860f434989cd57efbf91145 (patch)
tree2eadba9413a881045caedd589cc9aec7fda40134 /tunerdemo.cpp
parentfef594c82518a8fe4c96794852c1fc849c0ed3b3 (diff)
Implemented Tuner
Diffstat (limited to 'tunerdemo.cpp')
-rw-r--r--tunerdemo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tunerdemo.cpp b/tunerdemo.cpp
index 716bd8e..e70afb2 100644
--- a/tunerdemo.cpp
+++ b/tunerdemo.cpp
@@ -23,7 +23,10 @@ int main(int argc, char* argv[]) {
auto start = std::chrono::high_resolution_clock::now();
RIT::Pitch pitch = tuner(dataIn);
auto end = std::chrono::high_resolution_clock::now();
- std::cout << "Detected Note: " << pitch.name
+ std::string name = pitch.name;
+ if (name == "")
+ name = "<none>";
+ std::cout << "Detected Note: " << name
<< " Deviation: " << pitch.deviation
<< " Frequency: " << pitch.f
<< ", took " << std::chrono::nanoseconds(end - start).count() * 0.000001 << "ms"