spessasynth_core 3.26.2 → 3.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_core",
3
- "version": "3.26.2",
3
+ "version": "3.26.3",
4
4
  "description": "MIDI and SoundFont2/DLS library with no compromises",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -12,7 +12,7 @@ export function clearSoundFont(sendPresets = true, clearOverride = true)
12
12
  this.overrideSoundfont = undefined;
13
13
  }
14
14
  this.getDefaultPresets();
15
- this.cachedVoices = [];
15
+ this.clearCache();
16
16
 
17
17
  if (sendPresets)
18
18
  {
@@ -27,6 +27,7 @@ export function updatePresetList()
27
27
  }
28
28
  });
29
29
  }
30
+ this.clearCache();
30
31
  this.callEvent("presetlistchange", mainFont);
31
32
  this.getDefaultPresets();
32
33
  this.resetAllControllers(false);
@@ -468,10 +468,6 @@ class SpessaSynthProcessor
468
468
  setCachedVoice(bank, program, midiNote, velocity, voices)
469
469
  {
470
470
  // make sure that it exists
471
- if (!this.cachedVoices)
472
- {
473
- this.cachedVoices = [];
474
- }
475
471
  if (!this.cachedVoices[bank])
476
472
  {
477
473
  this.cachedVoices[bank] = [];
@@ -749,6 +745,11 @@ class SpessaSynthProcessor
749
745
  {
750
746
  this?.onEventCall?.(eventName, eventData);
751
747
  }
748
+
749
+ clearCache()
750
+ {
751
+ this.cachedVoices = [];
752
+ }
752
753
  }
753
754
 
754
755
  // include other methods