From 17cf657f6acb3aa323c6267def47cec0bb6cacfd Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 25 Apr 2022 11:52:05 -0500 Subject: [PATCH] one more pitch calc fix --- src/engine/engine.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 3bfcb54c5..c56eff9c6 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -894,7 +894,12 @@ unsigned short DivEngine::calcBaseFreqFNumBlock(double clock, double divider, in if (block>7) block=7; bf>>=block; if (bf<0) bf=0; - if (bf>1288) { // apparently octave boundary + // octave boundaries + while (bf>0 && bf<644 && block>0) { + bf<<=1; + block--; + } + if (bf>1288) { while (block<7) { bf>>=1; block++;