summaryrefslogtreecommitdiffstats
path: root/fretboard.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'fretboard.mjs')
-rw-r--r--fretboard.mjs12
1 files changed, 6 insertions, 6 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;
}