From 924c84a92fe1fa6fedee85be0f467ccadcd45ad1 Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Mon, 1 Apr 2024 21:43:13 +0300 Subject: [PATCH] Skip frequency range optimization of extremely large ratios ref #632 --- src/scale.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scale.ts b/src/scale.ts index 921e3aac..fe2975d4 100644 --- a/src/scale.ts +++ b/src/scale.ts @@ -70,7 +70,7 @@ export class Scale { const numEquaves = Math.floor(low / this.size) let referenceFrequency = this.baseFrequency * this.equaveRatio ** numEquaves const result = [] - if (!isFinite(referenceFrequency)) { + if (!referenceFrequency || !isFinite(referenceFrequency)) { // The scale is too extreme for optimized calculation. Spend compute. for (let i = start; i < end; ++i) { result.push(this.getFrequency(i))