spessasynth_core 4.3.18 → 4.3.20

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
@@ -3247,7 +3247,7 @@ function modifyMIDIInternal(midi, opts) {
3247
3247
  if (patch.isGMGSDrum && !BankSelectHacks.isSystemXG(system) && midiChannel !== 9) {
3248
3248
  SpessaLog.info(`%cAdding GS Drum change on track %c${trackNum}`, ConsoleColors.recognized, ConsoleColors.value);
3249
3249
  const chanAddress = 16 | MIDIUtils.channelToSyx(midiChannel);
3250
- addEventBefore(MIDIUtils.gsMessage(e.ticks, 40, chanAddress, 21, [1]));
3250
+ addEventBefore(MIDIUtils.gsMessage(e.ticks, 64, chanAddress, 21, [1]));
3251
3251
  }
3252
3252
  }
3253
3253
  if (channelChange.midiParams) for (const [param, value] of Object.entries(channelChange.midiParams)) {
@@ -7246,9 +7246,9 @@ var HermiteOscillator = class extends WavetableOscillator {
7246
7246
  let y2 = y0 + 2;
7247
7247
  let y3 = y0 + 3;
7248
7248
  const t = cursor - y0;
7249
- if (y1 >= loopEnd) y1 -= loopLength;
7250
- if (y2 >= loopEnd) y2 -= loopLength;
7251
- if (y3 >= loopEnd) y3 -= loopLength;
7249
+ while (y1 >= loopEnd) y1 -= loopLength;
7250
+ while (y2 >= loopEnd) y2 -= loopLength;
7251
+ while (y3 >= loopEnd) y3 -= loopLength;
7252
7252
  const xm1 = sampleData[y0];
7253
7253
  const x0 = sampleData[y1];
7254
7254
  const x1 = sampleData[y2];
@@ -14563,7 +14563,10 @@ function rolandSystemExclusive(syx, channelOffset = 0) {
14563
14563
  if (a2 >> 4 === 1) {
14564
14564
  const channel = MIDIUtils.syxToChannel(a2 & 15) + channelOffset;
14565
14565
  const ch = this.midiChannels[channel];
14566
- if (!ch) SpessaLog.gsFail(`Patch Parameter for ${channel}`, syx, "Invalid channel number");
14566
+ if (!ch) {
14567
+ SpessaLog.gsFail(`Patch Parameter for ${channel}`, syx, "Invalid part number.");
14568
+ return;
14569
+ }
14567
14570
  switch (a3) {
14568
14571
  default:
14569
14572
  SpessaLog.gsFail(`Patch Part Parameter for ${channel}`, [a3]);
@@ -14896,11 +14899,11 @@ function yamahaSystemExclusive(syx, channelOffset = 0) {
14896
14899
  }
14897
14900
  if (a1 === 8) {
14898
14901
  const channel = a2 + channelOffset;
14899
- if (channel >= this.midiChannels.length) {
14900
- SpessaLog.xgFail("Part Setup", syx, `Invalid part number: ${channel}`);
14902
+ const ch = this.midiChannels[channel];
14903
+ if (!ch) {
14904
+ SpessaLog.xgFail(`Part Setup for ${channel}`, syx, `Invalid part number.`);
14901
14905
  return;
14902
14906
  }
14903
- const ch = this.midiChannels[channel];
14904
14907
  switch (a3) {
14905
14908
  default:
14906
14909
  SpessaLog.xgFail("Part Setup", [syx[5]]);