Skip to content

Commit

Permalink
Fix synthui selector crashing on RMI sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
spessasus committed Oct 11, 2024
1 parent 656dd6e commit 3d1d75c
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 41 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SpessaSynth",
"version": "3.21.3",
"version": "3.21.4",
"type": "module",
"scripts": {
"start": "node src/website/server/server.js"
Expand Down
5 changes: 3 additions & 2 deletions src/website/js/manager/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ class Manager
console.warn("DEBUG ENABLED! DEBUGGING ENABLED!!");
}

const prePath = isLocalEdition ? "../../../spessasynth_lib/" : "../../spessasynth_lib/";
if (context.audioWorklet)
{
await context.audioWorklet.addModule(new URL("../../spessasynth_lib/" + WORKLET_PATH, import.meta.url));
await context.audioWorklet.addModule(new URL(prePath + WORKLET_PATH, import.meta.url));
}
/**
* set up soundfont
Expand All @@ -148,7 +149,7 @@ class Manager

// set up buffer here (if we let spessasynth use the default buffer, there's no reverb for the first second.)
const impulseURL = new URL(
"../../spessasynth_lib/synthetizer/audio_effects/impulse_response_2.flac",
prePath + "synthetizer/audio_effects/impulse_response_2.flac",
import.meta.url
);
const response = await fetch(impulseURL);
Expand Down
4 changes: 4 additions & 0 deletions src/website/js/synthesizer_ui/methods/synthui_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ export class Selector
const bank = parseInt(split[0]);
const program = parseInt(split[1]);
const name = this.elements.find(e => e.bank === bank && e.program === program);
if (!name)
{
return "";
}
if (bank === 128 || this.elements.filter(e => e.program === program && e.bank !== 128).length < 2)
{
return `${program}. ${name.name}`;
Expand Down
38 changes: 19 additions & 19 deletions src/website/minified/demo_main.min.js

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions src/website/minified/local_main.min.js

Large diffs are not rendered by default.

0 comments on commit 3d1d75c

Please sign in to comment.