From 3c4388171635b4b6416ecc582cb622f877e67909 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Thu, 10 Jun 2021 18:15:06 +0800 Subject: [PATCH] gen_pitch_table: avoid main resonance frequencies --- gen_pitch_table.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gen_pitch_table.py b/gen_pitch_table.py index 9443c4f..ba9d3f4 100644 --- a/gen_pitch_table.py +++ b/gen_pitch_table.py @@ -32,6 +32,9 @@ print("constexpr unsigned long midi_pitch_period[" + str(end_pitch - start_pitch for i in range(start_pitch, end_pitch): period = int(pitch_to_period_micros(i)) - print(" " + str(period) + "ul,\t// " + pitch_to_name(i)) + name = pitch_to_name(i) + if name == "D3" or name == "D#3" or name == "E3": + period = int(period / 2) + print(" " + str(period) + "ul,\t// " + name) print("};") \ No newline at end of file