spessasynth_core 4.3.17 → 4.3.19

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
@@ -4615,10 +4615,12 @@ var BasicMIDI = class BasicMIDI {
4615
4615
  if (e.data[1] === 0) loopStart = e.ticks;
4616
4616
  break;
4617
4617
  case MIDIControllers.undefinedCC116LSB:
4618
+ case MIDIControllers.undefinedCC118LSB:
4618
4619
  loopStart = e.ticks;
4619
4620
  break;
4620
4621
  case MIDIControllers.footController:
4621
4622
  case MIDIControllers.undefinedCC117LSB:
4623
+ case MIDIControllers.undefinedCC119LSB:
4622
4624
  if (loopEnd === null && (e.data[0] !== 4 || e.data[0] === 4 && e.data[1] === 0)) {
4623
4625
  loopType = "soft";
4624
4626
  loopEnd = e.ticks;
@@ -6857,6 +6859,10 @@ var VolumeEnvelope = class {
6857
6859
  this.state = 0;
6858
6860
  this.sampleTime = 0;
6859
6861
  this.outputGain = 0;
6862
+ this.attenuationCb = CB_SILENCE;
6863
+ this.releaseStartCb = CB_SILENCE;
6864
+ this.releaseStartTimeSamples = 0;
6865
+ this.releaseDuration = 0;
6860
6866
  this.canEndOnSilentSustain = voice.modulatedGenerators[GeneratorTypes.sustainVolEnv] >= PERCEIVED_CB_SILENCE;
6861
6867
  this.sustainCb = Math.min(CB_SILENCE, voice.modulatedGenerators[GeneratorTypes.sustainVolEnv]);
6862
6868
  this.attackDuration = this.timecentsToSamples(voice.modulatedGenerators[GeneratorTypes.attackVolEnv]);
@@ -7240,9 +7246,9 @@ var HermiteOscillator = class extends WavetableOscillator {
7240
7246
  let y2 = y0 + 2;
7241
7247
  let y3 = y0 + 3;
7242
7248
  const t = cursor - y0;
7243
- if (y1 >= loopEnd) y1 -= loopLength;
7244
- if (y2 >= loopEnd) y2 -= loopLength;
7245
- if (y3 >= loopEnd) y3 -= loopLength;
7249
+ while (y1 >= loopEnd) y1 -= loopLength;
7250
+ while (y2 >= loopEnd) y2 -= loopLength;
7251
+ while (y3 >= loopEnd) y3 -= loopLength;
7246
7252
  const xm1 = sampleData[y0];
7247
7253
  const x0 = sampleData[y1];
7248
7254
  const x1 = sampleData[y2];
@@ -7510,6 +7516,8 @@ var Voice = class {
7510
7516
  this.overrideReleaseVolEnv = 0;
7511
7517
  this.portamentoDuration = 0;
7512
7518
  this.portamentoFromKey = -1;
7519
+ this.tuningCents = 0;
7520
+ this.tuningRatio = 1;
7513
7521
  this.vibLfoPhase = .25;
7514
7522
  this.modLfoPhase = .25;
7515
7523
  this.startTime = currentTime;
@@ -12097,7 +12105,7 @@ function renderVoice(voice, timeNow, outputL, outputR, startIndex, sampleCount)
12097
12105
  const index = Math.min(Math.max(-500, pan + this.currentPan), 500) + 500 | 0;
12098
12106
  const gainLeft = panTableLeft[index] * outputGain;
12099
12107
  const gainRight = panTableRight[index] * outputGain;
12100
- if (this._midiParameters.efxAssign) {
12108
+ if (this._midiParameters.efxAssign && systemParameters.effectsEnabled && core.insertionActive) {
12101
12109
  const insertionL = core.insertionInputL;
12102
12110
  const insertionR = core.insertionInputR;
12103
12111
  for (let i = 0; i < sampleCount; i++) {
@@ -14555,7 +14563,10 @@ function rolandSystemExclusive(syx, channelOffset = 0) {
14555
14563
  if (a2 >> 4 === 1) {
14556
14564
  const channel = MIDIUtils.syxToChannel(a2 & 15) + channelOffset;
14557
14565
  const ch = this.midiChannels[channel];
14558
- 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
+ }
14559
14570
  switch (a3) {
14560
14571
  default:
14561
14572
  SpessaLog.gsFail(`Patch Part Parameter for ${channel}`, [a3]);
@@ -14888,11 +14899,11 @@ function yamahaSystemExclusive(syx, channelOffset = 0) {
14888
14899
  }
14889
14900
  if (a1 === 8) {
14890
14901
  const channel = a2 + channelOffset;
14891
- if (channel >= this.midiChannels.length) {
14892
- 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.`);
14893
14905
  return;
14894
14906
  }
14895
- const ch = this.midiChannels[channel];
14896
14907
  switch (a3) {
14897
14908
  default:
14898
14909
  SpessaLog.xgFail("Part Setup", [syx[5]]);
@@ -19604,6 +19615,10 @@ var SynthesizerCore = class {
19604
19615
  */
19605
19616
  delayProcessor;
19606
19617
  /**
19618
+ * Insertion is not used outside SC-88Pro+ MIDIs, this is an optimization.
19619
+ */
19620
+ insertionActive = false;
19621
+ /**
19607
19622
  * A sysEx may set a "Part" (channel) to receive on a different channel number.
19608
19623
  * This slows down the access, so this toggle tracks if it's enabled or not.
19609
19624
  */
@@ -19628,10 +19643,6 @@ var SynthesizerCore = class {
19628
19643
  */
19629
19644
  insertionEffects = /* @__PURE__ */ new Map();
19630
19645
  /**
19631
- * Insertion is not used outside SC-88Pro+ MIDIs, this is an optimization.
19632
- */
19633
- insertionActive = false;
19634
- /**
19635
19646
  * For F5 system exclusive.
19636
19647
  */
19637
19648
  portSelectChannelOffset = 0;