Skip to content

SoundFont instruments: load in the background with a progress bar - #31

Closed
fabox-os wants to merge 2 commits into
mainfrom
instrument-load-progress
Closed

fabox-os wants to merge 2 commits into
mainfrom
instrument-load-progress

Conversation

@fabox-os

@fabox-os fabox-os commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Choosing a .sf2 (or opening a project with one) used to read and parse the whole file (~150 MB for GM) on the UI thread, holding it twice in memory.

  • SoundFontBank::load_reader: parse straight from a buffered reader (no second copy).
  • soundfonts::request/progress: background thread, progress from bytes read, time left from the pace; failures remembered until forget.
  • engine_sync: a track waits (keeps its synth patch) while its file loads; the window keeps repainting.
  • Inspector: progress bar "Loading… 42% · about 3 s left" in the SoundFont row; 4 new texts in all 16 languages.
  • Tests: progress estimate and text, failed file reported from the background thread. Linux fmt, clippy -D warnings, workspace tests and wasm32 engine check pass.
  • Not measured: a real GM SoundFont (none on this machine), so the speed-up is by reasoning (no UI-thread block, one copy), not a benchmark. Not tested on Windows/macOS.

🤖 Generated with Claude Code

fabox-os and others added 2 commits November 6, 2026 06:29
@fabox-os fabox-os closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant