diff options
author | Brian Cully <bjc@spork.org> | 2025-03-09 18:51:55 -0400 |
---|---|---|
committer | Brian Cully <bjc@spork.org> | 2025-03-09 20:17:38 -0400 |
commit | 4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5 (patch) | |
tree | bba47cc866b39159828bb4125896e8d19fcf4b90 /scale.mjs | |
parent | 7f4ff6138c284299ca9a4093c4d21a00599c65ea (diff) | |
download | chords-4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5.tar.gz chords-4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5.zip |
unicode
Diffstat (limited to 'scale.mjs')
-rw-r--r-- | scale.mjs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |