summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2017-11-03 20:35:43 +0200
committerJustin Worthe <justin@worthe-it.co.za>2017-11-03 20:35:43 +0200
commit604f56e2e433d9b941e3054612b5c286120f558a (patch)
tree47f90a0b1f8680905ecaa3129ff8b46f02a06ade /src
parent669987f0ebd01963d0eb52849fd4f16640350232 (diff)
Added a connection to the microphone through the web, calling into Rust
Diffstat (limited to 'src')
-rw-r--r--src/transforms.rs4
1 files changed, 4 insertions, 0 deletions
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♯",