summaryrefslogtreecommitdiffstats
path: root/scale.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'scale.mjs')
-rw-r--r--scale.mjs5
1 files changed, 3 insertions, 2 deletions
diff --git a/scale.mjs b/scale.mjs
index 9e0e122..b4f043d 100644
--- a/scale.mjs
+++ b/scale.mjs
@@ -5,12 +5,13 @@ const ringHandler = {
};
export const chromaticScale = new Proxy(
- ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'],
+ ['A', 'A♯', 'B', 'C', 'C♯', 'D', 'D♯', 'E', 'F', 'F♯', 'G', 'G♯'],
ringHandler);
function scaleFromIntervals(tonic, intervals) {
const scaleIndex = chromaticScale.indexOf(tonic);
if (scaleIndex < 0) {
+ console.error('tonic not found in scale', tonic, chromaticScale);
return undefined;
}
@@ -24,7 +25,7 @@ function scaleFromIntervals(tonic, intervals) {
// accidentals.
if (note[0] === lastBase) {
const nextBase = chromaticScale[scaleIndex + steps + 1][0];
- scale.push(`${nextBase}b`)
+ scale.push(`${nextBase}♭`)
lastBase = nextBase[0];
} else {
scale.push(note);