spessasynth_core 4.3.14 → 4.3.15

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
@@ -10484,6 +10484,9 @@ var ConnectionBlock = class ConnectionBlock {
10484
10484
  default:
10485
10485
  SpessaLog.info(`%cFailed converting DLS articulator into SF generator: %c${this.toString()}%c\n(invalid destination)`, ConsoleColors.warn, ConsoleColors.value, ConsoleColors.unrecognized);
10486
10486
  return;
10487
+ case DLSDestinations.keyNum:
10488
+ zone.setGenerator(GeneratorTypes.keyNum, value);
10489
+ break;
10487
10490
  case DLSDestinations.pan:
10488
10491
  zone.setGenerator(GeneratorTypes.pan, value);
10489
10492
  break;
@@ -10633,7 +10636,7 @@ var ConnectionBlock = class ConnectionBlock {
10633
10636
  newAmount: -amount
10634
10637
  };
10635
10638
  case DLSDestinations.pitch: return GeneratorTypes.fineTune;
10636
- case DLSDestinations.keyNum: return GeneratorTypes.overridingRootKey;
10639
+ case DLSDestinations.keyNum: return GeneratorTypes.keyNum;
10637
10640
  case DLSDestinations.volEnvDelay: return GeneratorTypes.delayVolEnv;
10638
10641
  case DLSDestinations.volEnvAttack: return GeneratorTypes.attackVolEnv;
10639
10642
  case DLSDestinations.volEnvHold: return GeneratorTypes.holdVolEnv;
@@ -10744,7 +10747,7 @@ var DownloadableSoundsArticulation = class extends DLSVerifier {
10744
10747
  writeDword(art2Data, this.connectionBlocks.length);
10745
10748
  const out = this.connectionBlocks.map((a) => a.write());
10746
10749
  const art2 = RIFFChunk.getParts(this.mode === "dls2" ? "art2" : "art1", [art2Data, ...out]);
10747
- return RIFFChunk.getParts(this.mode === "dls2" ? "lar2" : "lart", art2, true);
10750
+ return RIFFChunk.getParts(this.mode === "dls2" ? "lar2" : "lart", art2, false, true);
10748
10751
  }
10749
10752
  /**
10750
10753
  * Converts DLS articulation into an SF zone.
@@ -11247,16 +11250,18 @@ var DownloadableSounds = class DownloadableSounds extends DLSVerifier {
11247
11250
  const drumAliases = pgalData.slice(pgalData.currentIndex, pgalData.currentIndex + 128);
11248
11251
  pgalData.currentIndex += 128;
11249
11252
  for (let keyNum = 0; keyNum < 128; keyNum++) {
11250
- const alias = drumAliases[keyNum];
11251
- if (alias === keyNum) continue;
11252
- const region = drumInstrument.regions.find((r) => r.keyRange.max === alias && r.keyRange.min === alias);
11253
+ const source = drumAliases[keyNum];
11254
+ if (source === keyNum) continue;
11255
+ const region = drumInstrument.regions.find((r) => r.keyRange.max === source && r.keyRange.min === source);
11253
11256
  if (!region) {
11254
- SpessaLog.warn(`Invalid drum alias ${keyNum} to ${alias}: region does not exist.`);
11257
+ SpessaLog.warn(`Invalid drum alias ${keyNum} to ${source}: region does not exist.`);
11255
11258
  continue;
11256
11259
  }
11257
11260
  const copied = DownloadableSoundsRegion.copyFrom(region);
11258
11261
  copied.keyRange.max = keyNum;
11259
11262
  copied.keyRange.min = keyNum;
11263
+ const fixedKeyBlock = new ConnectionBlock(new ConnectionSource(DLSSources.none, 0, false, false), new ConnectionSource(DLSSources.none, 0, false, false), DLSDestinations.keyNum, 0, source << 16);
11264
+ copied.articulation.connectionBlocks.push(fixedKeyBlock);
11260
11265
  drumInstrument.regions.push(copied);
11261
11266
  }
11262
11267
  pgalData.currentIndex += 4;