spessasynth_core 4.3.13 → 4.3.14

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/dist/index.js CHANGED
@@ -1800,7 +1800,7 @@ var MIDIUtils = class MIDIUtils {
1800
1800
  case "gs": return [MIDIUtils.gsMessage(ticks, 64, 16 | gsChannel, 20, [value])];
1801
1801
  case "xg": return [MIDIUtils.xgMessage(ticks, 8, channel, 6, [value])];
1802
1802
  }
1803
- case "efxAssign": return [MIDIUtils.gsMessage(ticks, 64, 16 | gsChannel, 34, [value])];
1803
+ case "efxAssign": return [MIDIUtils.gsMessage(ticks, 64, 64 | gsChannel, 34, [value ? 1 : 0])];
1804
1804
  case "cc1": return [MIDIUtils.gsMessage(ticks, 64, 16 | gsChannel, 31, [value])];
1805
1805
  case "cc2": return [MIDIUtils.gsMessage(ticks, 64, 16 | gsChannel, 32, [value])];
1806
1806
  case "drumMap": return [MIDIUtils.gsMessage(ticks, 64, 16 | gsChannel, 21, [value])];
@@ -2438,7 +2438,7 @@ function correctBankOffsetInternal(mid, bankOffset, soundBank) {
2438
2438
  ports[trackNum] = e.data[0];
2439
2439
  return;
2440
2440
  }
2441
- const status = e.statusByte & 240;
2441
+ let status = e.statusByte & 240;
2442
2442
  if (status !== MIDIMessageTypes.controllerChange && status !== MIDIMessageTypes.programChange && status !== MIDIMessageTypes.systemExclusive) return;
2443
2443
  if (status === MIDIMessageTypes.systemExclusive) {
2444
2444
  const syx = MIDIUtils.analyzeSysEx(e.data);
@@ -2479,6 +2479,7 @@ function correctBankOffsetInternal(mid, bankOffset, soundBank) {
2479
2479
  }
2480
2480
  }
2481
2481
  }
2482
+ status = e.statusByte & 240;
2482
2483
  const chNum = (e.statusByte & 15) + portOffset;
2483
2484
  const ch = channels[chNum];
2484
2485
  if (status === MIDIMessageTypes.programChange) {
@@ -3235,7 +3236,7 @@ function modifyMIDIInternal(midi, opts) {
3235
3236
  case MIDIMessageTypes.controllerChange: {
3236
3237
  const ccNum = e.data[0];
3237
3238
  const value = e.data[1];
3238
- if (channelChange?.controllers?.get(ccNum)) {
3239
+ if (channelChange?.controllers?.get(ccNum) !== void 0) {
3239
3240
  deleteThisEvent();
3240
3241
  return;
3241
3242
  }
@@ -3264,7 +3265,7 @@ function modifyMIDIInternal(midi, opts) {
3264
3265
  case "Controller Change": {
3265
3266
  const ccNum = data.controller;
3266
3267
  const channel = data.channel;
3267
- if (channelChange?.controllers?.get(ccNum)) {
3268
+ if (channelChange?.controllers?.get(ccNum) !== void 0) {
3268
3269
  deleteParameter(channel);
3269
3270
  return;
3270
3271
  }
@@ -5366,8 +5367,8 @@ function setTimeToInternal(time, ticks = void 0) {
5366
5367
  if (ch.portamentoNote >= 0) if (this.externalMIDIPlayback) this.sendMIDICC(channel, MIDIControllers.portamentoControl, ch.portamentoNote);
5367
5368
  else this.synth.midiChannels[channel].setLastNote(ch.portamentoNote);
5368
5369
  for (let i = 0; i < 128; i++) {
5369
- const value = ch.controllers[i] >> 7;
5370
- if (value !== DEFAULT_MIDI_CONTROLLERS[i] && !nonSkippableCCs.has(i)) this.sendMIDICC(channel, i, value);
5370
+ const value = ch.controllers[i];
5371
+ if (value !== DEFAULT_MIDI_CONTROLLERS[i] && !nonSkippableCCs.has(i)) this.sendMIDICC(channel, i, value >> 7);
5371
5372
  }
5372
5373
  }
5373
5374
  if (savedTempo) this.callEvent("metaEvent", {
@@ -20292,10 +20293,10 @@ var SynthesizerCore = class {
20292
20293
  this.setReverbMacro(4);
20293
20294
  this.setChorusMacro(2);
20294
20295
  this.setDelayMacro(0);
20295
- if (!this.systemParameters.delayLock) this.delayActive = false;
20296
20296
  this.resetInsertion();
20297
20297
  if (!this.drumPreset || !this.defaultPreset) return;
20298
20298
  for (const ch of this.midiChannels) ch.reset(false);
20299
+ if (!this.systemParameters.delayLock) this.delayActive = this.midiChannels.some((c) => c.midiControllers[MIDIControllers.variationDepth] > 0);
20299
20300
  }
20300
20301
  process(left, right, startIndex = 0, sampleCount = 0) {
20301
20302
  this.processSplit([[left, right]], left, right, startIndex, sampleCount);