diff options
| author | Brian Cully <bjc@spork.org> | 2025-07-28 15:24:01 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-07-28 15:24:01 -0400 |
| commit | d9be9dc9a0b72b08d5bfaf3803bb4c2ba1fb84d1 (patch) | |
| tree | 71f73442a325623bc5556681a86d1287e4270245 /main.mjs | |
| parent | 7ca6bcfb6cab46103f2f6d8e714c3e06b8157033 (diff) | |
| download | chords-d9be9dc9a0b72b08d5bfaf3803bb4c2ba1fb84d1.tar.gz chords-d9be9dc9a0b72b08d5bfaf3803bb4c2ba1fb84d1.zip | |
wip: get tones playing again
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -28,16 +28,18 @@ function play({ detail }) { } }).filter(n => n); - player = new Player(played.map(([n, o]) => { - return toCents([noteA, 4], [n, o]); - })); - player.start(); + const getOffsets = () => { + return played.map(([n, o]) => toCents([noteA, 4], [n, o])); + } + player = document.querySelector('x-player'); + player.getOffsets = getOffsets; + player.isPlaying = true; } function stop(e) { console.debug('got stopEvent', e); if (player) { - player.stop(); + player.isPlaying = false; } } @@ -62,6 +64,7 @@ function init() { Fretboard.register(); KeyPicker.register(); History.register(); + Player.register(); // todo: maybe just attach the listener to document? document.querySelectorAll(Fretboard.name).forEach(f => { |
