spessasynth_lib 3.24.40 → 3.25.1

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.
@@ -15,7 +15,13 @@ import { DEFAULT_SYNTH_CONFIG } from "./audio_effects/effects_config.js";
15
15
  import { SoundfontManager } from "./synth_soundfont_manager.js";
16
16
  import { KeyModifierManager } from "./key_modifier_manager.js";
17
17
  import { channelConfiguration } from "./worklet_system/worklet_utilities/controller_tables.js";
18
- import { DEFAULT_PERCUSSION, MIDI_CHANNEL_COUNT, VOICE_CAP, WORKLET_PROCESSOR_NAME } from "./synth_constants.js";
18
+ import {
19
+ DEFAULT_PERCUSSION,
20
+ DEFAULT_SYNTH_MODE,
21
+ MIDI_CHANNEL_COUNT,
22
+ VOICE_CAP,
23
+ WORKLET_PROCESSOR_NAME
24
+ } from "./synth_constants.js";
19
25
 
20
26
 
21
27
  /**
@@ -239,6 +245,30 @@ export class Synthetizer
239
245
  });
240
246
  }
241
247
 
248
+ /**
249
+ * @type {"gm"|"gm2"|"gs"|"xg"}
250
+ * @private
251
+ */
252
+ _midiSystem = DEFAULT_SYNTH_MODE;
253
+
254
+ /**
255
+ * The current MIDI system used by the synthesizer
256
+ * @returns {"gm"|"gm2"|"gs"|"xg"}
257
+ */
258
+ get midiSystem()
259
+ {
260
+ return this._midiSystem;
261
+ }
262
+
263
+ /**
264
+ * The current MIDI system used by the synthesizer
265
+ * @param value {"gm"|"gm2"|"gs"|"xg"}
266
+ */
267
+ set midiSystem(value)
268
+ {
269
+ this._midiSystem = value;
270
+ }
271
+
242
272
  /**
243
273
  * current voice amount
244
274
  * @type {number}
@@ -383,6 +413,23 @@ export class Synthetizer
383
413
  }
384
414
  break;
385
415
 
416
+ case returnMessageType.masterParameterChange:
417
+ /**
418
+ * @type {masterParameterType}
419
+ */
420
+ const param = messageData[0];
421
+ const value = messageData[1];
422
+ switch (param)
423
+ {
424
+ default:
425
+ break;
426
+
427
+ case masterParameterType.midiSystem:
428
+ this._midiSystem = value;
429
+ break;
430
+ }
431
+ break;
432
+
386
433
  case returnMessageType.synthesizerSnapshot:
387
434
  if (this._snapshotCallback)
388
435
  {