diff options
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); |