diff options
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(); }); |
