From 604f56e2e433d9b941e3054612b5c286120f558a Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Fri, 3 Nov 2017 20:35:43 +0200 Subject: Added a connection to the microphone through the web, calling into Rust --- src/transforms.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/transforms.rs b/src/transforms.rs index aaae83b..2565120 100644 --- a/src/transforms.rs +++ b/src/transforms.rs @@ -179,6 +179,10 @@ pub fn hz_to_cents_error(hz: f32) -> f32 { } pub fn hz_to_pitch(hz: f32) -> String { + if hz <= 0.0 { + return "< C 1".to_string(); + } + let pitch_names = [ "C", "C♯", -- cgit v1.2.3