diff options
| author | Brian Cully <bjc@spork.org> | 2025-07-26 20:17:14 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-07-26 20:17:14 -0400 |
| commit | c37f7d63ce3d67a22b0432c1085c080df4ffa819 (patch) | |
| tree | 0a860c3a5e9557dae73503ee349249e218a40a6a /main.mjs | |
| parent | 2a9b6ef0be04b5b5cacc47922e19c05d190d6ade (diff) | |
| download | chords-c37f7d63ce3d67a22b0432c1085c080df4ffa819.tar.gz chords-c37f7d63ce3d67a22b0432c1085c080df4ffa819.zip | |
add octave to string so they're not all smooshed
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -30,9 +30,13 @@ function init() { if (player) { player.stop(); } - player = new Player(e.detail.notes.filter(n => n !== 'x').map(n => { - // smoosh everything into 4 right now - return toCents([a, 4], [Note.fromString(n), 4]); + const played = e.detail.notes.map((n, i) => { + if (n !== 'x') { + return [Note.fromString(n), e.detail.octaves[i]] + } + }).filter(n => n); + player = new Player(played.map(([n, o]) => { + return toCents([a, 4], [n, o]); })); player.start(); }); |
