spessasynth_lib 3.20.10 → 3.20.12

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.
@@ -1,3 +1,13 @@
1
+ /**
2
+ * synthesizer.js
3
+ * purpose: responds to midi messages and called functions, managing the channels and passing the messages to them
4
+ */
5
+ /**
6
+ * @typedef {Object} StartRenderingDataConfig
7
+ * @property {BasicMIDI} parsedMIDI - the MIDI to render
8
+ * @property {SynthesizerSnapshot} snapshot - the snapshot to apply
9
+ * @property {boolean|undefined} oneOutput - if synth should use one output with 32 channels (2 audio channels for each midi channel). this disables chorus and reverb.
10
+ */
1
11
  export const WORKLET_PROCESSOR_NAME: "spessasynth-worklet-system";
2
12
  export const VOICE_CAP: 450;
3
13
  export const DEFAULT_PERCUSSION: 9;
@@ -296,7 +296,7 @@ export function modifyMIDI(
296
296
  /**
297
297
  * @type {{index: number, track: number}[]}
298
298
  */
299
- const firstNoteOnForTrack = getFirstVoiceForChannel(midiChannel, port, offset > 0);
299
+ const firstNoteOnForTrack = getFirstVoiceForChannel(midiChannel, port, true);
300
300
  if(firstNoteOnForTrack.length === 0)
301
301
  {
302
302
  SpessaSynthWarn("Program change but no notes... ignoring!");
@@ -230,7 +230,8 @@ export function writeRMIDI(
230
230
  consoleColors.info);
231
231
  } else {
232
232
  // there is a preset with this bank. add offset. For drums add the normal offset.
233
- const newBank = (bank === 128 ? 0 : realBank) + bankOffset;
233
+ let drumBank = system === "xg" ? 127 : 0;
234
+ const newBank = (bank === 128 ? drumBank : realBank) + bankOffset;
234
235
  channel.lastBank.messageData[1] = newBank;
235
236
  SpessaSynthInfo(`%cPreset %c${bank}:${e.messageData[0]}%c exists. Changing bank to ${newBank}.`,
236
237
  consoleColors.info,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_lib",
3
- "version": "3.20.10",
3
+ "version": "3.20.12",
4
4
  "description": "MIDI and SoundFont2 or DLS Synthesizer library with no compromises",
5
5
  "browser": "index.js",
6
6
  "types": "@types/index.d.ts",
@@ -57,11 +57,7 @@ export function loadNewSequence(parsedMidi)
57
57
  if(this.midiData.embeddedSoundFont !== undefined)
58
58
  {
59
59
  SpessaSynthInfo("%cEmbedded soundfont detected! Using it.", consoleColors.recognized);
60
- // set offet
61
- this.synth.soundfontBankOffset = this.midiData.bankOffset;
62
- this.synth.reloadSoundFont(this.midiData.embeddedSoundFont, true);
63
- // preload all samples
64
- this.synth.overrideSoundfont.samples.forEach(s => s.getAudioData());
60
+ this.synth.setEmbeddedSoundFont(this.midiData.embeddedSoundFont, this.midiData.bankOffset);
65
61
  }
66
62
  else
67
63
  {
@@ -26,8 +26,6 @@ import { SoundfontManager } from './synth_soundfont_manager.js'
26
26
  * @property {boolean|undefined} oneOutput - if synth should use one output with 32 channels (2 audio channels for each midi channel). this disables chorus and reverb.
27
27
  */
28
28
 
29
- const CURRENT_SPESSASYNTH_VERSION = "3.20.10";
30
-
31
29
  export const WORKLET_PROCESSOR_NAME = "spessasynth-worklet-system";
32
30
 
33
31
  export const VOICE_CAP = 450;
@@ -325,14 +323,6 @@ export class Synthetizer {
325
323
  SpessaSynthWarn(new Error(messageData));
326
324
  this.eventHandler.callEvent("soundfonterror", messageData);
327
325
  break;
328
-
329
- case returnMessageType.identify:
330
- if(messageData !== CURRENT_SPESSASYNTH_VERSION)
331
- {
332
- this.stopAll(true);
333
- this.worklet.disconnect();
334
- throw new Error(`Outdated worklet_processor.min.js! version: ${messageData}. Please update it to ${CURRENT_SPESSASYNTH_VERSION}`);
335
- }
336
326
  }
337
327
  }
338
328