summaryrefslogtreecommitdiffstats
path: root/scale.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-03-09 18:51:55 -0400
committerBrian Cully <bjc@spork.org>2025-03-09 20:17:38 -0400
commit4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5 (patch)
treebba47cc866b39159828bb4125896e8d19fcf4b90 /scale.mjs
parent7f4ff6138c284299ca9a4093c4d21a00599c65ea (diff)
downloadchords-4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5.tar.gz
chords-4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5.zip
unicode
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);