spessasynth_core 3.26.9 → 3.26.10

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.9",
3
+ "version": "3.26.10",
4
4
  "description": "MIDI and SoundFont2/DLS library with no compromises",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -134,13 +134,19 @@ export class SoundFontManager
134
134
  {
135
135
  if (this.soundfontList.find(s => s.id === id) !== undefined)
136
136
  {
137
- throw new Error("Cannot overwrite the existing soundfont. Use soundfontManager.delete(id) instead.");
137
+ // replace
138
+ const soundfont = this.soundfontList.find(s => s.id === id);
139
+ soundfont.soundfont = font;
140
+ soundfont.bankOffset = bankOffset;
141
+ }
142
+ else
143
+ {
144
+ this.soundfontList.push({
145
+ id: id,
146
+ soundfont: font,
147
+ bankOffset: bankOffset
148
+ });
138
149
  }
139
- this.soundfontList.push({
140
- id: id,
141
- soundfont: font,
142
- bankOffset: bankOffset
143
- });
144
150
  this.generatePresetList();
145
151
  }
146
152