From 4a4ff55ae2793183a18a5cd6acbb2bc1aae675e5 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sun, 9 Mar 2025 18:51:55 -0400 Subject: unicode --- fretboard.mjs | 12 ++++++------ index.html | 10 +++++----- scale.mjs | 5 +++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/fretboard.mjs b/fretboard.mjs index 4254d3a..4f5344e 100644 --- a/fretboard.mjs +++ b/fretboard.mjs @@ -12,17 +12,17 @@ const strings = { // true if not a natural note function isAccidental(note) { - return note[1] === '#' || note[1] === 'b'; + return note[1] === '♯' || note[1] === '♭'; } -// convert ‘Eb’ to ‘D#’ and vice versa. +// convert ‘E♭’ to ‘D♯’ and vice versa. function alternateAccidental(note) { const root = chromaticScale.indexOf(note[0]); switch (note[1]) { - case '#': - return `${chromaticScale[root+2]}b`; - case 'b': - return `${chromaticScale[root-1]}#`; + case '♯': + return `${chromaticScale[root+2]}♭`; + case '♭': + return `${chromaticScale[root-1]}♯`; default: return note; } diff --git a/index.html b/index.html index 94e9a82..fc12e45 100644 --- a/index.html +++ b/index.html @@ -101,17 +101,17 @@