From c37f7d63ce3d67a22b0432c1085c080df4ffa819 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Sat, 26 Jul 2025 20:17:14 -0400 Subject: add octave to string so they're not all smooshed --- main.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'main.mjs') 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(); }); -- cgit v1.3