summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2017-08-02 20:15:59 +0200
committerJustin Worthe <justin@worthe-it.co.za>2017-08-02 20:15:59 +0200
commitb783c1d9aba74cc90601251a1e9b42aca027d01e (patch)
tree052e3ee788fd7ba2248d5e3d23fbe4f3fdfff89a /src
parent0d12e0525a82df774a3c21696764922a64fae613 (diff)
Updated sharp/flat characters to use correct unicode
Diffstat (limited to 'src')
-rw-r--r--src/transforms.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/transforms.rs b/src/transforms.rs
index 6bba819..8c60aad 100644
--- a/src/transforms.rs
+++ b/src/transforms.rs
@@ -180,18 +180,18 @@ pub fn hz_to_cents_error(hz: f32) -> f32 {
pub fn hz_to_pitch(hz: f32) -> String {
let pitch_names = [
- "C ",
- "C#",
- "D ",
- "Eb",
- "E ",
- "F ",
- "F#",
- "G ",
- "G#",
- "A ",
- "Bb",
- "B "
+ "C",
+ "C♯",
+ "D",
+ "E♭",
+ "E",
+ "F",
+ "F♯",
+ "G",
+ "G♯",
+ "A",
+ "B♭",
+ "B"
];
let midi_number = hz_to_midi_number(hz);
@@ -204,7 +204,7 @@ pub fn hz_to_pitch(hz: f32) -> String {
return "< C 1".to_string();
}
- format!("{}{}", name, octave)
+ format!("{: <2}{}", name, octave)
}
#[test]