From ac5c736c4ece0cd0794a17d0de52894a3d377b35 Mon Sep 17 00:00:00 2001 From: JessJess Date: Sun, 5 Apr 2026 16:56:31 +0100 Subject: [PATCH] Add jukebox feature with SpessaSynth MIDI playback after digging around for a proper .mid player for the web, landed on spessasynth_lib (AudioWorklet-based SF2 synthesizer). using GeneralUser GS as the soundfont: https://github.com/mrbumpy409/GeneralUser-GS SF2 is preloaded on page init and cached in IndexedDB so it's instant after first visit. --- .gitignore | 3 + index.html | 10 +- package.json | 3 +- pnpm-lock.yaml | 15 ++ public/jbox/.gitkeep | 0 src/client/client.ts | 4 + src/client/events.ts | 2 + src/controllers/audio-controller.ts | 121 ++++++++++++++- src/controllers/index.ts | 1 + src/controllers/jukebox-controller.ts | 25 +++ src/controllers/mouse-controller.ts | 5 + src/db.ts | 72 +++++++-- src/edf.ts | 4 + src/handlers/index.ts | 2 + src/handlers/jukebox.ts | 94 +++++++++++ src/main.ts | 4 + src/ui/jukebox-dialog/index.ts | 1 + src/ui/jukebox-dialog/jukebox-dialog.css | 34 ++++ src/ui/jukebox-dialog/jukebox-dialog.ts | 190 +++++++++++++++++++++++ src/ui/utils/create-menu-item.ts | 18 +++ src/wiring/client-events.ts | 13 ++ src/wiring/ui-events.ts | 6 + 22 files changed, 607 insertions(+), 20 deletions(-) create mode 100644 public/jbox/.gitkeep create mode 100644 src/controllers/jukebox-controller.ts create mode 100644 src/handlers/jukebox.ts create mode 100644 src/ui/jukebox-dialog/index.ts create mode 100644 src/ui/jukebox-dialog/jukebox-dialog.css create mode 100644 src/ui/jukebox-dialog/jukebox-dialog.ts diff --git a/.gitignore b/.gitignore index 29c755b2..2e164743 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,8 @@ public/sfx* public/mfx* public/maps public/data +public/jbox/* +!public/jbox/.gitkeep +public/soundfonts dist .DS_Store \ No newline at end of file diff --git a/index.html b/index.html index 8fe8732e..b5a6ad7d 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,8 @@ EO Web Client + + @@ -347,6 +349,12 @@ + +