spessasynth_lib 3.20.25 → 3.20.26
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 +2 -2
- package/soundfont/basic_soundfont/basic_soundfont.js +9 -1
- package/soundfont/dls/dls_soundfont.js +6 -1
- package/soundfont/dls/dls_zone.js +1 -0
- package/synthetizer/worklet_processor.min.js +7 -7
- package/synthetizer/worklet_system/worklet_methods/system_exclusive.js +15 -6
- package/synthetizer/worklet_system/worklet_methods/worklet_soundfont_manager/worklet_soundfont_manager.js +11 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spessasynth_lib",
|
|
3
|
-
"version": "3.20.
|
|
4
|
-
"description": "MIDI and SoundFont2
|
|
3
|
+
"version": "3.20.26",
|
|
4
|
+
"description": "MIDI and SoundFont2/DLS library with no compromises",
|
|
5
5
|
"browser": "index.js",
|
|
6
6
|
"types": "@types/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -140,18 +140,25 @@ class BasicSoundFont
|
|
|
140
140
|
*/
|
|
141
141
|
getPreset(bankNr, programNr)
|
|
142
142
|
{
|
|
143
|
+
// check for exact match
|
|
143
144
|
let preset = this.presets.find(p => p.bank === bankNr && p.program === programNr);
|
|
144
145
|
if (!preset)
|
|
145
146
|
{
|
|
146
|
-
|
|
147
|
+
// no match...
|
|
147
148
|
if(bankNr === 128)
|
|
148
149
|
{
|
|
150
|
+
// drum preset: find any preset with bank 128
|
|
149
151
|
preset = this.presets.find(p => p.bank === 128 && p.program === programNr);
|
|
150
152
|
if(!preset)
|
|
151
153
|
{
|
|
152
154
|
preset = this.presets.find(p => p.bank === 128);
|
|
153
155
|
}
|
|
154
156
|
}
|
|
157
|
+
else
|
|
158
|
+
{
|
|
159
|
+
// non drum preset: find any preset with the given program that is not a drum preset
|
|
160
|
+
preset = this.presets.find(p => p.program === programNr && p.bank !== 128);
|
|
161
|
+
}
|
|
155
162
|
if(preset)
|
|
156
163
|
{
|
|
157
164
|
SpessaSynthWarn(`%cPreset ${bankNr}.${programNr} not found. Replaced with %c${preset.presetName} (${preset.bank}.${preset.program})`,
|
|
@@ -159,6 +166,7 @@ class BasicSoundFont
|
|
|
159
166
|
consoleColors.recognized);
|
|
160
167
|
}
|
|
161
168
|
}
|
|
169
|
+
// no preset, use the first one available
|
|
162
170
|
if(!preset)
|
|
163
171
|
{
|
|
164
172
|
SpessaSynthWarn(`Preset ${programNr} not found. Defaulting to`, this.presets[0].presetName);
|
|
@@ -48,6 +48,8 @@ class DLSSoundFont extends BasicSoundFont
|
|
|
48
48
|
this.soundFontInfo["isng"] = "EMU8000";
|
|
49
49
|
|
|
50
50
|
// set some defaults
|
|
51
|
+
this.soundFontInfo["INAM"] = "Unnamed DLS";
|
|
52
|
+
this.soundFontInfo["IENG"] = "Unknown";
|
|
51
53
|
this.soundFontInfo["IPRD"] = "SpessaSynth DLS";
|
|
52
54
|
this.soundFontInfo["ICRD"] = new Date().toDateString();
|
|
53
55
|
|
|
@@ -61,7 +63,7 @@ class DLSSoundFont extends BasicSoundFont
|
|
|
61
63
|
this.soundFontInfo[infoPart.header] = readBytesAsString(infoPart.chunkData, infoPart.size);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
|
-
this.soundFontInfo["ICMT"] = (this.soundFontInfo["ICMT"] || "") + "\nConverted from DLS to SF2 with SpessaSynth";
|
|
66
|
+
this.soundFontInfo["ICMT"] = (this.soundFontInfo["ICMT"] || "(No description)") + "\nConverted from DLS to SF2 with SpessaSynth";
|
|
65
67
|
if(this.soundFontInfo["ISBJ"])
|
|
66
68
|
{
|
|
67
69
|
// merge it
|
|
@@ -101,6 +103,9 @@ class DLSSoundFont extends BasicSoundFont
|
|
|
101
103
|
}
|
|
102
104
|
this.readDLSInstrumentList(instrumentListChunk);
|
|
103
105
|
|
|
106
|
+
// sort presets
|
|
107
|
+
this.presets.sort((a, b) => (a.program - b.program) + (a.bank - b.bank));
|
|
108
|
+
|
|
104
109
|
SpessaSynthInfo(`%cParsing finished! %c"${this.soundFontInfo["INAM"] || "UNNAMED"}"%c has %c${this.presets.length} %cpresets,
|
|
105
110
|
%c${this.instruments.length}%c instruments and %c${this.samples.length}%c samples.`,
|
|
106
111
|
consoleColors.info,
|