Skip to content

Commit

Permalink
Skip frequency range optimization of extremely large ratios
Browse files Browse the repository at this point in the history
ref #632
  • Loading branch information
frostburn committed Apr 1, 2024
1 parent d01a750 commit 924c84a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 924c84a

Please sign in to comment.