From 5d10fa5ba20c0b6104e92cf9d666d5be0c9d7946 Mon Sep 17 00:00:00 2001 From: Flancian <0@flancia.org> Date: Mon, 18 Dec 2023 18:02:46 +0100 Subject: [PATCH] autopushed --- bin/hz.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/hz.py b/bin/hz.py index 2ef18a6dd..c39b346a0 100755 --- a/bin/hz.py +++ b/bin/hz.py @@ -39,16 +39,15 @@ def hz(freq): # Number of half steps away. n = 12 * math.log2(freq / A4) - n = round(n) + octave = 4 + (n // 12) + n_rounded = round(n) + note_index = n_rounded % 12 notes = ["A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"] - - note_index = n % 12 note = notes[note_index] - octave = 4 + (n // 12) - - click.echo(f"hz({freq}) is {note}{str(octave)}.") + # click.echo(f"hz({freq}) is {note}{str(octave)}.") + click.echo(f"hz({freq}) is {note}.") if __name__ == '__main__':