diff options
-rw-r--r-- | scale.mjs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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]; |