spessasynth_core 4.0.6 → 4.0.8

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.d.ts CHANGED
@@ -151,41 +151,6 @@ declare const generatorLimits: {
151
151
  nrpn: number;
152
152
  }[];
153
153
 
154
- /**
155
- * Returned structure containing extended SF2 chunks.
156
- */
157
- interface ExtendedSF2Chunks {
158
- /**
159
- * The PDTA part of the chunk.
160
- */
161
- pdta: IndexedByteArray;
162
- /**
163
- * The XDTA (https://github.com/spessasus/soundfont-proposals/blob/main/extended_limits.md) part of the chunk.
164
- */
165
- xdta: IndexedByteArray;
166
- }
167
- /**
168
- * Write indexes for tracking writing a SoundFont file.
169
- */
170
- interface SoundFontWriteIndexes {
171
- /**
172
- * Generator start index.
173
- */
174
- gen: number;
175
- /**
176
- * Modulator start index.
177
- */
178
- mod: number;
179
- /**
180
- * Zone start index.
181
- */
182
- bag: number;
183
- /**
184
- * Preset/instrument start index.
185
- */
186
- hdr: number;
187
- }
188
-
189
154
  declare class Generator {
190
155
  /**
191
156
  * The generator's SF2 type.
@@ -202,7 +167,7 @@ declare class Generator {
202
167
  * @param validate if the limits should be validated
203
168
  */
204
169
  constructor(type: GeneratorType, value: number, validate?: boolean);
205
- write(genData: IndexedByteArray, indexes: SoundFontWriteIndexes): void;
170
+ write(genData: IndexedByteArray): void;
206
171
  toString(): string;
207
172
  }
208
173
 
@@ -345,12 +310,10 @@ declare class BasicZone {
345
310
  addModulators(...modulators: Modulator[]): void;
346
311
  getGenerator<K>(generatorType: GeneratorType, notFoundValue: number | K): number | K;
347
312
  copyFrom(zone: BasicZone): void;
348
- getGenCount(): number;
349
- write(genData: IndexedByteArray, modData: IndexedByteArray, bagData: ExtendedSF2Chunks, indexes: SoundFontWriteIndexes, bank: BasicSoundBank): void;
350
313
  /**
351
314
  * Filters the generators and prepends the range generators.
352
315
  */
353
- protected getWriteGenerators(bank: BasicSoundBank): Generator[];
316
+ getWriteGenerators(bank: BasicSoundBank): Generator[];
354
317
  }
355
318
 
356
319
  declare class BasicGlobalZone extends BasicZone {
@@ -384,7 +347,6 @@ declare class BasicInstrumentZone extends BasicZone {
384
347
  * @param sample the sample to set.
385
348
  */
386
349
  set sample(sample: BasicSample);
387
- getGenCount(): number;
388
350
  getWriteGenerators(bank: BasicSoundBank): Generator[];
389
351
  }
390
352
 
@@ -411,7 +373,6 @@ declare class BasicPresetZone extends BasicZone {
411
373
  * Zone's instrument.
412
374
  */
413
375
  set instrument(instrument: BasicInstrument);
414
- getGenCount(): number;
415
376
  getWriteGenerators(bank: BasicSoundBank): Generator[];
416
377
  }
417
378
 
@@ -468,6 +429,41 @@ declare class MIDIPatchTools {
468
429
  static sorter(a: MIDIPatch, b: MIDIPatch): number;
469
430
  }
470
431
 
432
+ /**
433
+ * Returned structure containing extended SF2 chunks.
434
+ */
435
+ interface ExtendedSF2Chunks {
436
+ /**
437
+ * The PDTA part of the chunk.
438
+ */
439
+ pdta: IndexedByteArray;
440
+ /**
441
+ * The XDTA (https://github.com/spessasus/soundfont-proposals/blob/main/extended_limits.md) part of the chunk.
442
+ */
443
+ xdta: IndexedByteArray;
444
+ }
445
+ /**
446
+ * Write indexes for tracking writing a SoundFont file.
447
+ */
448
+ interface SoundFontWriteIndexes {
449
+ /**
450
+ * Generator start index.
451
+ */
452
+ gen: number;
453
+ /**
454
+ * Modulator start index.
455
+ */
456
+ mod: number;
457
+ /**
458
+ * Zone start index.
459
+ */
460
+ bag: number;
461
+ /**
462
+ * Preset/instrument start index.
463
+ */
464
+ hdr: number;
465
+ }
466
+
471
467
  declare class BasicPreset implements MIDIPatchNamed {
472
468
  /**
473
469
  * The parent soundbank instance
@@ -536,12 +532,6 @@ declare class BasicPreset implements MIDIPatchNamed {
536
532
  * @param preset The preset to check.
537
533
  */
538
534
  matches(preset: MIDIPatch): boolean;
539
- getSize(): {
540
- mod: number;
541
- bag: number;
542
- gen: number;
543
- hdr: number;
544
- };
545
535
  /**
546
536
  * Returns the synthesis data from this preset
547
537
  * @param midiNote the MIDI note number
@@ -560,7 +550,12 @@ declare class BasicPreset implements MIDIPatchNamed {
560
550
  * @returns The instrument containing the flattened zones. In theory, it should exactly the same as this preset.
561
551
  */
562
552
  toFlattenedInstrument(): BasicInstrument;
563
- write(genData: IndexedByteArray, modData: IndexedByteArray, bagData: ExtendedSF2Chunks, phdrData: ExtendedSF2Chunks, indexes: SoundFontWriteIndexes, bank: BasicSoundBank): void;
553
+ /**
554
+ * Writes the SF2 header
555
+ * @param phdrData
556
+ * @param index
557
+ */
558
+ write(phdrData: ExtendedSF2Chunks, index: number): void;
564
559
  }
565
560
 
566
561
  /**
@@ -618,13 +613,7 @@ declare class BasicInstrument {
618
613
  * to the global zone as possible to reduce clutter and the count of parameters.
619
614
  */
620
615
  globalize(): void;
621
- getSize(): {
622
- mod: number;
623
- bag: number;
624
- gen: number;
625
- hdr: number;
626
- };
627
- write(genData: IndexedByteArray, modData: IndexedByteArray, bagData: ExtendedSF2Chunks, instData: ExtendedSF2Chunks, indexes: SoundFontWriteIndexes, bank: BasicSoundBank): void;
616
+ write(instData: ExtendedSF2Chunks, index: number): void;
628
617
  }
629
618
 
630
619
  declare class BasicSample {
@@ -1109,12 +1098,6 @@ declare const interpolationTypes: {
1109
1098
  readonly hermite: 2;
1110
1099
  };
1111
1100
  type InterpolationType = (typeof interpolationTypes)[keyof typeof interpolationTypes];
1112
- declare const synthDisplayTypes: {
1113
- readonly soundCanvasText: 0;
1114
- readonly yamahaXGText: 1;
1115
- readonly soundCanvasDotMatrix: 2;
1116
- };
1117
- type SynthDisplayType = (typeof synthDisplayTypes)[keyof typeof synthDisplayTypes];
1118
1101
  declare const dataEntryStates: {
1119
1102
  readonly Idle: 0;
1120
1103
  readonly RPCoarse: 1;
@@ -1185,12 +1168,10 @@ interface PresetListEntry extends MIDIPatchNamed {
1185
1168
  * A list of preset changes, each with a name, bank, and program number.
1186
1169
  */
1187
1170
  type PresetList = PresetListEntry[];
1188
- interface SynthDisplayCallback {
1189
- /** The data to display. */
1190
- displayData: Uint8Array;
1191
- /** The type of display. */
1192
- displayType: SynthDisplayType;
1193
- }
1171
+ /**
1172
+ * The synthesizer display system exclusive data, EXCLUDING THE F0 BYTE!
1173
+ */
1174
+ type SynthDisplayCallback = number[];
1194
1175
  interface PitchWheelCallback {
1195
1176
  /** The MIDI channel number. */
1196
1177
  channel: number;
@@ -4059,4 +4040,4 @@ declare class SoundBankLoader {
4059
4040
  private static loadDLS;
4060
4041
  }
4061
4042
 
4062
- export { ALL_CHANNELS_OR_DIFFERENT_ACTION, BasicGlobalZone, BasicInstrument, BasicInstrumentZone, BasicMIDI, BasicPreset, BasicPresetZone, BasicSample, BasicSoundBank, BasicZone, CONTROLLER_TABLE_SIZE, CUSTOM_CONTROLLER_TABLE_SIZE, type ChannelPressureCallback, type ChannelProperty, type ChannelPropertyChangeCallback, ChannelSnapshot, type ControllerChangeCallback, type CustomController, DEFAULT_MASTER_PARAMETERS, DEFAULT_PERCUSSION, DEFAULT_WAV_WRITE_OPTIONS, type DLSChunkFourCC, type DLSDestination, type DLSInfoFourCC, type DLSLoop, type DLSLoopType, DLSLoopTypes, type DLSSource, type DLSTransform, type DLSWriteOptions, type DataEntryState, type DesiredChannelTranspose, type DesiredControllerChange, type DesiredProgramChange, type DrumChangeCallback, EmptySample, type FourCC, GENERATORS_AMOUNT, Generator, type GeneratorType, type GenericBankInfoFourCC, type GenericRIFFFourCC, type GenericRange, IndexedByteArray, type InterpolationType, KeyModifier, MAX_GENERATOR, MIDIBuilder, type MIDIController, type MIDIFormat, type MIDILoop, MIDIMessage, type MIDIMessageType, type MIDIPatch, type MIDIPatchNamed, MIDIPatchTools, MIDITrack, type MTSNoteTuning, type MTSProgramTuning, type MasterParameterChangeCallback, type MasterParameterType, Modulator, type ModulatorCurveType, ModulatorSource, type ModulatorSourceEnum, type ModulatorSourceIndex, type ModulatorTransformType, type MuteChannelCallback, NON_CC_INDEX_OFFSET, type NoteOffCallback, type NoteOnCallback, type NoteTime, PORTAMENTO_CONTROL_UNSET, type PitchWheelCallback, type PolyPressureCallback, type PresetList, type PresetListEntry, type ProgramChangeCallback, type ProgressFunction, type RMIDIWriteOptions, type RMIDInfoData, type RMIDInfoFourCC, type SF2ChunkFourCC, type SF2InfoFourCC, type SF2VersionTag, type SampleEncodingFunction, type SampleLoopingMode, type SampleType, type SequencerEvent, type SequencerEventData, type SoundBankErrorCallback, type SoundBankInfoData, type SoundBankInfoFourCC, SoundBankLoader, type SoundBankManagerListEntry, type SoundFont2WriteOptions, SpessaSynthCoreUtils, SpessaSynthLogging, SpessaSynthProcessor, SpessaSynthSequencer, type StopAllCallback, type SynthDisplayCallback, type SynthDisplayType, type SynthMethodOptions, type SynthProcessorEvent, type SynthProcessorEventData, type SynthProcessorOptions, type SynthSystem, SynthesizerSnapshot, type TempoChange, type VoiceList, type VoiceSynthesisData, type WaveMetadata, type WaveWriteOptions, audioToWav, customControllers, customResetArray, dataEntryStates, defaultMIDIControllerValues, dlsDestinations, dlsSources, generatorLimits, generatorTypes, interpolationTypes, midiControllers, midiMessageTypes, modulatorCurveTypes, modulatorSources, modulatorTransformTypes, sampleTypes, setResetValue, synthDisplayTypes };
4043
+ export { ALL_CHANNELS_OR_DIFFERENT_ACTION, BasicGlobalZone, BasicInstrument, BasicInstrumentZone, BasicMIDI, BasicPreset, BasicPresetZone, BasicSample, BasicSoundBank, BasicZone, CONTROLLER_TABLE_SIZE, CUSTOM_CONTROLLER_TABLE_SIZE, type ChannelPressureCallback, type ChannelProperty, type ChannelPropertyChangeCallback, ChannelSnapshot, type ControllerChangeCallback, type CustomController, DEFAULT_MASTER_PARAMETERS, DEFAULT_PERCUSSION, DEFAULT_WAV_WRITE_OPTIONS, type DLSChunkFourCC, type DLSDestination, type DLSInfoFourCC, type DLSLoop, type DLSLoopType, DLSLoopTypes, type DLSSource, type DLSTransform, type DLSWriteOptions, type DataEntryState, type DesiredChannelTranspose, type DesiredControllerChange, type DesiredProgramChange, type DrumChangeCallback, EmptySample, type FourCC, GENERATORS_AMOUNT, Generator, type GeneratorType, type GenericBankInfoFourCC, type GenericRIFFFourCC, type GenericRange, IndexedByteArray, type InterpolationType, KeyModifier, MAX_GENERATOR, MIDIBuilder, type MIDIController, type MIDIFormat, type MIDILoop, MIDIMessage, type MIDIMessageType, type MIDIPatch, type MIDIPatchNamed, MIDIPatchTools, MIDITrack, type MTSNoteTuning, type MTSProgramTuning, type MasterParameterChangeCallback, type MasterParameterType, Modulator, type ModulatorCurveType, ModulatorSource, type ModulatorSourceEnum, type ModulatorSourceIndex, type ModulatorTransformType, type MuteChannelCallback, NON_CC_INDEX_OFFSET, type NoteOffCallback, type NoteOnCallback, type NoteTime, PORTAMENTO_CONTROL_UNSET, type PitchWheelCallback, type PolyPressureCallback, type PresetList, type PresetListEntry, type ProgramChangeCallback, type ProgressFunction, type RMIDIWriteOptions, type RMIDInfoData, type RMIDInfoFourCC, type SF2ChunkFourCC, type SF2InfoFourCC, type SF2VersionTag, type SampleEncodingFunction, type SampleLoopingMode, type SampleType, type SequencerEvent, type SequencerEventData, type SoundBankErrorCallback, type SoundBankInfoData, type SoundBankInfoFourCC, SoundBankLoader, type SoundBankManagerListEntry, type SoundFont2WriteOptions, SpessaSynthCoreUtils, SpessaSynthLogging, SpessaSynthProcessor, SpessaSynthSequencer, type StopAllCallback, type SynthMethodOptions, type SynthProcessorEvent, type SynthProcessorEventData, type SynthProcessorOptions, type SynthSystem, SynthesizerSnapshot, type TempoChange, type VoiceList, type VoiceSynthesisData, type WaveMetadata, type WaveWriteOptions, audioToWav, customControllers, customResetArray, dataEntryStates, defaultMIDIControllerValues, dlsDestinations, dlsSources, generatorLimits, generatorTypes, interpolationTypes, midiControllers, midiMessageTypes, modulatorCurveTypes, modulatorSources, modulatorTransformTypes, sampleTypes, setResetValue };