summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scale.mjs4
1 files changed, 2 insertions, 2 deletions
diff --git a/scale.mjs b/scale.mjs
index 5341413..485d0c5 100644
--- a/scale.mjs
+++ b/scale.mjs
@@ -18,11 +18,11 @@ function notesBetween(a, b) {
}
}
+// todo: handle tonics with a flat ‘♭’, so we can deal with [BE]♭.
function scaleFromIntervals(tonic, intervals) {
const scaleIndex = chromaticScale.indexOf(tonic);
if (scaleIndex < 0) {
- console.error('tonic not found in scale', tonic, chromaticScale);
- return undefined;
+ throw new Error(`tonic ${tonic} not found in scale ${chromaticScale.toString()}`);
}
let scale = [tonic];