diff options
| author | Brian Cully <bjc@spork.org> | 2025-07-28 15:36:21 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-07-28 15:36:21 -0400 |
| commit | 9620d3750c54b21c3da0460cea117b57fbeb9eac (patch) | |
| tree | 387b04a089a7fa1c8b5ab381616fa81561c55e7a /scale.mjs | |
| parent | d9be9dc9a0b72b08d5bfaf3803bb4c2ba1fb84d1 (diff) | |
| download | chords-9620d3750c54b21c3da0460cea117b57fbeb9eac.tar.gz chords-9620d3750c54b21c3da0460cea117b57fbeb9eac.zip | |
get volume control working
Diffstat (limited to 'scale.mjs')
| -rw-r--r-- | scale.mjs | 10 |
1 files changed, 0 insertions, 10 deletions
@@ -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; } |
