From 89abc03520945d2ff79abc633c601f241fa10de9 Mon Sep 17 00:00:00 2001 From: inthar-raven <36112167+inthar-raven@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:21:59 -0500 Subject: [PATCH] Add files via upload --- src/analysis.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/analysis.ts b/src/analysis.ts index 6f82dfb9..d43de5bb 100644 --- a/src/analysis.ts +++ b/src/analysis.ts @@ -103,12 +103,12 @@ export function utonalFundamental(frequencies: number[], maxDivisor = 23) { } // Interval matrix a.k.a the modes of a scale -export function intervalMatrix(scale: Scale) { +export function intervalMatrix(scale: Scale, startIndex: number) { const result = []; - const degrees = [...Array(scale.size + 1).keys()]; + const degrees = [...Array(scale.size + 1 - startIndex).keys()]; for (let i = 0; i < scale.size; ++i) { const mode = scale.rotate(i); - result.push(degrees.map((j) => mode.getInterval(j))); + result.push(degrees.map((j) => mode.getInterval(j + startIndex))); } return result; }