summaryrefslogtreecommitdiffstats
path: root/main.mjs
diff options
context:
space:
mode:
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();
});