summaryrefslogtreecommitdiffstats
path: root/main.mjs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-07-26 20:17:14 -0400
committerBrian Cully <bjc@spork.org>2025-07-26 20:17:14 -0400
commitc37f7d63ce3d67a22b0432c1085c080df4ffa819 (patch)
tree0a860c3a5e9557dae73503ee349249e218a40a6a /main.mjs
parent2a9b6ef0be04b5b5cacc47922e19c05d190d6ade (diff)
downloadchords-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.mjs10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.mjs b/main.mjs
index 80e6524..931543a 100644
--- a/main.mjs
+++ b/main.mjs
@@ -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();
});