summaryrefslogtreecommitdiffstats
path: root/scale.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'scale.mjs')
-rw-r--r--scale.mjs10
1 files changed, 0 insertions, 10 deletions
diff --git a/scale.mjs b/scale.mjs
index 78c8433..9c6283e 100644
--- a/scale.mjs
+++ b/scale.mjs
@@ -9,25 +9,15 @@ export function naturalNotesBetween(a, b) {
}
export function chromaticNotesBetween(a, b) {
- console.log('chromaticNotesBetween', a, b);
const [aNote, bNote] = [a, b].map(x => Note.fromString(x));
- console.log(' -- aNote', aNote);
- console.log(' -- bNote', bNote);
const aIndex = Note.noteRange.findIndex(x => aNote.toString() == x.toString());
const bIndex = Note.noteRange.findIndex(x => bNote.toString() == x.toString());
- console.log(' -- aNote', aIndex);
- console.log(' -- bNote', bIndex);
return aIndex - bIndex;
}
export function toCents([aNote, aChord], [bNote, bChord]) {
- console.debug('toCents', [aNote, aChord], [bNote, bChord]);
- console.debug('- a', [aNote, aChord]);
- console.debug('- b', [bNote, bChord]);
const offset = (aNote.distanceTo(bNote)) * 100;
- console.debug('- offset', offset);
const scale = (bChord - aChord) * 1200;
- console.debug('- scale', scale);
return scale + offset;
}