spessasynth_core 4.4.4 → 4.4.6
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/README.md +19 -16
- package/dist/index.d.ts +1010 -273
- package/dist/index.js +21799 -3809
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export interface WaveWriteOptions {
|
|
7
7
|
/**
|
|
8
8
|
* If true, the gain of the entire song will be adjusted,
|
|
9
|
-
* so the
|
|
9
|
+
* so the loudest sample (by absolute value) becomes 32,767 or -32,767. Recommended.
|
|
10
10
|
*/
|
|
11
11
|
normalizeAudio: boolean;
|
|
12
12
|
/**
|
|
@@ -190,8 +190,9 @@ export declare class SpessaLog {
|
|
|
190
190
|
/**
|
|
191
191
|
* Enables or disables logging at various levels.
|
|
192
192
|
* All the input variables are booleans corresponding to the things SpessaSynth logs.
|
|
193
|
-
* @param enableInfo enables info: all general info such as parsing sound banks, MIDI files, RPN changes,
|
|
194
|
-
*
|
|
193
|
+
* @param enableInfo enables info: all general info such as parsing sound banks, MIDI files, RPN changes,
|
|
194
|
+
* messages unrecognized by the synthesizer, etc.
|
|
195
|
+
* @param enableWarn enables warning: unexpected and erroneous behavior, such as invalid data or missing presets.
|
|
195
196
|
* @param enableGroup enables groups: the groups for parsing the sound banks and MIDI files.
|
|
196
197
|
*/
|
|
197
198
|
static setLogLevel(enableInfo: boolean, enableWarn: boolean, enableGroup: boolean): void;
|
|
@@ -289,6 +290,27 @@ export declare const GeneratorTypes: Readonly<{
|
|
|
289
290
|
readonly vibLfoToVolume: 65;
|
|
290
291
|
readonly modLfoRate: 66;
|
|
291
292
|
readonly modLfoAmplitudeDepth: 67;
|
|
293
|
+
readonly ignoreNoteOff: 68;
|
|
294
|
+
readonly delayVoice: 69;
|
|
295
|
+
readonly fadeVibLFO: 70;
|
|
296
|
+
readonly fadeModLFO: 71;
|
|
297
|
+
readonly vibLfoWaveform: 72;
|
|
298
|
+
readonly modLfoWaveform: 73;
|
|
299
|
+
readonly vibLfoStartPhase: 74;
|
|
300
|
+
readonly modLfoStartPhase: 75;
|
|
301
|
+
readonly maxFilterFc: 76;
|
|
302
|
+
readonly decay2VolEnv: 77;
|
|
303
|
+
readonly sustain2VolEnv: 78;
|
|
304
|
+
readonly delayModEnv2: 79;
|
|
305
|
+
readonly attackModEnv2: 80;
|
|
306
|
+
readonly holdModEnv2: 81;
|
|
307
|
+
readonly decayModEnv2: 82;
|
|
308
|
+
readonly sustainModEnv2: 83;
|
|
309
|
+
readonly releaseModEnv2: 84;
|
|
310
|
+
readonly keyNumToModEnv2Hold: 85;
|
|
311
|
+
readonly keyNumToModEnv2Decay: 86;
|
|
312
|
+
readonly modEnv2ToPitch: 87;
|
|
313
|
+
readonly modEnv2ToFilterFc: 88;
|
|
292
314
|
}>;
|
|
293
315
|
/**
|
|
294
316
|
* @inheritDoc GeneratorTypes
|
|
@@ -331,6 +353,17 @@ export interface GeneratorLimit {
|
|
|
331
353
|
* SoundFont2 NRPN scale factor for this generator type.
|
|
332
354
|
*/
|
|
333
355
|
nrpn: number;
|
|
356
|
+
/**
|
|
357
|
+
* Minimum value of this generator in a preset zone.
|
|
358
|
+
* Preset generators are offsets added to the instrument, so they can go below the instrument range.
|
|
359
|
+
* If not set, it is the same as `min`.
|
|
360
|
+
*/
|
|
361
|
+
presetMin?: number;
|
|
362
|
+
/**
|
|
363
|
+
* Maximum value of this generator in a preset zone.
|
|
364
|
+
* If not set, it is the same as `max`.
|
|
365
|
+
*/
|
|
366
|
+
presetMax?: number;
|
|
334
367
|
}
|
|
335
368
|
/**
|
|
336
369
|
* Limits and defaults for all the {@link BasicSoundBank} generator types.
|
|
@@ -393,7 +426,7 @@ export declare const ModulatorControllerSources: {
|
|
|
393
426
|
*/
|
|
394
427
|
readonly pitchWheel: 14;
|
|
395
428
|
/**
|
|
396
|
-
* The current pitch wheel range (where 1 means
|
|
429
|
+
* The current pitch wheel range (where 1 means 128 semitones) on the channel.
|
|
397
430
|
*/
|
|
398
431
|
readonly pitchWheelRange: 16;
|
|
399
432
|
/**
|
|
@@ -422,7 +455,7 @@ export declare const ModulatorCurveTypes: {
|
|
|
422
455
|
*/
|
|
423
456
|
readonly concave: 1;
|
|
424
457
|
/**
|
|
425
|
-
*
|
|
458
|
+
* Exponential ramp, the inverse of concave.
|
|
426
459
|
*/
|
|
427
460
|
readonly convex: 2;
|
|
428
461
|
/**
|
|
@@ -474,7 +507,7 @@ export declare class ModulatorSource {
|
|
|
474
507
|
/**
|
|
475
508
|
* If this field is set true, the direction of the controller should be from the maximum value to the minimum value. So, for
|
|
476
509
|
* example, if the controller source is Key Number, then a Key Number value of 0 corresponds to the maximum possible
|
|
477
|
-
* controller output, and the Key Number value of 127 corresponds to the minimum possible controller
|
|
510
|
+
* controller output, and the Key Number value of 127 corresponds to the minimum possible controller output.
|
|
478
511
|
*/
|
|
479
512
|
isNegative: boolean;
|
|
480
513
|
/**
|
|
@@ -653,53 +686,27 @@ export declare class BasicZone {
|
|
|
653
686
|
*/
|
|
654
687
|
copyFrom(zone: BasicZone): void;
|
|
655
688
|
}
|
|
656
|
-
/**
|
|
657
|
-
* Represents a single instrument zone with an associated {@link BasicSample}.
|
|
658
|
-
*
|
|
659
|
-
* @group Sound Banks.Zones
|
|
660
|
-
*/
|
|
661
|
-
export declare class BasicInstrumentZone extends BasicZone {
|
|
662
|
-
/**
|
|
663
|
-
* The instrument this zone belongs to.
|
|
664
|
-
*/
|
|
665
|
-
readonly parentInstrument: BasicInstrument;
|
|
666
|
-
/**
|
|
667
|
-
* Zone's sample.
|
|
668
|
-
*/
|
|
669
|
-
private _sample;
|
|
670
|
-
/**
|
|
671
|
-
* The sample associated with this zone.
|
|
672
|
-
*/
|
|
673
|
-
get sample(): BasicSample;
|
|
674
|
-
/**
|
|
675
|
-
* Sets a sample for this zone, unliking the previous one from it.
|
|
676
|
-
* @param sample The sample to set.
|
|
677
|
-
*/
|
|
678
|
-
set sample(sample: BasicSample);
|
|
679
|
-
}
|
|
680
689
|
/**
|
|
681
690
|
* Represents a single preset zone with an associated {@link BasicInstrument}.
|
|
682
691
|
*
|
|
683
692
|
* @group Sound Banks.Zones
|
|
684
693
|
*/
|
|
685
|
-
export declare class BasicPresetZone extends
|
|
694
|
+
export declare class BasicPresetZone extends BasicLinkedZone<BasicPreset, BasicInstrument> {
|
|
695
|
+
protected readonly childGenerator: 41;
|
|
686
696
|
/**
|
|
687
697
|
* The preset this zone belongs to.
|
|
688
698
|
*/
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* The instrument associated with this zone.
|
|
692
|
-
*/
|
|
693
|
-
private _instrument;
|
|
699
|
+
get parentPreset(): BasicPreset;
|
|
694
700
|
/**
|
|
695
701
|
* The instrument associated with this zone.
|
|
696
702
|
*/
|
|
697
703
|
get instrument(): BasicInstrument;
|
|
698
704
|
/**
|
|
699
|
-
* Sets an instrument for this zone,
|
|
705
|
+
* Sets an instrument for this zone, unlinking the previous one from it.
|
|
700
706
|
* @param instrument The instrument to set.
|
|
701
707
|
*/
|
|
702
708
|
set instrument(instrument: BasicInstrument);
|
|
709
|
+
protected getChildList(bank: BasicSoundBank): BasicInstrument[];
|
|
703
710
|
}
|
|
704
711
|
/**
|
|
705
712
|
* SpessaSynth 4.0 brings the full bank LSB support in the API.
|
|
@@ -781,12 +788,14 @@ export declare class MIDIPatchTools {
|
|
|
781
788
|
/**
|
|
782
789
|
* Converts a given {@link MIDIPatch} to a string.
|
|
783
790
|
* The format is:
|
|
784
|
-
* - `DRUM:program` for `isGMGSDrum` set to `true`.
|
|
791
|
+
* - `DRUM:bankMSB:bankLSB:program` for `isGMGSDrum` set to `true`.
|
|
785
792
|
* - `bankLSB:bankMSB:program` for `isGMGSDrum` set to `false`.
|
|
793
|
+
* @param patch The patch to convert.
|
|
786
794
|
*/
|
|
787
795
|
static toMIDIString(patch: MIDIPatch): string;
|
|
788
796
|
/**
|
|
789
797
|
* Gets {@link MIDIPatch} from a given string.
|
|
798
|
+
* @param string The string in the {@link MIDIPatchTools.toMIDIString} format.
|
|
790
799
|
*/
|
|
791
800
|
static fromMIDIString(string: string): MIDIPatch;
|
|
792
801
|
/**
|
|
@@ -794,23 +803,30 @@ export declare class MIDIPatchTools {
|
|
|
794
803
|
* The format is:
|
|
795
804
|
* - `<MIDIPatch string> D <name>` for `isDrum` set to `true`.
|
|
796
805
|
* - `<MIDIPatch string> M <name>` for `isDrum` set to `false`.
|
|
806
|
+
* @param patch The patch to convert.
|
|
797
807
|
*/
|
|
798
808
|
static toFullMIDIString(patch: MIDIPatchFull): string;
|
|
799
809
|
/**
|
|
800
810
|
* Gets {@link MIDIPatchFull} from a given string.
|
|
811
|
+
* @param string The string in the {@link MIDIPatchTools.toFullMIDIString} format.
|
|
801
812
|
*/
|
|
802
813
|
static fromFullMIDIString(string: string): MIDIPatchFull;
|
|
803
814
|
/**
|
|
804
815
|
* Checks if two MIDI patches represent the same one.
|
|
816
|
+
* @param patch1 The first patch.
|
|
817
|
+
* @param patch2 The second patch.
|
|
805
818
|
*/
|
|
806
819
|
static matches(patch1: MIDIPatch, patch2: MIDIPatch): boolean;
|
|
807
820
|
/**
|
|
808
821
|
* A comparison function for `.sort()` or `.toSorted()`,
|
|
809
|
-
* ordering the patches in ascending order.
|
|
822
|
+
* ordering the patches in ascending order: by program, then bank MSB, then bank LSB, with GM/GS drums last.
|
|
823
|
+
* @param a The first patch.
|
|
824
|
+
* @param b The second patch.
|
|
810
825
|
*/
|
|
811
826
|
static compare(a: MIDIPatch, b: MIDIPatch): number;
|
|
812
827
|
/**
|
|
813
828
|
* Checks if the given {@link MIDIPatchFull} is an XG/GM2 drum patch.
|
|
829
|
+
* @param p The patch to check.
|
|
814
830
|
*/
|
|
815
831
|
static isXGDrum(p: MIDIPatchFull): boolean;
|
|
816
832
|
/**
|
|
@@ -820,18 +836,146 @@ export declare class MIDIPatchTools {
|
|
|
820
836
|
* @param patch The {@link MIDIPatch} to select.
|
|
821
837
|
* @param system The MIDI system to select for.
|
|
822
838
|
* @returns The selected patch.
|
|
823
|
-
* @throws Error An error if the array is empty
|
|
839
|
+
* @throws Error An error if the array is empty.
|
|
824
840
|
*/
|
|
825
841
|
static selectPatch<T extends MIDIPatchFull>(patches: T[], patch: MIDIPatch, system: MIDISystem): T;
|
|
826
842
|
private static getAnyDrums;
|
|
827
843
|
}
|
|
844
|
+
/**
|
|
845
|
+
* Represents a single preset.
|
|
846
|
+
* This is what is used for MIDI playback.
|
|
847
|
+
*
|
|
848
|
+
* @group Sound Banks
|
|
849
|
+
*/
|
|
850
|
+
export declare class BasicPreset implements MIDIPatchFull {
|
|
851
|
+
/**
|
|
852
|
+
* The parent soundbank instance
|
|
853
|
+
* Currently used for determining default modulators and XG status
|
|
854
|
+
*/
|
|
855
|
+
readonly parentSoundBank: BasicSoundBank;
|
|
856
|
+
/**
|
|
857
|
+
* The preset's name.
|
|
858
|
+
*/
|
|
859
|
+
name: string;
|
|
860
|
+
program: number;
|
|
861
|
+
bankMSB: number;
|
|
862
|
+
bankLSB: number;
|
|
863
|
+
isGMGSDrum: boolean;
|
|
864
|
+
/**
|
|
865
|
+
* The preset's zones.
|
|
866
|
+
* These are limited to specific key/velocity ranges and contain associated instruments.
|
|
867
|
+
*/
|
|
868
|
+
zones: BasicPresetZone[];
|
|
869
|
+
/**
|
|
870
|
+
* Preset's global zone.
|
|
871
|
+
* Its parameters are overridden by the local zone parameters.
|
|
872
|
+
*/
|
|
873
|
+
readonly globalZone: BasicZone;
|
|
874
|
+
/**
|
|
875
|
+
* Unused preset metadata, preserved.
|
|
876
|
+
*/
|
|
877
|
+
library: number;
|
|
878
|
+
/**
|
|
879
|
+
* Unused preset metadata, preserved.
|
|
880
|
+
*/
|
|
881
|
+
genre: number;
|
|
882
|
+
/**
|
|
883
|
+
* Unused preset metadata, preserved.
|
|
884
|
+
*/
|
|
885
|
+
morphology: number;
|
|
886
|
+
/**
|
|
887
|
+
* Creates a new preset.
|
|
888
|
+
* @param parentSoundBank The sound bank this preset belongs to.
|
|
889
|
+
* @param globalZone The optional global zone to associate within the preset.
|
|
890
|
+
*/
|
|
891
|
+
constructor(parentSoundBank: BasicSoundBank, globalZone?: BasicZone);
|
|
892
|
+
/**
|
|
893
|
+
* A boolean indicating if this preset is a drum preset.
|
|
894
|
+
*/
|
|
895
|
+
get isDrum(): boolean;
|
|
896
|
+
private static isInRange;
|
|
897
|
+
private static addUniqueModulators;
|
|
898
|
+
private static subtractRanges;
|
|
899
|
+
/**
|
|
900
|
+
* Unlinks everything from this preset.
|
|
901
|
+
* This is what {@link BasicSoundBank.deletePreset} calls, the preset itself stays intact.
|
|
902
|
+
* Use {@link restore} to undo it.
|
|
903
|
+
*/
|
|
904
|
+
delete(): void;
|
|
905
|
+
/**
|
|
906
|
+
* Links the instruments back to this preset, the inverse of {@link delete}.
|
|
907
|
+
* Use it to restore a deleted preset, for example when undoing the deletion.
|
|
908
|
+
* Add the preset back to the sound bank as well.
|
|
909
|
+
*/
|
|
910
|
+
restore(): void;
|
|
911
|
+
/**
|
|
912
|
+
* Deletes a preset zone from this preset.
|
|
913
|
+
* @param index The zone's index to delete.
|
|
914
|
+
*/
|
|
915
|
+
deleteZone(index: number): void;
|
|
916
|
+
/**
|
|
917
|
+
* Creates a new preset zone and returns it.
|
|
918
|
+
* @param instrument The instrument to associate with the zone.
|
|
919
|
+
* @param link If the instrument should be linked to this preset.
|
|
920
|
+
* Pass false for helper presets that are not part of a sound bank.
|
|
921
|
+
* Such a zone never changes the instrument's use count or its `linkedTo` list.
|
|
922
|
+
*
|
|
923
|
+
* > **Warning**
|
|
924
|
+
* >
|
|
925
|
+
* > A preset with unlinked zones must not be added to a sound bank.
|
|
926
|
+
*/
|
|
927
|
+
createZone(instrument: BasicInstrument, link?: boolean): BasicPresetZone;
|
|
928
|
+
/**
|
|
929
|
+
* Preloads (loads and caches synthesis data) for a given key range.
|
|
930
|
+
* @param keyMin The lowest allowed MIDI note number.
|
|
931
|
+
* @param keyMax The highest allowed MIDI note number.
|
|
932
|
+
*/
|
|
933
|
+
preload(keyMin: number, keyMax: number): void;
|
|
934
|
+
/**
|
|
935
|
+
* Checks if the bank and program numbers are the same for the given preset as this one.
|
|
936
|
+
* Shortened version of {@link MIDIPatchTools.matches}
|
|
937
|
+
* @param preset The preset to check.
|
|
938
|
+
*/
|
|
939
|
+
matches(preset: MIDIPatch): boolean;
|
|
940
|
+
/**
|
|
941
|
+
* Returns the voice synthesis data for this preset.
|
|
942
|
+
*
|
|
943
|
+
* > **Note**
|
|
944
|
+
* >
|
|
945
|
+
* > The `E-mu` attenuation correction
|
|
946
|
+
* > (`initialAttenuation` generator value being multiplied by `0.4`) is already performed.
|
|
947
|
+
*
|
|
948
|
+
* @param midiNote The MIDI note number.
|
|
949
|
+
* @param velocity The MIDI velocity.
|
|
950
|
+
* @returns The returned sound data.
|
|
951
|
+
*/
|
|
952
|
+
getVoiceParameters(midiNote: number, velocity: number): VoiceParameters[];
|
|
953
|
+
/**
|
|
954
|
+
* Alias for {@link MIDIPatchTools.toMIDIString}
|
|
955
|
+
*/
|
|
956
|
+
toMIDIString(): string;
|
|
957
|
+
/**
|
|
958
|
+
* Alias for {@link MIDIPatchTools.toFullMIDIString}
|
|
959
|
+
*/
|
|
960
|
+
toString(): string;
|
|
961
|
+
/**
|
|
962
|
+
* Combines preset into an instrument, flattening the preset zones into instrument zones.
|
|
963
|
+
* This is a really complex function that attempts to work around the DLS limitations of only having the instrument layer.
|
|
964
|
+
*
|
|
965
|
+
* > **Tip**
|
|
966
|
+
* >
|
|
967
|
+
* > Consider reading about [the DLS conversion problem](../../../docs/extra/dls-conversion-problem.md).
|
|
968
|
+
*
|
|
969
|
+
* @returns The instrument containing the flattened zones. If flattening was successful, it should sound exactly the same as this preset.
|
|
970
|
+
*/
|
|
971
|
+
toFlattenedInstrument(): BasicInstrument;
|
|
972
|
+
}
|
|
828
973
|
/**
|
|
829
974
|
* This module handles parsing and writing SoundFont2 (`.sf2`, `.sf3` and `.sfogg`) files.
|
|
830
975
|
* It represents a single sound bank.
|
|
831
976
|
*
|
|
832
|
-
* It also contains support for `.dls` files and experimental read and write support for [64-bit SFE](https://
|
|
977
|
+
* It also contains support for `.dls` files and experimental read and write support for [64-bit SFE](https://sfe-team-was-taken.github.io/SFE/).
|
|
833
978
|
*
|
|
834
|
-
|
|
835
979
|
* **Specifications:**
|
|
836
980
|
*
|
|
837
981
|
* - [SoundFont2 Specification](http://www.synthfont.com/sfspec24.pdf)
|
|
@@ -866,7 +1010,7 @@ export declare class BasicSoundBank {
|
|
|
866
1010
|
*/
|
|
867
1011
|
soundBankInfo: SoundBankInfoData;
|
|
868
1012
|
/**
|
|
869
|
-
* An array of all presets in the bank, ordered by
|
|
1013
|
+
* An array of all presets in the bank, ordered by program and bank number, with GM/GS drum presets last.
|
|
870
1014
|
*/
|
|
871
1015
|
presets: BasicPreset[];
|
|
872
1016
|
/**
|
|
@@ -917,12 +1061,15 @@ export declare class BasicSoundBank {
|
|
|
917
1061
|
*/
|
|
918
1062
|
static mergeSoundBanks(...soundBanks: BasicSoundBank[]): BasicSoundBank;
|
|
919
1063
|
/**
|
|
920
|
-
* Creates a simple
|
|
1064
|
+
* Creates a simple SF2 file with a single saw wave preset.
|
|
921
1065
|
* Useful for testing synthesizer's functionality without providing a file.
|
|
1066
|
+
* @returns The binary representation of the SF2 file.
|
|
922
1067
|
*/
|
|
923
1068
|
static getSampleSoundBankFile(): ArrayBuffer;
|
|
924
1069
|
/**
|
|
925
|
-
* Copies a given sound bank,
|
|
1070
|
+
* Copies a given sound bank, cloning all presets, instruments and samples.
|
|
1071
|
+
* The sample data is shared with the original, not copied.
|
|
1072
|
+
* Elements sharing a name are all copied, the repeats get a free name like `Piano-1`.
|
|
926
1073
|
* @param bank The sound bank to copy.
|
|
927
1074
|
*/
|
|
928
1075
|
static copyFrom(bank: BasicSoundBank): BasicSoundBank;
|
|
@@ -936,16 +1083,18 @@ export declare class BasicSoundBank {
|
|
|
936
1083
|
*
|
|
937
1084
|
* > **Warning**
|
|
938
1085
|
* >
|
|
939
|
-
* > Note that
|
|
940
|
-
* > in permanent sample quality loss!
|
|
1086
|
+
* > Note that compressing (sample format `compressed`) usually results
|
|
1087
|
+
* > in permanent sample quality loss! Decompressing does not restore it.
|
|
941
1088
|
* > This method is memory and CPU intensive with large sound banks.
|
|
942
1089
|
*
|
|
943
1090
|
* @param options Options associated with setting the sample format.
|
|
1091
|
+
* @returns The samples whose sample rate or loop points changed.
|
|
1092
|
+
* Compressing resamples samples outside 8000 to 96000 Hz.
|
|
944
1093
|
*/
|
|
945
|
-
setSampleFormat(options: SetSampleFormatOptions): Promise<
|
|
1094
|
+
setSampleFormat(options: SetSampleFormatOptions): Promise<BasicSample[]>;
|
|
946
1095
|
/**
|
|
947
1096
|
* Writes out a DLS Level 2 sound bank. This may not be 100% accurate.
|
|
948
|
-
*
|
|
1097
|
+
* Sample data is always written in the S16LE PCM encoding.
|
|
949
1098
|
*
|
|
950
1099
|
* > **Note**
|
|
951
1100
|
* >
|
|
@@ -995,41 +1144,47 @@ export declare class BasicSoundBank {
|
|
|
995
1144
|
*/
|
|
996
1145
|
addSamples(...samples: BasicSample[]): void;
|
|
997
1146
|
/**
|
|
998
|
-
* Clones a sample into this bank.
|
|
1147
|
+
* Clones a sample into this bank, together with its stereo partner.
|
|
999
1148
|
*
|
|
1000
1149
|
* > **Important**
|
|
1001
1150
|
* >
|
|
1002
|
-
* >
|
|
1151
|
+
* > By default, if a sample with the same name already exists in the sound bank,
|
|
1003
1152
|
* > it is returned instead and the new sample is not copied.
|
|
1153
|
+
* > Use the options or a {@link SoundBankCloner} to change that.
|
|
1004
1154
|
*
|
|
1005
1155
|
* @param sample The sample to copy.
|
|
1156
|
+
* @param options Options for cloning.
|
|
1006
1157
|
* @returns The copied sample.
|
|
1007
1158
|
*/
|
|
1008
|
-
cloneSample(sample: BasicSample): BasicSample;
|
|
1159
|
+
cloneSample(sample: BasicSample, options?: Partial<SoundBankCloneOptions>): BasicSample;
|
|
1009
1160
|
/**
|
|
1010
1161
|
* Recursively clones an instrument into this sound bank, as well as its samples.
|
|
1011
1162
|
*
|
|
1012
1163
|
* > **Important**
|
|
1013
1164
|
* >
|
|
1014
|
-
* >
|
|
1165
|
+
* > By default, if an instrument with the same name already exists in the sound bank,
|
|
1015
1166
|
* > it is returned instead and the new instrument is not copied.
|
|
1167
|
+
* > Use the options or a {@link SoundBankCloner} to change that.
|
|
1016
1168
|
*
|
|
1017
1169
|
* @param instrument The instrument to copy.
|
|
1170
|
+
* @param options Options for cloning.
|
|
1018
1171
|
* @returns The copied instrument.
|
|
1019
1172
|
*/
|
|
1020
|
-
cloneInstrument(instrument: BasicInstrument): BasicInstrument;
|
|
1173
|
+
cloneInstrument(instrument: BasicInstrument, options?: Partial<SoundBankCloneOptions>): BasicInstrument;
|
|
1021
1174
|
/**
|
|
1022
1175
|
* Recursively clones a preset into this sound bank, as well as its instruments and samples.
|
|
1023
1176
|
*
|
|
1024
1177
|
* > **Important**
|
|
1025
1178
|
* >
|
|
1026
|
-
* >
|
|
1179
|
+
* > By default, if a preset with the same name already exists in the sound bank,
|
|
1027
1180
|
* > it is returned instead and the new preset is not copied.
|
|
1181
|
+
* > Use the options or a {@link SoundBankCloner} to change that.
|
|
1028
1182
|
*
|
|
1029
1183
|
* @param preset The preset to copy.
|
|
1184
|
+
* @param options Options for cloning.
|
|
1030
1185
|
* @returns The copied preset.
|
|
1031
1186
|
*/
|
|
1032
|
-
clonePreset(preset: BasicPreset): BasicPreset;
|
|
1187
|
+
clonePreset(preset: BasicPreset, options?: Partial<SoundBankCloneOptions>): BasicPreset;
|
|
1033
1188
|
/**
|
|
1034
1189
|
* Updates internal values. Call after updating the preset list.
|
|
1035
1190
|
*/
|
|
@@ -1037,16 +1192,15 @@ export declare class BasicSoundBank {
|
|
|
1037
1192
|
/**
|
|
1038
1193
|
* Trims the sound bank _in-place_ to only contain samples in a given MIDI file.
|
|
1039
1194
|
*
|
|
1040
|
-
|
|
1041
1195
|
* Absent presets will be removed from the sound bank,
|
|
1042
1196
|
* and samples that don't get activated in the remaining presets will be removed as well.
|
|
1043
1197
|
*
|
|
1044
1198
|
* > **Note**
|
|
1045
1199
|
* >
|
|
1046
|
-
* > This exact type is returned from {@link BasicMIDI.getUsedProgramsAndKeys}
|
|
1200
|
+
* > This exact type is returned from {@link BasicMIDI.getUsedProgramsAndKeys}.
|
|
1047
1201
|
* > Consider reading the page for more explanation about the parameter.
|
|
1048
1202
|
*
|
|
1049
|
-
* @param presetData
|
|
1203
|
+
* @param presetData A `Map`: `BasicPreset` -> `Map<MIDI note, Set<velocity>>`.
|
|
1050
1204
|
* Absent presets will be removed from the sound bank,
|
|
1051
1205
|
* and samples that don't get activated in the remaining presets will be removed as well.
|
|
1052
1206
|
*/
|
|
@@ -1091,114 +1245,90 @@ export declare class BasicSoundBank {
|
|
|
1091
1245
|
protected printInfo(): void;
|
|
1092
1246
|
}
|
|
1093
1247
|
/**
|
|
1094
|
-
*
|
|
1095
|
-
* This is what is used for MIDI playback.
|
|
1248
|
+
* An element that zones can link to, a {@link BasicInstrument} or a {@link BasicSample}.
|
|
1096
1249
|
*
|
|
1097
|
-
* @group Sound Banks
|
|
1250
|
+
* @group Sound Banks.Zones
|
|
1098
1251
|
*/
|
|
1099
|
-
|
|
1252
|
+
interface LinkableZoneChild<P> {
|
|
1100
1253
|
/**
|
|
1101
|
-
* The
|
|
1102
|
-
* Currently used for determining default modulators and XG status
|
|
1103
|
-
*/
|
|
1104
|
-
readonly parentSoundBank: BasicSoundBank;
|
|
1105
|
-
/**
|
|
1106
|
-
* The preset's name.
|
|
1254
|
+
* The element's name.
|
|
1107
1255
|
*/
|
|
1108
1256
|
name: string;
|
|
1109
|
-
program: number;
|
|
1110
|
-
bankMSB: number;
|
|
1111
|
-
bankLSB: number;
|
|
1112
|
-
isGMGSDrum: boolean;
|
|
1113
1257
|
/**
|
|
1114
|
-
*
|
|
1115
|
-
*
|
|
1258
|
+
* Links the element to a parent.
|
|
1259
|
+
* @param parent The parent that uses the element.
|
|
1116
1260
|
*/
|
|
1117
|
-
|
|
1261
|
+
linkTo(parent: P): void;
|
|
1118
1262
|
/**
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1263
|
+
* Unlinks the element from a parent.
|
|
1264
|
+
* @param parent The parent that no longer uses the element.
|
|
1121
1265
|
*/
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1266
|
+
unlinkFrom(parent: P): void;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* A zone that belongs to a parent and uses a child: a preset zone with its instrument,
|
|
1270
|
+
* or an instrument zone with its sample.
|
|
1271
|
+
* It keeps the child linked to the parent while the zone uses it.
|
|
1272
|
+
*
|
|
1273
|
+
* @group Sound Banks.Zones
|
|
1274
|
+
*/
|
|
1275
|
+
export declare abstract class BasicLinkedZone<P, C extends LinkableZoneChild<P>> extends BasicZone {
|
|
1131
1276
|
/**
|
|
1132
|
-
*
|
|
1277
|
+
* The element this zone belongs to.
|
|
1133
1278
|
*/
|
|
1134
|
-
|
|
1279
|
+
protected readonly parent: P;
|
|
1135
1280
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
* @param parentSoundBank The sound bank this preset belongs to.
|
|
1138
|
-
* @param globalZone The optional global zone to associate within the preset.
|
|
1281
|
+
* The element this zone uses.
|
|
1139
1282
|
*/
|
|
1140
|
-
|
|
1283
|
+
protected child: C;
|
|
1141
1284
|
/**
|
|
1142
|
-
*
|
|
1285
|
+
* The generator that stores the child's index when writing.
|
|
1143
1286
|
*/
|
|
1144
|
-
|
|
1145
|
-
private static isInRange;
|
|
1146
|
-
private static addUniqueModulators;
|
|
1147
|
-
private static subtractRanges;
|
|
1287
|
+
protected abstract readonly childGenerator: GeneratorType;
|
|
1148
1288
|
/**
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1289
|
+
* If this zone counts as a use of its child.
|
|
1290
|
+
* Zones created without linking never change the child's links.
|
|
1151
1291
|
*/
|
|
1152
|
-
|
|
1292
|
+
private readonly linked;
|
|
1153
1293
|
/**
|
|
1154
|
-
* Creates a new
|
|
1155
|
-
* @param
|
|
1294
|
+
* Creates a new zone and links the child to the parent.
|
|
1295
|
+
* @param parent The element this zone belongs to.
|
|
1296
|
+
* @param child The element this zone uses.
|
|
1297
|
+
* @param link If the child should be linked to the parent.
|
|
1156
1298
|
*/
|
|
1157
|
-
|
|
1299
|
+
protected constructor(parent: P, child: C, link: boolean);
|
|
1158
1300
|
/**
|
|
1159
|
-
*
|
|
1160
|
-
* @param
|
|
1161
|
-
* @param keyMax The highest allowed MIDI note number.
|
|
1301
|
+
* Replaces the child, moving the link from the previous one to the new one.
|
|
1302
|
+
* @param child The new child.
|
|
1162
1303
|
*/
|
|
1163
|
-
|
|
1304
|
+
protected setChild(child: C): void;
|
|
1164
1305
|
/**
|
|
1165
|
-
*
|
|
1166
|
-
*
|
|
1167
|
-
* @param preset The preset to check.
|
|
1306
|
+
* The bank's list that the child's index is written from.
|
|
1307
|
+
* @param bank The bank being written.
|
|
1168
1308
|
*/
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
* @param midiNote The MIDI note number.
|
|
1179
|
-
* @param velocity The MIDI velocity.
|
|
1180
|
-
* @returns The returned sound data.
|
|
1181
|
-
*/
|
|
1182
|
-
getVoiceParameters(midiNote: number, velocity: number): VoiceParameters[];
|
|
1309
|
+
protected abstract getChildList(bank: BasicSoundBank): C[];
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* Represents a single instrument zone with an associated {@link BasicSample}.
|
|
1313
|
+
*
|
|
1314
|
+
* @group Sound Banks.Zones
|
|
1315
|
+
*/
|
|
1316
|
+
export declare class BasicInstrumentZone extends BasicLinkedZone<BasicInstrument, BasicSample> {
|
|
1317
|
+
protected readonly childGenerator: 53;
|
|
1183
1318
|
/**
|
|
1184
|
-
*
|
|
1319
|
+
* The instrument this zone belongs to.
|
|
1185
1320
|
*/
|
|
1186
|
-
|
|
1321
|
+
get parentInstrument(): BasicInstrument;
|
|
1187
1322
|
/**
|
|
1188
|
-
*
|
|
1323
|
+
* The sample associated with this zone.
|
|
1189
1324
|
*/
|
|
1190
|
-
|
|
1325
|
+
get sample(): BasicSample;
|
|
1191
1326
|
/**
|
|
1192
|
-
*
|
|
1193
|
-
*
|
|
1194
|
-
*
|
|
1195
|
-
* > **Tip**
|
|
1196
|
-
* >
|
|
1197
|
-
* > Consider reading about [the DLS conversion problem](../../../docs/extra/dls-conversion-problem.md).
|
|
1198
|
-
*
|
|
1199
|
-
* @returns The instrument containing the flattened zones. If flattening was successful, it should exactly the same as this preset.
|
|
1327
|
+
* Sets a sample for this zone, unlinking the previous one from it.
|
|
1328
|
+
* @param sample The sample to set.
|
|
1200
1329
|
*/
|
|
1201
|
-
|
|
1330
|
+
set sample(sample: BasicSample);
|
|
1331
|
+
protected getChildList(bank: BasicSoundBank): BasicSample[];
|
|
1202
1332
|
}
|
|
1203
1333
|
/**
|
|
1204
1334
|
* This class represents a single instrument, a layer below the BasicPreset.
|
|
@@ -1239,13 +1369,33 @@ export declare class BasicInstrument {
|
|
|
1239
1369
|
/**
|
|
1240
1370
|
* Creates a new instrument zone, adds it to this instrument and returns it.
|
|
1241
1371
|
* @param sample The sample to associate with the zone.
|
|
1372
|
+
* @param link If the sample should be linked to this instrument.
|
|
1373
|
+
* Pass false for helper instruments that are not part of a sound bank.
|
|
1374
|
+
* Such a zone never changes the sample's use count or its `linkedTo` list.
|
|
1375
|
+
*
|
|
1376
|
+
* > **Warning**
|
|
1377
|
+
* >
|
|
1378
|
+
* > An instrument with unlinked zones must not be added to a sound bank!
|
|
1242
1379
|
*/
|
|
1243
|
-
createZone(sample: BasicSample): BasicInstrumentZone;
|
|
1380
|
+
createZone(sample: BasicSample, link?: boolean): BasicInstrumentZone;
|
|
1244
1381
|
/**
|
|
1245
1382
|
* Unlinks the instrument from a given preset.
|
|
1246
1383
|
* @param preset The preset to unlink from.
|
|
1247
1384
|
*/
|
|
1248
1385
|
unlinkFrom(preset: BasicPreset): void;
|
|
1386
|
+
/**
|
|
1387
|
+
* Unlinks everything from this instrument.
|
|
1388
|
+
* This is what {@link BasicSoundBank.deleteInstrument} calls, the instrument itself stays intact.
|
|
1389
|
+
* Use {@link restore} to undo it.
|
|
1390
|
+
* @throws Error if the instrument is still used by a preset.
|
|
1391
|
+
*/
|
|
1392
|
+
delete(): void;
|
|
1393
|
+
/**
|
|
1394
|
+
* Links the samples back to this instrument, the inverse of {@link delete}.
|
|
1395
|
+
* Use it to restore a deleted instrument, for example when undoing the deletion.
|
|
1396
|
+
* Add the instrument back to the sound bank as well.
|
|
1397
|
+
*/
|
|
1398
|
+
restore(): void;
|
|
1249
1399
|
/**
|
|
1250
1400
|
* Deletes a given instrument zone if it has no uses.
|
|
1251
1401
|
* @param index The index of the zone to delete.
|
|
@@ -1299,7 +1449,7 @@ export declare class BasicSample {
|
|
|
1299
1449
|
*
|
|
1300
1450
|
* > **Warning**
|
|
1301
1451
|
* >
|
|
1302
|
-
* > Do not change this value directly.
|
|
1452
|
+
* > Do not change this value directly. Use {@link BasicSample.setSampleType},
|
|
1303
1453
|
* > {@link BasicSample.setLinkedSample} or {@link BasicSample.unlinkSample} instead.
|
|
1304
1454
|
*/
|
|
1305
1455
|
sampleType: SampleType;
|
|
@@ -1337,6 +1487,19 @@ export declare class BasicSample {
|
|
|
1337
1487
|
* The sample's audio data.
|
|
1338
1488
|
*/
|
|
1339
1489
|
protected audioData?: Float32Array;
|
|
1490
|
+
/**
|
|
1491
|
+
* The signed 16-bit little endian PCM data, as read from the file.
|
|
1492
|
+
*/
|
|
1493
|
+
protected s16leData?: Uint8Array;
|
|
1494
|
+
/**
|
|
1495
|
+
* The length in sample points when it is not known from the data,
|
|
1496
|
+
* either a sample without data or a vorbis stream's length that was read once.
|
|
1497
|
+
*/
|
|
1498
|
+
protected cachedLength?: number;
|
|
1499
|
+
/**
|
|
1500
|
+
* The form the data had before it was released or when it was loaded without data.
|
|
1501
|
+
*/
|
|
1502
|
+
protected releasedForm?: SampleStoredData["form"];
|
|
1340
1503
|
/**
|
|
1341
1504
|
* Creates a new `BasicSample`.
|
|
1342
1505
|
*
|
|
@@ -1348,7 +1511,7 @@ export declare class BasicSample {
|
|
|
1348
1511
|
* @param sampleRate The sample's rate in Hz.
|
|
1349
1512
|
* @param originalKey The sample's pitch as a MIDI note number.
|
|
1350
1513
|
* @param pitchCorrection The sample's pitch correction in cents.
|
|
1351
|
-
* @param sampleType The sample's type,
|
|
1514
|
+
* @param sampleType The sample's type, one of the {@link SampleTypes}.
|
|
1352
1515
|
* @param loopStart The sample's loop start relative to the sample start in sample points.
|
|
1353
1516
|
* @param loopEnd The sample's loop end relative to the sample start in sample points. Exclusive.
|
|
1354
1517
|
*/
|
|
@@ -1357,6 +1520,27 @@ export declare class BasicSample {
|
|
|
1357
1520
|
* Indicates if the sample contains compressed audio.
|
|
1358
1521
|
*/
|
|
1359
1522
|
get isCompressed(): boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* The form the sample stores its data in, see {@link BasicSample.getStoredData}.
|
|
1525
|
+
* A sample without data reports the form it had, or undefined if it never had data.
|
|
1526
|
+
*/
|
|
1527
|
+
get storedForm(): SampleStoredData["form"] | undefined;
|
|
1528
|
+
/**
|
|
1529
|
+
* Indicates if the sample holds any audio data.
|
|
1530
|
+
* A sample loaded with `sampleData: false` or released with {@link BasicSample.releaseData} does not.
|
|
1531
|
+
*/
|
|
1532
|
+
get hasData(): boolean;
|
|
1533
|
+
/**
|
|
1534
|
+
* The sample's length in sample points, known without decoding the data.
|
|
1535
|
+
* Samples without data keep the length they had.
|
|
1536
|
+
*
|
|
1537
|
+
* > **Note**
|
|
1538
|
+
* >
|
|
1539
|
+
* > For compressed samples, it is read from the Ogg page headers, which is exact for well-formed streams.
|
|
1540
|
+
* > A stream with gaps in its granule positions decodes shorter. Once it is decoded,
|
|
1541
|
+
* > the length is the decoded one.
|
|
1542
|
+
*/
|
|
1543
|
+
get sampleLength(): number;
|
|
1360
1544
|
/**
|
|
1361
1545
|
* If the sample is linked to another sample.
|
|
1362
1546
|
*/
|
|
@@ -1371,6 +1555,34 @@ export declare class BasicSample {
|
|
|
1371
1555
|
* @return either s16le or vorbis data.
|
|
1372
1556
|
*/
|
|
1373
1557
|
getRawData(allowVorbis: boolean): Uint8Array;
|
|
1558
|
+
/**
|
|
1559
|
+
* Gets the sample's data in the form it is stored, without decoding, encoding or copying it.
|
|
1560
|
+
* Use {@link BasicSample.setStoredData} to give it to another sample, for example in another thread.
|
|
1561
|
+
* @returns The stored form and its data.
|
|
1562
|
+
*/
|
|
1563
|
+
getStoredData(): SampleStoredData;
|
|
1564
|
+
/**
|
|
1565
|
+
* Replaces the sample's data with data in a given stored form, without decoding or encoding it.
|
|
1566
|
+
* The sample rate and loop points are not changed.
|
|
1567
|
+
*
|
|
1568
|
+
* > **Note**
|
|
1569
|
+
* >
|
|
1570
|
+
* > s16le and vorbis data is written back unchanged when saving, float32 data is encoded.
|
|
1571
|
+
*
|
|
1572
|
+
* @param stored The stored form and its data, as returned by {@link BasicSample.getStoredData}.
|
|
1573
|
+
*/
|
|
1574
|
+
setStoredData(stored: SampleStoredData): void;
|
|
1575
|
+
/**
|
|
1576
|
+
* Drops all the sample's data. The parameters and {@link BasicSample.sampleLength} stay.
|
|
1577
|
+
* Reading the audio data afterward throws an error until {@link BasicSample.setStoredData} gives it new data.
|
|
1578
|
+
*/
|
|
1579
|
+
releaseData(): void;
|
|
1580
|
+
/**
|
|
1581
|
+
* Drops the decoded float data if the sample can decode it again from its stored s16le or vorbis data.
|
|
1582
|
+
* Replaced data (set with {@link BasicSample.setAudioData}) is kept.
|
|
1583
|
+
* @returns True if the decoded data was dropped.
|
|
1584
|
+
*/
|
|
1585
|
+
releaseDecoded(): boolean;
|
|
1374
1586
|
/**
|
|
1375
1587
|
* Resamples the audio data _in-place_ to a given sample rate.
|
|
1376
1588
|
* @param newSampleRate The new sample rate, in hertz.
|
|
@@ -1413,6 +1625,15 @@ export declare class BasicSample {
|
|
|
1413
1625
|
* @param data The new compressed data.
|
|
1414
1626
|
*/
|
|
1415
1627
|
setCompressedData(data: Uint8Array): void;
|
|
1628
|
+
/**
|
|
1629
|
+
* The error for reading the data of a sample that has none.
|
|
1630
|
+
*/
|
|
1631
|
+
protected noDataError(): Error;
|
|
1632
|
+
/**
|
|
1633
|
+
* Decodes signed 16-bit little endian PCM into float.
|
|
1634
|
+
* @param data The s16le data. It may be a view at any offset.
|
|
1635
|
+
*/
|
|
1636
|
+
protected decodeS16LE(data: Uint8Array): Float32Array<ArrayBuffer>;
|
|
1416
1637
|
/**
|
|
1417
1638
|
* Encodes s16le sample
|
|
1418
1639
|
* @return the encoded data
|
|
@@ -1490,7 +1711,7 @@ export declare const MIDIMessageTypes: {
|
|
|
1490
1711
|
*/
|
|
1491
1712
|
type MIDIMessageType = (typeof MIDIMessageTypes)[keyof typeof MIDIMessageTypes];
|
|
1492
1713
|
/**
|
|
1493
|
-
* All MIDI 1.0 controller
|
|
1714
|
+
* All MIDI 1.0 controller numbers.
|
|
1494
1715
|
*
|
|
1495
1716
|
* > **Tip**
|
|
1496
1717
|
* >
|
|
@@ -1547,10 +1768,10 @@ export declare const MIDIControllers: {
|
|
|
1547
1768
|
readonly effectControl2LSB: 45;
|
|
1548
1769
|
readonly undefinedCC14LSB: 46;
|
|
1549
1770
|
readonly undefinedCC15LSB: 47;
|
|
1550
|
-
readonly
|
|
1551
|
-
readonly
|
|
1552
|
-
readonly
|
|
1553
|
-
readonly
|
|
1771
|
+
readonly generalPurposeController1LSB: 48;
|
|
1772
|
+
readonly generalPurposeController2LSB: 49;
|
|
1773
|
+
readonly generalPurposeController3LSB: 50;
|
|
1774
|
+
readonly generalPurposeController4LSB: 51;
|
|
1554
1775
|
readonly undefinedCC20LSB: 52;
|
|
1555
1776
|
readonly undefinedCC21LSB: 53;
|
|
1556
1777
|
readonly undefinedCC22LSB: 54;
|
|
@@ -1601,32 +1822,120 @@ export declare const MIDIControllers: {
|
|
|
1601
1822
|
readonly nonRegisteredParameterMSB: 99;
|
|
1602
1823
|
readonly registeredParameterLSB: 100;
|
|
1603
1824
|
readonly registeredParameterMSB: 101;
|
|
1825
|
+
readonly undefinedCC102: 102;
|
|
1826
|
+
readonly undefinedCC103: 103;
|
|
1827
|
+
readonly undefinedCC104: 104;
|
|
1828
|
+
readonly undefinedCC105: 105;
|
|
1829
|
+
readonly undefinedCC106: 106;
|
|
1830
|
+
readonly undefinedCC107: 107;
|
|
1831
|
+
readonly undefinedCC108: 108;
|
|
1832
|
+
readonly undefinedCC109: 109;
|
|
1833
|
+
readonly undefinedCC110: 110;
|
|
1834
|
+
readonly undefinedCC111: 111;
|
|
1835
|
+
readonly undefinedCC112: 112;
|
|
1836
|
+
readonly undefinedCC113: 113;
|
|
1837
|
+
readonly undefinedCC114: 114;
|
|
1838
|
+
readonly undefinedCC115: 115;
|
|
1839
|
+
readonly undefinedCC116: 116;
|
|
1840
|
+
readonly undefinedCC117: 117;
|
|
1841
|
+
readonly undefinedCC118: 118;
|
|
1842
|
+
readonly undefinedCC119: 119;
|
|
1843
|
+
readonly allSoundOff: 120;
|
|
1844
|
+
readonly resetAllControllers: 121;
|
|
1845
|
+
readonly localControlOnOff: 122;
|
|
1846
|
+
readonly allNotesOff: 123;
|
|
1847
|
+
readonly omniModeOff: 124;
|
|
1848
|
+
readonly omniModeOn: 125;
|
|
1849
|
+
readonly monoModeOn: 126;
|
|
1850
|
+
readonly polyModeOn: 127;
|
|
1851
|
+
/**
|
|
1852
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController1LSB} instead.
|
|
1853
|
+
*/
|
|
1854
|
+
readonly undefinedCC16LSB: 48;
|
|
1855
|
+
/**
|
|
1856
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController2LSB} instead.
|
|
1857
|
+
*/
|
|
1858
|
+
readonly undefinedCC17LSB: 49;
|
|
1859
|
+
/**
|
|
1860
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController3LSB} instead.
|
|
1861
|
+
*/
|
|
1862
|
+
readonly undefinedCC18LSB: 50;
|
|
1863
|
+
/**
|
|
1864
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController4LSB} instead.
|
|
1865
|
+
*/
|
|
1866
|
+
readonly undefinedCC19LSB: 51;
|
|
1867
|
+
/**
|
|
1868
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC102} instead.
|
|
1869
|
+
*/
|
|
1604
1870
|
readonly undefinedCC102LSB: 102;
|
|
1871
|
+
/**
|
|
1872
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC103} instead.
|
|
1873
|
+
*/
|
|
1605
1874
|
readonly undefinedCC103LSB: 103;
|
|
1875
|
+
/**
|
|
1876
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC104} instead.
|
|
1877
|
+
*/
|
|
1606
1878
|
readonly undefinedCC104LSB: 104;
|
|
1879
|
+
/**
|
|
1880
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC105} instead.
|
|
1881
|
+
*/
|
|
1607
1882
|
readonly undefinedCC105LSB: 105;
|
|
1883
|
+
/**
|
|
1884
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC106} instead.
|
|
1885
|
+
*/
|
|
1608
1886
|
readonly undefinedCC106LSB: 106;
|
|
1887
|
+
/**
|
|
1888
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC107} instead.
|
|
1889
|
+
*/
|
|
1609
1890
|
readonly undefinedCC107LSB: 107;
|
|
1891
|
+
/**
|
|
1892
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC108} instead.
|
|
1893
|
+
*/
|
|
1610
1894
|
readonly undefinedCC108LSB: 108;
|
|
1895
|
+
/**
|
|
1896
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC109} instead.
|
|
1897
|
+
*/
|
|
1611
1898
|
readonly undefinedCC109LSB: 109;
|
|
1899
|
+
/**
|
|
1900
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC110} instead.
|
|
1901
|
+
*/
|
|
1612
1902
|
readonly undefinedCC110LSB: 110;
|
|
1903
|
+
/**
|
|
1904
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC111} instead.
|
|
1905
|
+
*/
|
|
1613
1906
|
readonly undefinedCC111LSB: 111;
|
|
1907
|
+
/**
|
|
1908
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC112} instead.
|
|
1909
|
+
*/
|
|
1614
1910
|
readonly undefinedCC112LSB: 112;
|
|
1911
|
+
/**
|
|
1912
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC113} instead.
|
|
1913
|
+
*/
|
|
1615
1914
|
readonly undefinedCC113LSB: 113;
|
|
1915
|
+
/**
|
|
1916
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC114} instead.
|
|
1917
|
+
*/
|
|
1616
1918
|
readonly undefinedCC114LSB: 114;
|
|
1919
|
+
/**
|
|
1920
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC115} instead.
|
|
1921
|
+
*/
|
|
1617
1922
|
readonly undefinedCC115LSB: 115;
|
|
1923
|
+
/**
|
|
1924
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC116} instead.
|
|
1925
|
+
*/
|
|
1618
1926
|
readonly undefinedCC116LSB: 116;
|
|
1927
|
+
/**
|
|
1928
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC117} instead.
|
|
1929
|
+
*/
|
|
1619
1930
|
readonly undefinedCC117LSB: 117;
|
|
1931
|
+
/**
|
|
1932
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC118} instead.
|
|
1933
|
+
*/
|
|
1620
1934
|
readonly undefinedCC118LSB: 118;
|
|
1935
|
+
/**
|
|
1936
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC119} instead.
|
|
1937
|
+
*/
|
|
1621
1938
|
readonly undefinedCC119LSB: 119;
|
|
1622
|
-
readonly allSoundOff: 120;
|
|
1623
|
-
readonly resetAllControllers: 121;
|
|
1624
|
-
readonly localControlOnOff: 122;
|
|
1625
|
-
readonly allNotesOff: 123;
|
|
1626
|
-
readonly omniModeOff: 124;
|
|
1627
|
-
readonly omniModeOn: 125;
|
|
1628
|
-
readonly monoModeOn: 126;
|
|
1629
|
-
readonly polyModeOn: 127;
|
|
1630
1939
|
};
|
|
1631
1940
|
/**
|
|
1632
1941
|
* @inheritDoc MIDIControllers
|
|
@@ -1847,7 +2156,8 @@ export interface VoiceParameters {
|
|
|
1847
2156
|
* This function is used to compress/encode a {@link BasicSample}.
|
|
1848
2157
|
* The function is recommended to be asynchronous.
|
|
1849
2158
|
*
|
|
1850
|
-
*
|
|
2159
|
+
* > **Note**
|
|
2160
|
+
* >
|
|
1851
2161
|
* > Using a custom function allows for using *any* type of compression for the SF3 soundBank.
|
|
1852
2162
|
* > This is allowed by the [RFC describing SF3 spec](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont3Format),
|
|
1853
2163
|
* > but SpessaSynth can only read Ogg Vorbis compression.
|
|
@@ -1889,7 +2199,7 @@ export type SetSampleFormatOptions = {
|
|
|
1889
2199
|
* - `pcm` - decompresses the sound bank and changes its version to `2.04` (SF2)
|
|
1890
2200
|
* - `compressed` - compresses the sound bank with a given function and changes its version to `3.0` (SF3)
|
|
1891
2201
|
*
|
|
1892
|
-
* Note that
|
|
2202
|
+
* Note that compressing usually results in permanent sample quality loss! Decompressing does not restore it.
|
|
1893
2203
|
*/
|
|
1894
2204
|
format: "pcm";
|
|
1895
2205
|
} | {
|
|
@@ -1898,7 +2208,7 @@ export type SetSampleFormatOptions = {
|
|
|
1898
2208
|
* - `pcm` - decompresses the sound bank and changes its version to `2.04` (SF2)
|
|
1899
2209
|
* - `compressed` - compresses the sound bank with a given function and changes its version to `3.0` (SF3)
|
|
1900
2210
|
*
|
|
1901
|
-
* Note that
|
|
2211
|
+
* Note that compressing usually results in permanent sample quality loss! Decompressing does not restore it.
|
|
1902
2212
|
*/
|
|
1903
2213
|
format: "compressed";
|
|
1904
2214
|
/**
|
|
@@ -1919,7 +2229,7 @@ export interface SoundBankWriteOptions {
|
|
|
1919
2229
|
*/
|
|
1920
2230
|
software: string;
|
|
1921
2231
|
/**
|
|
1922
|
-
* A function to allow showing progress long operations. It can be undefined.
|
|
2232
|
+
* A function to allow showing progress of long operations. It can be undefined.
|
|
1923
2233
|
*/
|
|
1924
2234
|
progressFunction?: ProgressFunction;
|
|
1925
2235
|
}
|
|
@@ -1956,43 +2266,112 @@ export interface SFEWriteOptions extends SoundBankWriteOptions {
|
|
|
1956
2266
|
* Increases maximum size from 4GB to effectively infinite.
|
|
1957
2267
|
* Recommended, since SFE 4 is effectively incompatible with SF2.
|
|
1958
2268
|
*/
|
|
1959
|
-
rf64: boolean;
|
|
2269
|
+
rf64: boolean;
|
|
2270
|
+
}
|
|
2271
|
+
/**
|
|
2272
|
+
* A simple range interface.
|
|
2273
|
+
*
|
|
2274
|
+
* @group Sound Banks.Zones
|
|
2275
|
+
*/
|
|
2276
|
+
export interface GenericRange {
|
|
2277
|
+
/**
|
|
2278
|
+
* The minimum value.
|
|
2279
|
+
*/
|
|
2280
|
+
min: number;
|
|
2281
|
+
/**
|
|
2282
|
+
* The maximum value.
|
|
2283
|
+
*/
|
|
2284
|
+
max: number;
|
|
2285
|
+
}
|
|
2286
|
+
/**
|
|
2287
|
+
* - Key - the preset.
|
|
2288
|
+
* - Value - A Map:
|
|
2289
|
+
* - Key: The MIDI note number.
|
|
2290
|
+
* - Value: A set of all velocities this key was pressed with.
|
|
2291
|
+
*
|
|
2292
|
+
* @group Sound Banks
|
|
2293
|
+
*/
|
|
2294
|
+
export type PresetsWithKeyCombinations<T extends MIDIPatchFull> = Map<T, Map<number, Set<number>>>;
|
|
2295
|
+
/**
|
|
2296
|
+
* One of the General MIDI systems.
|
|
2297
|
+
*
|
|
2298
|
+
* > **Tip**
|
|
2299
|
+
* >
|
|
2300
|
+
* > Consider reading the [MIDI Implementation](../../docs/extra/midi-implementation.md)
|
|
2301
|
+
* to learn more about these systems.
|
|
2302
|
+
*
|
|
2303
|
+
* @group MIDI.Protocol
|
|
2304
|
+
*/
|
|
2305
|
+
export type MIDISystem = "gm" | "gm2" | "gs" | "xg";
|
|
2306
|
+
/**
|
|
2307
|
+
* A sample's data in the form the sample stores it, without decoding or encoding.
|
|
2308
|
+
* - `s16le` - signed 16-bit little endian PCM
|
|
2309
|
+
* - `vorbis` - an Ogg Vorbis stream (SF3)
|
|
2310
|
+
* - `float32` - decoded or replaced float PCM
|
|
2311
|
+
*
|
|
2312
|
+
* @group Sound Banks.Samples
|
|
2313
|
+
*/
|
|
2314
|
+
export type SampleStoredData = {
|
|
2315
|
+
form: "s16le";
|
|
2316
|
+
data: Uint8Array;
|
|
2317
|
+
} | {
|
|
2318
|
+
form: "vorbis";
|
|
2319
|
+
data: Uint8Array;
|
|
2320
|
+
} | {
|
|
2321
|
+
form: "float32";
|
|
2322
|
+
data: Float32Array;
|
|
2323
|
+
};
|
|
2324
|
+
/**
|
|
2325
|
+
* Options for loading a sound bank with {@link SoundBankLoader.fromArrayBuffer}.
|
|
2326
|
+
*
|
|
2327
|
+
* @group Sound Banks
|
|
2328
|
+
*/
|
|
2329
|
+
export interface SoundBankLoadOptions {
|
|
2330
|
+
/**
|
|
2331
|
+
* If the sample data should be loaded.
|
|
2332
|
+
* When false, the samples keep all their parameters and their length, but hold no data.
|
|
2333
|
+
* Presets, instruments and samples come out in the same order as with a full load.
|
|
2334
|
+
* Use {@link BasicSample.setStoredData} to give a sample its data later.
|
|
2335
|
+
*
|
|
2336
|
+
* > **Note**
|
|
2337
|
+
* >
|
|
2338
|
+
* > DLS files and SF2Pack banks are still decoded fully during loading. The data is dropped afterward.
|
|
2339
|
+
*/
|
|
2340
|
+
sampleData: boolean;
|
|
2341
|
+
/**
|
|
2342
|
+
* If the sample data should be copied out of the file buffer.
|
|
2343
|
+
* When false, the samples are views into the given buffer, which saves memory and time during loading,
|
|
2344
|
+
* but keeps the whole buffer alive as long as any of the samples are.
|
|
2345
|
+
*
|
|
2346
|
+
* > **Note**
|
|
2347
|
+
* >
|
|
2348
|
+
* > DLS files always copy their data.
|
|
2349
|
+
*/
|
|
2350
|
+
copySampleData: boolean;
|
|
1960
2351
|
}
|
|
1961
2352
|
/**
|
|
1962
|
-
*
|
|
2353
|
+
* Options for cloning elements into a sound bank with {@link SoundBankCloner}.
|
|
1963
2354
|
*
|
|
1964
|
-
* @group Sound Banks
|
|
2355
|
+
* @group Sound Banks
|
|
1965
2356
|
*/
|
|
1966
|
-
export interface
|
|
2357
|
+
export interface SoundBankCloneOptions {
|
|
1967
2358
|
/**
|
|
1968
|
-
*
|
|
2359
|
+
* If the cloned element itself is reused when an element with the same name exists in the bank.
|
|
2360
|
+
* When false, it is always copied, under a free name (`Name-1`, `Name-2` and so on).
|
|
1969
2361
|
*/
|
|
1970
|
-
|
|
2362
|
+
reuseByName: boolean;
|
|
1971
2363
|
/**
|
|
1972
|
-
*
|
|
2364
|
+
* If the instruments and samples used by a cloned element are reused when one with the same name exists.
|
|
2365
|
+
* When false, they are copied under a free name as well.
|
|
2366
|
+
* A stereo partner of a copied sample is always copied with it.
|
|
1973
2367
|
*/
|
|
1974
|
-
|
|
2368
|
+
reuseChildrenByName: boolean;
|
|
2369
|
+
/**
|
|
2370
|
+
* If the new elements are added to the bank.
|
|
2371
|
+
* When false, they are only listed in {@link SoundBankCloner.created}.
|
|
2372
|
+
*/
|
|
2373
|
+
addToBank: boolean;
|
|
1975
2374
|
}
|
|
1976
|
-
/**
|
|
1977
|
-
* - Key - the preset.
|
|
1978
|
-
* - Value - A Map:
|
|
1979
|
-
* - Key: The MIDI note number.
|
|
1980
|
-
* - Value: A set of all velocities this key was pressed with.
|
|
1981
|
-
*
|
|
1982
|
-
* @group MIDI.Protocol
|
|
1983
|
-
*/
|
|
1984
|
-
export type PresetsWithKeyCombinations<T extends MIDIPatchFull> = Map<T, Map<number, Set<number>>>;
|
|
1985
|
-
/**
|
|
1986
|
-
* One of the General MIDI systems.
|
|
1987
|
-
*
|
|
1988
|
-
* > **Tip**
|
|
1989
|
-
* >
|
|
1990
|
-
* > Consider reading the [MIDI Implementation](../../docs/extra/midi-implementation.md)
|
|
1991
|
-
* to learn more about these systems.
|
|
1992
|
-
*
|
|
1993
|
-
* @group MIDI.Protocol
|
|
1994
|
-
*/
|
|
1995
|
-
export type MIDISystem = "gm" | "gm2" | "gs" | "xg";
|
|
1996
2375
|
/**
|
|
1997
2376
|
* The available interpolation types of the synthesizer.
|
|
1998
2377
|
* Interpolation defines how sample points between the sample data are calculated.
|
|
@@ -2012,9 +2391,28 @@ export declare const InterpolationTypes: {
|
|
|
2012
2391
|
*/
|
|
2013
2392
|
readonly nearestNeighbor: 1;
|
|
2014
2393
|
/**
|
|
2015
|
-
*
|
|
2394
|
+
* Cubic Hermite interpolation. Good quality with little artifacting. (Default)
|
|
2395
|
+
*
|
|
2396
|
+
* Recommended for most use-cases.
|
|
2016
2397
|
*/
|
|
2017
2398
|
readonly hermite: 2;
|
|
2399
|
+
/**
|
|
2400
|
+
* 32-point windowed sinc interpolation.
|
|
2401
|
+
*
|
|
2402
|
+
* Very high quality with almost no aliasing or harmonic distortion,
|
|
2403
|
+
* usable in real time, but at a significantly higher CPU cost.
|
|
2404
|
+
*/
|
|
2405
|
+
readonly sinc32: 3;
|
|
2406
|
+
/**
|
|
2407
|
+
* 128-point windowed sinc interpolation with antialiasing.
|
|
2408
|
+
*
|
|
2409
|
+
* The best quality, but extremely high cpu cost.
|
|
2410
|
+
*
|
|
2411
|
+
* > **Warning**
|
|
2412
|
+
* >
|
|
2413
|
+
* > This is very slow (especially for pitched up samples) and is meant for offline rendering, not real time playback.
|
|
2414
|
+
*/
|
|
2415
|
+
readonly sinc128: 4;
|
|
2018
2416
|
};
|
|
2019
2417
|
/**
|
|
2020
2418
|
* @inheritDoc InterpolationTypes
|
|
@@ -2022,6 +2420,32 @@ export declare const InterpolationTypes: {
|
|
|
2022
2420
|
* @group Synthesizer.Options
|
|
2023
2421
|
*/
|
|
2024
2422
|
export type InterpolationType = (typeof InterpolationTypes)[keyof typeof InterpolationTypes];
|
|
2423
|
+
/**
|
|
2424
|
+
* The special EFX control sources of a {@link GSInsertionBlock} (EFX CONTROL SOURCE 1/2).
|
|
2425
|
+
* Values `1-95` select the control change with that number, other values are off.
|
|
2426
|
+
*
|
|
2427
|
+
* @group Synthesizer.GS Effects
|
|
2428
|
+
*/
|
|
2429
|
+
export declare const GSInsertionControlSources: {
|
|
2430
|
+
/**
|
|
2431
|
+
* No control.
|
|
2432
|
+
*/
|
|
2433
|
+
readonly off: 0;
|
|
2434
|
+
/**
|
|
2435
|
+
* Channel aftertouch (channel pressure).
|
|
2436
|
+
*/
|
|
2437
|
+
readonly channelPressure: 112;
|
|
2438
|
+
/**
|
|
2439
|
+
* Pitch bend.
|
|
2440
|
+
*/
|
|
2441
|
+
readonly pitchBend: 113;
|
|
2442
|
+
};
|
|
2443
|
+
/**
|
|
2444
|
+
* @inheritDoc GSInsertionControlSources
|
|
2445
|
+
*
|
|
2446
|
+
* @group Synthesizer.GS Effects
|
|
2447
|
+
*/
|
|
2448
|
+
export type GSInsertionControlSource = (typeof GSInsertionControlSources)[keyof typeof GSInsertionControlSources];
|
|
2025
2449
|
/**
|
|
2026
2450
|
* Channel System Parameters are API-only parameters
|
|
2027
2451
|
* that affect a single MIDI channel.
|
|
@@ -2096,7 +2520,9 @@ interface ChannelSystemParameter {
|
|
|
2096
2520
|
*/
|
|
2097
2521
|
interpolationType: InterpolationType | null;
|
|
2098
2522
|
/**
|
|
2099
|
-
* If the channel should prevent changing
|
|
2523
|
+
* If the channel should prevent changing the part parameters via NRPN (MSB 0x01).
|
|
2524
|
+
* Drum, AWE32 and SF2 NRPNs are not affected.
|
|
2525
|
+
* The vibrato NRPNs are only locked when they control the custom vibrato.
|
|
2100
2526
|
*
|
|
2101
2527
|
* Overrides the global parameter if set.
|
|
2102
2528
|
*/
|
|
@@ -2104,7 +2530,7 @@ interface ChannelSystemParameter {
|
|
|
2104
2530
|
/**
|
|
2105
2531
|
* Indicates whether the channel is in monophonic retrigger mode.
|
|
2106
2532
|
* This emulates the behavior of Microsoft GS Wavetable Synth,
|
|
2107
|
-
*
|
|
2533
|
+
* where a new note will kill the previous one on the same key if it is still playing.
|
|
2108
2534
|
*
|
|
2109
2535
|
* Overrides the global parameter if set.
|
|
2110
2536
|
*/
|
|
@@ -2320,7 +2746,7 @@ export interface GSChorusProcessor extends GSChorusParameter {
|
|
|
2320
2746
|
*/
|
|
2321
2747
|
export interface GSDelayParameter extends GSSystemEffectParameter {
|
|
2322
2748
|
/**
|
|
2323
|
-
*
|
|
2749
|
+
* 1-115
|
|
2324
2750
|
* 0.1ms-340ms-1000ms
|
|
2325
2751
|
* The delay effect has three delay times; center, left and
|
|
2326
2752
|
* right (when listening in stereo). Delay Time Center sets the delay time of the delay
|
|
@@ -2329,7 +2755,7 @@ export interface GSDelayParameter extends GSSystemEffectParameter {
|
|
|
2329
2755
|
*/
|
|
2330
2756
|
timeCenter: number;
|
|
2331
2757
|
/**
|
|
2332
|
-
*
|
|
2758
|
+
* 1-120
|
|
2333
2759
|
* 4% - 500%
|
|
2334
2760
|
* This parameter sets the delay time of the delay located at the left as a percentage of
|
|
2335
2761
|
* the Delay Time Center (up to a max. of 1.0 s).
|
|
@@ -2451,6 +2877,35 @@ export interface GSInsertionParameter {
|
|
|
2451
2877
|
* Higher values result in more sound being sent.
|
|
2452
2878
|
*/
|
|
2453
2879
|
sendLevelToDelay: number;
|
|
2880
|
+
/**
|
|
2881
|
+
* `0-127`
|
|
2882
|
+
*
|
|
2883
|
+
* EFX control source 1: the controller that modulates the first controlled parameter of the type
|
|
2884
|
+
* (marked with `+` in the SC-8850 manual).
|
|
2885
|
+
* `1-95` selects a control change number, see {@link GSInsertionControlSources} for the others.
|
|
2886
|
+
* Only the parts with EFX assigned (see {@link ChannelMIDIParameter.efxAssign}) control it.
|
|
2887
|
+
*/
|
|
2888
|
+
controlSource1: number;
|
|
2889
|
+
/**
|
|
2890
|
+
* `0-127`
|
|
2891
|
+
*
|
|
2892
|
+
* EFX control depth 1: how far control source 1 moves its parameter,
|
|
2893
|
+
* from `0` (-100%) through `64` (0%) to `127` (+100%) of the full parameter range.
|
|
2894
|
+
*/
|
|
2895
|
+
controlDepth1: number;
|
|
2896
|
+
/**
|
|
2897
|
+
* `0-127`
|
|
2898
|
+
*
|
|
2899
|
+
* EFX control source 2: the controller that modulates the second controlled parameter of the type
|
|
2900
|
+
* (marked with `#` in the SC-8850 manual). See {@link controlSource1}.
|
|
2901
|
+
*/
|
|
2902
|
+
controlSource2: number;
|
|
2903
|
+
/**
|
|
2904
|
+
* `0-127`
|
|
2905
|
+
*
|
|
2906
|
+
* EFX control depth 2, see {@link controlDepth1}.
|
|
2907
|
+
*/
|
|
2908
|
+
controlDepth2: number;
|
|
2454
2909
|
}
|
|
2455
2910
|
/**
|
|
2456
2911
|
* A snapshot of a {@link GSInsertionBlock}.
|
|
@@ -2475,6 +2930,10 @@ export interface GSInsertionBlockSnapshot extends GSInsertionParameter {
|
|
|
2475
2930
|
* Value `255` means the parameter has not been changed since the type was set, so it uses the type default.
|
|
2476
2931
|
*/
|
|
2477
2932
|
params: Uint8Array;
|
|
2933
|
+
/**
|
|
2934
|
+
* The last controller values of the two EFX control sources (signed, pitch bend is centered at 0).
|
|
2935
|
+
*/
|
|
2936
|
+
controlValues: number[];
|
|
2478
2937
|
}
|
|
2479
2938
|
/**
|
|
2480
2939
|
* The Insertion effect (EFX) processes the parts (channels) that have EFX assigned
|
|
@@ -2504,6 +2963,7 @@ export interface GSInsertionBlock extends GSInsertionParameter {
|
|
|
2504
2963
|
* Sets the EFX type of the block.
|
|
2505
2964
|
*
|
|
2506
2965
|
* Type change resets the parameters and the send levels to their defaults.
|
|
2966
|
+
* The EFX control sources and depths are kept.
|
|
2507
2967
|
* Behavior for unsupported types is up to the implementation.
|
|
2508
2968
|
*
|
|
2509
2969
|
* @param type The 16-bit type value to use, `MSB << 8 | LSB`.
|
|
@@ -2515,7 +2975,7 @@ export interface GSInsertionBlock extends GSInsertionParameter {
|
|
|
2515
2975
|
*/
|
|
2516
2976
|
getType(): number;
|
|
2517
2977
|
/**
|
|
2518
|
-
* Resets this block to default values, including the EFX type and the
|
|
2978
|
+
* Resets this block to default values, including the EFX type, the send levels and the EFX control.
|
|
2519
2979
|
*/
|
|
2520
2980
|
reset(): void;
|
|
2521
2981
|
/**
|
|
@@ -2524,6 +2984,14 @@ export interface GSInsertionBlock extends GSInsertionParameter {
|
|
|
2524
2984
|
* @param value The 7-bit value.
|
|
2525
2985
|
*/
|
|
2526
2986
|
setParameter(param: number, value: number): void;
|
|
2987
|
+
/**
|
|
2988
|
+
* Passes a controller value of a part with EFX assigned (see {@link ChannelMIDIParameter.efxAssign})
|
|
2989
|
+
* for the EFX control sources ({@link controlSource1}, {@link controlSource2}).
|
|
2990
|
+
* @param source The controller, encoded like the control sources:
|
|
2991
|
+
* `1-95` a control change number, or a value of {@link GSInsertionControlSources}.
|
|
2992
|
+
* @param value The controller value: 7-bit, or 14-bit for {@link GSInsertionControlSources.pitchBend}.
|
|
2993
|
+
*/
|
|
2994
|
+
setControllerValue(source: number, value: number): void;
|
|
2527
2995
|
/**
|
|
2528
2996
|
* Process the effect and **adds** it to the output.
|
|
2529
2997
|
* @param inputLeft The left input buffer to process. It always starts at index 0.
|
|
@@ -2571,7 +3039,7 @@ export interface XGEffectBlockSnapshot {
|
|
|
2571
3039
|
*
|
|
2572
3040
|
* It represents a single effect block.
|
|
2573
3041
|
*
|
|
2574
|
-
* There are 4 effect
|
|
3042
|
+
* There are 4 effect block types in XG:
|
|
2575
3043
|
* - Reverb
|
|
2576
3044
|
* - Chorus
|
|
2577
3045
|
* - Variation
|
|
@@ -2651,7 +3119,14 @@ export interface XGSystemEffectBlockSnapshot extends XGSystemEffectParameter, XG
|
|
|
2651
3119
|
* @group Synthesizer.XG Effects
|
|
2652
3120
|
*/
|
|
2653
3121
|
export interface XGSystemEffectBlock extends XGEffectBlock, XGSystemEffectParameter {
|
|
3122
|
+
/**
|
|
3123
|
+
* Gets a snapshot of this XG effect block.
|
|
3124
|
+
*/
|
|
2654
3125
|
getSnapshot(): XGSystemEffectBlockSnapshot;
|
|
3126
|
+
/**
|
|
3127
|
+
* Restores this XG effect block from a snapshot.
|
|
3128
|
+
* @param snapshot The snapshot to restore.
|
|
3129
|
+
*/
|
|
2655
3130
|
applySnapshot(snapshot: XGSystemEffectBlockSnapshot): void;
|
|
2656
3131
|
}
|
|
2657
3132
|
/**
|
|
@@ -2733,13 +3208,20 @@ export interface XGChorusBlock extends XGSystemEffectBlock, XGChorusParameter {
|
|
|
2733
3208
|
* @param inputRight The input buffer to process. It always starts at index 0.
|
|
2734
3209
|
* @param outputLeft The left output buffer.
|
|
2735
3210
|
* @param outputRight The right output buffer.
|
|
2736
|
-
* @param reverbLeft The left reverb send buffer.
|
|
2737
|
-
* @param reverbRight The right reverb send buffer.
|
|
3211
|
+
* @param reverbLeft The left reverb send buffer. It always starts at index 0.
|
|
3212
|
+
* @param reverbRight The right reverb send buffer. It always starts at index 0.
|
|
2738
3213
|
* @param startIndex The index to start mixing at into the output buffers.
|
|
2739
3214
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
2740
3215
|
*/
|
|
2741
3216
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
3217
|
+
/**
|
|
3218
|
+
* Gets a snapshot of this XG effect block.
|
|
3219
|
+
*/
|
|
2742
3220
|
getSnapshot(): XGChorusBlockSnapshot;
|
|
3221
|
+
/**
|
|
3222
|
+
* Restores this XG effect block from a snapshot.
|
|
3223
|
+
* @param snapshot The snapshot to restore.
|
|
3224
|
+
*/
|
|
2743
3225
|
applySnapshot(snapshot: XGChorusBlockSnapshot): void;
|
|
2744
3226
|
}
|
|
2745
3227
|
/**
|
|
@@ -2751,7 +3233,7 @@ export interface XGInsertionParameter {
|
|
|
2751
3233
|
/**
|
|
2752
3234
|
* The channel routed through the insertion effect, 0-based.
|
|
2753
3235
|
*
|
|
2754
|
-
* 127 or
|
|
3236
|
+
* 127 or any value that's not below the current channel count means OFF.
|
|
2755
3237
|
*/
|
|
2756
3238
|
partNumber: number;
|
|
2757
3239
|
}
|
|
@@ -2796,7 +3278,14 @@ export interface XGInsertionBlock extends XGInsertionParameter, XGEffectBlock {
|
|
|
2796
3278
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
2797
3279
|
*/
|
|
2798
3280
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
3281
|
+
/**
|
|
3282
|
+
* Gets a snapshot of this XG effect block.
|
|
3283
|
+
*/
|
|
2799
3284
|
getSnapshot(): XGInsertionBlockSnapshot;
|
|
3285
|
+
/**
|
|
3286
|
+
* Restores this XG effect block from a snapshot.
|
|
3287
|
+
* @param snapshot The snapshot to restore.
|
|
3288
|
+
*/
|
|
2800
3289
|
applySnapshot(snapshot: XGInsertionBlockSnapshot): void;
|
|
2801
3290
|
}
|
|
2802
3291
|
/**
|
|
@@ -2809,7 +3298,7 @@ export interface XGVariationParameter extends XGSystemEffectParameter, XGInserti
|
|
|
2809
3298
|
* Indicates if variation is in the insertion mode (CONNECTION).
|
|
2810
3299
|
* If `false`, then variation is in the `system` mode.
|
|
2811
3300
|
*
|
|
2812
|
-
* The two connection modes work as
|
|
3301
|
+
* The two connection modes work as follows:
|
|
2813
3302
|
* - `system` routes all channels via sends (like reverb and chorus).
|
|
2814
3303
|
* - `insertion` routes a single `partNumber` channel straight through. Note that variation is processed last, after all insertion effects.
|
|
2815
3304
|
*/
|
|
@@ -2885,7 +3374,14 @@ export interface XGVariationBlock extends XGVariationParameter, XGSystemEffectBl
|
|
|
2885
3374
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
2886
3375
|
*/
|
|
2887
3376
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, chorusLeft: Float32Array, chorusRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
3377
|
+
/**
|
|
3378
|
+
* Gets a snapshot of this XG effect block.
|
|
3379
|
+
*/
|
|
2888
3380
|
getSnapshot(): XGVariationBlockSnapshot;
|
|
3381
|
+
/**
|
|
3382
|
+
* Restores this XG effect block from a snapshot.
|
|
3383
|
+
* @param snapshot The snapshot to restore.
|
|
3384
|
+
*/
|
|
2889
3385
|
applySnapshot(snapshot: XGVariationBlockSnapshot): void;
|
|
2890
3386
|
}
|
|
2891
3387
|
/**
|
|
@@ -2936,7 +3432,7 @@ interface GlobalSystemParameter {
|
|
|
2936
3432
|
* The reverb effect gain.
|
|
2937
3433
|
* From 0 to any number. 1 is 100% reverb.
|
|
2938
3434
|
*
|
|
2939
|
-
* Applies to both GS and XG reverb.
|
|
3435
|
+
* Applies to both GS and XG reverb, including XG parts with an insertion effect assigned.
|
|
2940
3436
|
*/
|
|
2941
3437
|
reverbGain: number;
|
|
2942
3438
|
/**
|
|
@@ -2957,7 +3453,7 @@ interface GlobalSystemParameter {
|
|
|
2957
3453
|
* The chorus effect gain.
|
|
2958
3454
|
* From 0 to any number. 1 is 100% chorus.
|
|
2959
3455
|
*
|
|
2960
|
-
* Applies to both GS and XG chorus.
|
|
3456
|
+
* Applies to both GS and XG chorus, including XG parts with an insertion effect assigned.
|
|
2961
3457
|
*/
|
|
2962
3458
|
chorusGain: number;
|
|
2963
3459
|
/**
|
|
@@ -3085,7 +3581,11 @@ interface GlobalSystemParameter {
|
|
|
3085
3581
|
*/
|
|
3086
3582
|
interpolationType: InterpolationType;
|
|
3087
3583
|
/**
|
|
3088
|
-
* If the synthesizer should prevent changing
|
|
3584
|
+
* If the synthesizer should prevent changing the part parameters via NRPN (MSB 0x01).
|
|
3585
|
+
* Drum, AWE32 and SF2 NRPNs are not affected.
|
|
3586
|
+
* The vibrato NRPNs are only locked when they control the custom vibrato.
|
|
3587
|
+
*
|
|
3588
|
+
* Channels can override it with {@link ChannelSystemParameter.nrpnParamLock}.
|
|
3089
3589
|
*/
|
|
3090
3590
|
nrpnParamLock: boolean;
|
|
3091
3591
|
/**
|
|
@@ -3164,6 +3664,15 @@ export declare class SoundBankManager {
|
|
|
3164
3664
|
* @param bankOffset The bank offset of the sound bank. Offsets the bank MSB value of all presets in this sound bank.
|
|
3165
3665
|
*/
|
|
3166
3666
|
addSoundBank(bank: BasicSoundBank, id: string, bankOffset?: number): void;
|
|
3667
|
+
/**
|
|
3668
|
+
* Rebuilds the preset list from the current sound banks.
|
|
3669
|
+
* Call it after editing a sound bank that is already added,
|
|
3670
|
+
* for example after adding, removing or renumbering presets.
|
|
3671
|
+
*
|
|
3672
|
+
* The synthesizer then updates its channels to the new presets without resetting,
|
|
3673
|
+
* see {@link SpessaSynthProcessor.refreshPresets}.
|
|
3674
|
+
*/
|
|
3675
|
+
refresh(): void;
|
|
3167
3676
|
private generatePresetList;
|
|
3168
3677
|
}
|
|
3169
3678
|
/**
|
|
@@ -3562,6 +4071,11 @@ export declare class SpessaSynthProcessor {
|
|
|
3562
4071
|
* Current total amount of voices that are playing.
|
|
3563
4072
|
*/
|
|
3564
4073
|
get voiceCount(): number;
|
|
4074
|
+
/**
|
|
4075
|
+
* The decoded sample data kept under {@link SynthProcessorOptions.decodedSampleBudget}, in bytes.
|
|
4076
|
+
* It is only counted when a budget is set.
|
|
4077
|
+
*/
|
|
4078
|
+
get decodedSampleBytes(): number;
|
|
3565
4079
|
/**
|
|
3566
4080
|
* Locks or unlocks a given {@link GlobalMIDIParameter}.
|
|
3567
4081
|
* This prevents any changes to it until it's unlocked.
|
|
@@ -3577,7 +4091,7 @@ export declare class SpessaSynthProcessor {
|
|
|
3577
4091
|
setSystemParameter<P extends keyof GlobalSystemParameter>(parameter: P, value: GlobalSystemParameter[P]): void;
|
|
3578
4092
|
/**
|
|
3579
4093
|
* A handler for missing presets during program change.
|
|
3580
|
-
* By default, it warns to console.
|
|
4094
|
+
* By default, it warns to console, unless no sound bank has been added yet.
|
|
3581
4095
|
* It may be useful for allowing the synthesizer to work without any sound banks.
|
|
3582
4096
|
* @param patch The MIDI patch that was requested.
|
|
3583
4097
|
* @param system The MIDI System for the request.
|
|
@@ -3592,7 +4106,7 @@ export declare class SpessaSynthProcessor {
|
|
|
3592
4106
|
* > Refer to the [MIDI Implementation](../../docs/extra/midi-implementation.md)
|
|
3593
4107
|
* > for the list of supported System Exclusives.
|
|
3594
4108
|
*
|
|
3595
|
-
* @param syx The system exclusive message as an array of bytes.
|
|
4109
|
+
* @param syx The system exclusive message as an array of bytes, without the starting `F0` byte.
|
|
3596
4110
|
* @param channelOffset The channel offset for the message as they usually can only address the first 16 channels.
|
|
3597
4111
|
* For example, to send a system exclusive on channel 16,
|
|
3598
4112
|
* send a system exclusive for channel 0 and set an offset of 16.
|
|
@@ -3683,11 +4197,11 @@ export declare class SpessaSynthProcessor {
|
|
|
3683
4197
|
*/
|
|
3684
4198
|
processMessages(messages: (SysExAcceptedArray | MIDIMessage)[], channelOffset?: number, options?: SynthMethodOptions): void;
|
|
3685
4199
|
/**
|
|
3686
|
-
*
|
|
4200
|
+
* Destroy the synthesizer processor, clearing all channels and voices.
|
|
3687
4201
|
*
|
|
3688
|
-
*
|
|
3689
|
-
*
|
|
3690
|
-
*
|
|
4202
|
+
* > **Warning**
|
|
4203
|
+
* >
|
|
4204
|
+
* > This is irreversible, so use with caution.
|
|
3691
4205
|
*/
|
|
3692
4206
|
destroy(): void;
|
|
3693
4207
|
/**
|
|
@@ -3697,6 +4211,9 @@ export declare class SpessaSynthProcessor {
|
|
|
3697
4211
|
* >
|
|
3698
4212
|
* > This method overrides the existing System Parameters with the ones from the snapshot.
|
|
3699
4213
|
*
|
|
4214
|
+
* If this processor has more XG insertion blocks than the snapshot,
|
|
4215
|
+
* the blocks without snapshot data are reset to their defaults.
|
|
4216
|
+
*
|
|
3700
4217
|
* @param snapshot The snapshot to apply.
|
|
3701
4218
|
*/
|
|
3702
4219
|
applySnapshot(snapshot: SynthesizerSnapshot): void;
|
|
@@ -3743,6 +4260,20 @@ export declare class SpessaSynthProcessor {
|
|
|
3743
4260
|
* These shouldn't be added to the `left` and `right` outputs. Recommended use-case is visualization.
|
|
3744
4261
|
*/
|
|
3745
4262
|
process(left: Float32Array, right: Float32Array, startIndex?: number, sampleCount?: number, channelOutputs?: Float32Array[][]): void;
|
|
4263
|
+
/**
|
|
4264
|
+
* Updates the synthesizer after the added sound banks were edited.
|
|
4265
|
+
* It rebuilds the preset list, clears the voice cache,
|
|
4266
|
+
* and points every channel at the current preset for its patch.
|
|
4267
|
+
*
|
|
4268
|
+
* Unlike adding a sound bank, this does not reset the synthesizer or send program changes,
|
|
4269
|
+
* so playback continues. Voices that are already playing keep the old data until they end.
|
|
4270
|
+
*
|
|
4271
|
+
* > **Tip**
|
|
4272
|
+
* >
|
|
4273
|
+
* > Call it after adding, removing or renumbering presets in a sound bank that is already added.
|
|
4274
|
+
* > For edits inside existing presets, {@link clearCache} is enough.
|
|
4275
|
+
*/
|
|
4276
|
+
refreshPresets(): void;
|
|
3746
4277
|
/**
|
|
3747
4278
|
* Clears the synthesizer's voice cache.
|
|
3748
4279
|
* This can be used to hear the changes after editing a {@link BasicSoundBank}
|
|
@@ -3883,7 +4414,7 @@ export type ChannelMIDIParameterMessage = { [P in keyof ChannelMIDIParameter]: {
|
|
|
3883
4414
|
channel: number;
|
|
3884
4415
|
}; }[keyof ChannelMIDIParameter];
|
|
3885
4416
|
/**
|
|
3886
|
-
* Represents an analyzed
|
|
4417
|
+
* Represents an analyzed GS Reverb Processor change.
|
|
3887
4418
|
*
|
|
3888
4419
|
* @group MIDI.Protocol
|
|
3889
4420
|
*/
|
|
@@ -3915,7 +4446,7 @@ export type GSReverbParameterMessage = { [P in keyof GSReverbParameter]: {
|
|
|
3915
4446
|
value: number;
|
|
3916
4447
|
};
|
|
3917
4448
|
/**
|
|
3918
|
-
* Represents an analyzed
|
|
4449
|
+
* Represents an analyzed GS Chorus Processor change.
|
|
3919
4450
|
*
|
|
3920
4451
|
* @group MIDI.Protocol
|
|
3921
4452
|
*/
|
|
@@ -3947,7 +4478,7 @@ export type GSChorusParameterMessage = { [P in keyof GSChorusParameter]: {
|
|
|
3947
4478
|
value: number;
|
|
3948
4479
|
};
|
|
3949
4480
|
/**
|
|
3950
|
-
* Represents an analyzed
|
|
4481
|
+
* Represents an analyzed GS Delay Processor change.
|
|
3951
4482
|
*
|
|
3952
4483
|
* @group MIDI.Protocol
|
|
3953
4484
|
*/
|
|
@@ -3979,7 +4510,7 @@ export type GSDelayParameterMessage = { [P in keyof GSDelayParameter]: {
|
|
|
3979
4510
|
value: number;
|
|
3980
4511
|
};
|
|
3981
4512
|
/**
|
|
3982
|
-
* Represents an analyzed
|
|
4513
|
+
* Represents an analyzed GS Insertion Processor change.
|
|
3983
4514
|
*
|
|
3984
4515
|
* @group MIDI.Protocol
|
|
3985
4516
|
*/
|
|
@@ -4002,9 +4533,9 @@ export type GSInsertionParameterMessage = {
|
|
|
4002
4533
|
*/
|
|
4003
4534
|
type: "GS Insertion Param";
|
|
4004
4535
|
/**
|
|
4005
|
-
* The parameter name that was modified in the processor.
|
|
4536
|
+
* The parameter name that was modified in the processor: a send level or an EFX control setting.
|
|
4006
4537
|
*/
|
|
4007
|
-
parameter:
|
|
4538
|
+
parameter: keyof GSInsertionParameter;
|
|
4008
4539
|
/**
|
|
4009
4540
|
* The new value of the parameter.
|
|
4010
4541
|
*/
|
|
@@ -4494,7 +5025,7 @@ export interface ControllerChangeEvent extends ChannelEvent {
|
|
|
4494
5025
|
}
|
|
4495
5026
|
/**
|
|
4496
5027
|
* This event is triggered when a MIDI polyphonic pressure event is received. This controls the pressure of a single note.
|
|
4497
|
-
*
|
|
5028
|
+
* It has no effect by default, it has to be assigned with sound bank modulators or system exclusives.
|
|
4498
5029
|
*
|
|
4499
5030
|
* @group Synthesizer.Events
|
|
4500
5031
|
*/
|
|
@@ -4637,6 +5168,7 @@ export type EffectChangeEvent = {
|
|
|
4637
5168
|
* The parameter that was changed:
|
|
4638
5169
|
* - `"type"` - 16-bit effect type (`MSB << 8 | LSB`). Note that this resets the parameters and the send levels!
|
|
4639
5170
|
* - `"sendLevelToReverb" | "sendLevelToChorus" | "sendLevelToDelay"` - send levels (7-bit), see {@link GSInsertionParameter}.
|
|
5171
|
+
* - `"controlSource1" | "controlDepth1" | "controlSource2" | "controlDepth2"` - EFX control (7-bit), see {@link GSInsertionParameter}.
|
|
4640
5172
|
* - `number` - 0-based type-specific EFX parameter index (0-19). EFX parameter 1 is 0. Value is 7-bit.
|
|
4641
5173
|
*/
|
|
4642
5174
|
parameter: "type" | keyof GSInsertionParameter | number;
|
|
@@ -4769,12 +5301,11 @@ export type UserDrumSetChangeEvent = { [P in keyof UserDrumSetParameter]: {
|
|
|
4769
5301
|
* | `noteOff` | {@link NoteOffEvent} | Key has been released. |
|
|
4770
5302
|
* | `controllerChange` | {@link ControllerChangeEvent} | Controller has been changed. |
|
|
4771
5303
|
* | `programChange` | {@link ProgramChangeEvent} | Program has been changed. |
|
|
4772
|
-
* | `
|
|
4773
|
-
* | `polyPressure` | {@link PolyPressureEvent} | Note's pressure has been changed. |
|
|
5304
|
+
* | `polyPressure` | {@link PolyPressureEvent} | Note's pressure has been changed. |
|
|
4774
5305
|
* | `stopAll` | {@link StopAllEvent} | All voices were stopped on a given channel. |
|
|
4775
5306
|
* | `channelAdded` | — | A new channel was added to the synth. |
|
|
4776
5307
|
* | `presetListChange` | — | The preset list has been changed/initialized. |
|
|
4777
|
-
* | `reset` | — | The synthesizer
|
|
5308
|
+
* | `reset` | — | The synthesizer is about to be reset. |
|
|
4778
5309
|
* | `displayMessage` | — | The synthesizer has received a display message. |
|
|
4779
5310
|
* | `globalParamChange` | {@link GlobalMIDIParameterChangeEvent} | A global MIDI Parameter has been changed. |
|
|
4780
5311
|
* | `channelParamChange` | {@link ChannelMIDIParameterChangeEvent} | A channel MIDI Parameter has been changed. |
|
|
@@ -4787,6 +5318,11 @@ export type UserDrumSetChangeEvent = { [P in keyof UserDrumSetParameter]: {
|
|
|
4787
5318
|
* > It automatically combines the sound banks and sends the list of presets as they will be played.
|
|
4788
5319
|
* > It also signals that the sound bank has been fully loaded.
|
|
4789
5320
|
*
|
|
5321
|
+
* > **Note**
|
|
5322
|
+
* >
|
|
5323
|
+
* > There is no separate channel pressure event.
|
|
5324
|
+
* > Channel pressure changes are reported as `channelParamChange` with the `pressure` parameter.
|
|
5325
|
+
*
|
|
4790
5326
|
* @group Synthesizer.Events
|
|
4791
5327
|
*/
|
|
4792
5328
|
export interface SynthesizerEvent {
|
|
@@ -4800,7 +5336,7 @@ export interface SynthesizerEvent {
|
|
|
4800
5336
|
noteOff: NoteOffEvent;
|
|
4801
5337
|
/**
|
|
4802
5338
|
* This event is triggered when a controller is changed on any channel (usually MIDI controller change),
|
|
4803
|
-
* though
|
|
5339
|
+
* though [some system exclusives can change it too.](../../docs/extra/midi-implementation.md)
|
|
4804
5340
|
*
|
|
4805
5341
|
* > **Note**
|
|
4806
5342
|
* >
|
|
@@ -4819,7 +5355,7 @@ export interface SynthesizerEvent {
|
|
|
4819
5355
|
programChange: ProgramChangeEvent;
|
|
4820
5356
|
/**
|
|
4821
5357
|
* This event is triggered when a MIDI polyphonic pressure event is received. This controls the pressure of a single note.
|
|
4822
|
-
*
|
|
5358
|
+
* It has no effect by default, it has to be assigned with sound bank modulators or system exclusives.
|
|
4823
5359
|
*/
|
|
4824
5360
|
polyPressure: PolyPressureEvent;
|
|
4825
5361
|
/**
|
|
@@ -4852,9 +5388,10 @@ export interface SynthesizerEvent {
|
|
|
4852
5388
|
*/
|
|
4853
5389
|
presetListChange: MIDIPatchFull[];
|
|
4854
5390
|
/**
|
|
4855
|
-
* This event is triggered when all controllers and programs
|
|
5391
|
+
* This event is triggered when the synthesizer is about to be reset (all controllers and programs). Effectively a system reset.
|
|
5392
|
+
* It is called before anything is reset, so the synthesizer still has its old state at that point.
|
|
4856
5393
|
*
|
|
4857
|
-
* The data is the new system the synthesizer
|
|
5394
|
+
* The data is the new system the synthesizer will be reset to.
|
|
4858
5395
|
*
|
|
4859
5396
|
* > **Note**
|
|
4860
5397
|
* >
|
|
@@ -4868,9 +5405,10 @@ export interface SynthesizerEvent {
|
|
|
4868
5405
|
*
|
|
4869
5406
|
* Notable messages that can trigger this event:
|
|
4870
5407
|
*
|
|
4871
|
-
* -
|
|
5408
|
+
* - GS Display Data (Model ID `0x45`) messages with the first address byte `0x10` or `0x20`
|
|
4872
5409
|
* - GS Patch Name
|
|
4873
5410
|
* - GS Drum Map Name
|
|
5411
|
+
* - GS User Drum Set Name
|
|
4874
5412
|
* - XG Display Letter
|
|
4875
5413
|
* - XG Display Bitmap
|
|
4876
5414
|
*
|
|
@@ -4985,6 +5523,8 @@ interface DefaultXGEffectProcessorConstructor {
|
|
|
4985
5523
|
export declare abstract class DefaultXGEffect implements XGEffectBlock {
|
|
4986
5524
|
/**
|
|
4987
5525
|
* The currently used processor.
|
|
5526
|
+
* Hidden from the docs as the processor types are internal.
|
|
5527
|
+
* @hidden
|
|
4988
5528
|
*/
|
|
4989
5529
|
protected processor: DefaultXGEffectProcessor;
|
|
4990
5530
|
protected readonly outputLeft: Float32Array<ArrayBuffer>;
|
|
@@ -5004,8 +5544,9 @@ export declare abstract class DefaultXGEffect implements XGEffectBlock {
|
|
|
5004
5544
|
* @param defaultType The default effect type.
|
|
5005
5545
|
* @param sampleRate The sample rate, in Hertz.
|
|
5006
5546
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5007
|
-
*
|
|
5547
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5008
5548
|
* @param variation True for the variation and insertion blocks.
|
|
5549
|
+
* @hidden
|
|
5009
5550
|
*/
|
|
5010
5551
|
protected constructor(effectMap: Map<number, DefaultXGEffectProcessorConstructor>, fallbackProcessor: DefaultXGEffectProcessorConstructor, defaultType: number, sampleRate: number, maxBufferSize: number, variation: boolean);
|
|
5011
5552
|
setType(type: number): void;
|
|
@@ -5028,8 +5569,18 @@ export declare abstract class DefaultXGEffect implements XGEffectBlock {
|
|
|
5028
5569
|
export declare abstract class DefaultXGSystemEffect extends DefaultXGEffect implements XGSystemEffectBlock {
|
|
5029
5570
|
return: number;
|
|
5030
5571
|
pan: number;
|
|
5572
|
+
/**
|
|
5573
|
+
* Resets this block to default values, including the processor type.
|
|
5574
|
+
*/
|
|
5031
5575
|
reset(): void;
|
|
5576
|
+
/**
|
|
5577
|
+
* Gets a snapshot of this XG effect block.
|
|
5578
|
+
*/
|
|
5032
5579
|
getSnapshot(): XGSystemEffectBlockSnapshot;
|
|
5580
|
+
/**
|
|
5581
|
+
* Restores this XG effect block from a snapshot.
|
|
5582
|
+
* @param snapshot The snapshot to restore.
|
|
5583
|
+
*/
|
|
5033
5584
|
applySnapshot(snapshot: XGSystemEffectBlockSnapshot): void;
|
|
5034
5585
|
/**
|
|
5035
5586
|
* Mixes the staged wet output into the system effect destination, applying return and pan.
|
|
@@ -5043,6 +5594,8 @@ export declare abstract class DefaultXGSystemEffect extends DefaultXGEffect impl
|
|
|
5043
5594
|
/**
|
|
5044
5595
|
* The default implementation for {@link XGReverbBlock}.
|
|
5045
5596
|
*
|
|
5597
|
+
* The default type is HALL 1. Unknown types use the type with LSB 0, or NO EFFECT (silence) if that is missing too.
|
|
5598
|
+
*
|
|
5046
5599
|
* @group Synthesizer.XG Effects
|
|
5047
5600
|
* @sealed
|
|
5048
5601
|
*/
|
|
@@ -5051,7 +5604,7 @@ export declare class DefaultXGReverb extends DefaultXGSystemEffect implements XG
|
|
|
5051
5604
|
* Constructs a new default XG reverb processor.
|
|
5052
5605
|
* @param sampleRate The sample rate, in Hertz.
|
|
5053
5606
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5054
|
-
*
|
|
5607
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5055
5608
|
*/
|
|
5056
5609
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5057
5610
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
@@ -5059,6 +5612,8 @@ export declare class DefaultXGReverb extends DefaultXGSystemEffect implements XG
|
|
|
5059
5612
|
/**
|
|
5060
5613
|
* The default implementation for {@link XGChorusBlock}.
|
|
5061
5614
|
*
|
|
5615
|
+
* The default type is CHORUS 1. Unknown types use the type with LSB 0, or NO EFFECT (silence) if that is missing too.
|
|
5616
|
+
*
|
|
5062
5617
|
* @group Synthesizer.XG Effects
|
|
5063
5618
|
* @sealed
|
|
5064
5619
|
*/
|
|
@@ -5068,11 +5623,17 @@ export declare class DefaultXGChorus extends DefaultXGSystemEffect implements XG
|
|
|
5068
5623
|
* Constructs a new default XG chorus processor.
|
|
5069
5624
|
* @param sampleRate The sample rate, in Hertz.
|
|
5070
5625
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5071
|
-
*
|
|
5626
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5072
5627
|
*/
|
|
5073
5628
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5629
|
+
/**
|
|
5630
|
+
* Resets this block to default values, including the processor type.
|
|
5631
|
+
*/
|
|
5074
5632
|
reset(): void;
|
|
5075
5633
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
5634
|
+
/**
|
|
5635
|
+
* Gets a snapshot of this XG effect block.
|
|
5636
|
+
*/
|
|
5076
5637
|
getSnapshot(): {
|
|
5077
5638
|
sendToReverb: number;
|
|
5078
5639
|
return: number;
|
|
@@ -5080,11 +5641,18 @@ export declare class DefaultXGChorus extends DefaultXGSystemEffect implements XG
|
|
|
5080
5641
|
type: number;
|
|
5081
5642
|
params: Int16Array;
|
|
5082
5643
|
};
|
|
5644
|
+
/**
|
|
5645
|
+
* Restores this XG effect block from a snapshot.
|
|
5646
|
+
* @param snapshot The snapshot to restore.
|
|
5647
|
+
*/
|
|
5083
5648
|
applySnapshot(snapshot: XGChorusBlockSnapshot): void;
|
|
5084
5649
|
}
|
|
5085
5650
|
/**
|
|
5086
5651
|
* The default implementation for {@link XGVariationBlock}.
|
|
5087
5652
|
*
|
|
5653
|
+
* The default type is DELAY L,C,R in the insertion connection.
|
|
5654
|
+
* Unknown types use the type with LSB 0, or THRU if that is missing too.
|
|
5655
|
+
*
|
|
5088
5656
|
* @group Synthesizer.XG Effects
|
|
5089
5657
|
* @sealed
|
|
5090
5658
|
*/
|
|
@@ -5097,12 +5665,18 @@ export declare class DefaultXGVariation extends DefaultXGSystemEffect implements
|
|
|
5097
5665
|
* Constructs a new default XG variation processor.
|
|
5098
5666
|
* @param sampleRate The sample rate, in Hertz.
|
|
5099
5667
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5100
|
-
*
|
|
5668
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5101
5669
|
*/
|
|
5102
5670
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5671
|
+
/**
|
|
5672
|
+
* Resets this block to default values, including the processor type.
|
|
5673
|
+
*/
|
|
5103
5674
|
reset(): void;
|
|
5104
5675
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, chorusLeft: Float32Array, chorusRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
5105
5676
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
5677
|
+
/**
|
|
5678
|
+
* Gets a snapshot of this XG effect block.
|
|
5679
|
+
*/
|
|
5106
5680
|
getSnapshot(): {
|
|
5107
5681
|
insertionMode: boolean;
|
|
5108
5682
|
partNumber: number;
|
|
@@ -5113,11 +5687,19 @@ export declare class DefaultXGVariation extends DefaultXGSystemEffect implements
|
|
|
5113
5687
|
type: number;
|
|
5114
5688
|
params: Int16Array;
|
|
5115
5689
|
};
|
|
5690
|
+
/**
|
|
5691
|
+
* Restores this XG effect block from a snapshot.
|
|
5692
|
+
* @param snapshot The snapshot to restore.
|
|
5693
|
+
*/
|
|
5116
5694
|
applySnapshot(snapshot: XGVariationBlockSnapshot): void;
|
|
5117
5695
|
}
|
|
5118
5696
|
/**
|
|
5119
5697
|
* The default implementation for {@link XGInsertionBlock}.
|
|
5120
5698
|
*
|
|
5699
|
+
* The default type is DISTORTION. The EFFECT 2 types run on the same processors as the variation block types.
|
|
5700
|
+
* The early reflection types and PHASER 2 are variation only, so PHASER 2 falls back to PHASER 1 here.
|
|
5701
|
+
* Unknown types use the type with LSB 0, or THRU if that is missing too.
|
|
5702
|
+
*
|
|
5121
5703
|
* @group Synthesizer.XG Effects
|
|
5122
5704
|
* @sealed
|
|
5123
5705
|
*/
|
|
@@ -5127,16 +5709,26 @@ export declare class DefaultXGInsertion extends DefaultXGEffect implements XGIns
|
|
|
5127
5709
|
* Constructs a new default XG insertion processor.
|
|
5128
5710
|
* @param sampleRate The sample rate, in Hertz.
|
|
5129
5711
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5130
|
-
*
|
|
5712
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5131
5713
|
*/
|
|
5132
5714
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5715
|
+
/**
|
|
5716
|
+
* Resets this block to default values, including the processor type.
|
|
5717
|
+
*/
|
|
5133
5718
|
reset(): void;
|
|
5134
5719
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
5720
|
+
/**
|
|
5721
|
+
* Gets a snapshot of this XG effect block.
|
|
5722
|
+
*/
|
|
5135
5723
|
getSnapshot(): {
|
|
5136
5724
|
partNumber: number;
|
|
5137
5725
|
type: number;
|
|
5138
5726
|
params: Int16Array<ArrayBufferLike>;
|
|
5139
5727
|
};
|
|
5728
|
+
/**
|
|
5729
|
+
* Restores this XG effect block from a snapshot.
|
|
5730
|
+
* @param snapshot The snapshot to restore.
|
|
5731
|
+
*/
|
|
5140
5732
|
applySnapshot(snapshot: XGInsertionBlockSnapshot): void;
|
|
5141
5733
|
}
|
|
5142
5734
|
/**
|
|
@@ -5156,7 +5748,8 @@ export interface SoundBankManagerListEntry {
|
|
|
5156
5748
|
soundBank: BasicSoundBank;
|
|
5157
5749
|
/**
|
|
5158
5750
|
* The bank MSB offset for this sound bank.
|
|
5159
|
-
* This value will be added to all {@link BasicPreset.bankMSB} fields when resolving the preset list
|
|
5751
|
+
* This value will be added to all {@link BasicPreset.bankMSB} fields when resolving the preset list,
|
|
5752
|
+
* except for the XG drum banks (120 and 127). The result is capped at 127.
|
|
5160
5753
|
*/
|
|
5161
5754
|
bankOffset: number;
|
|
5162
5755
|
}
|
|
@@ -5177,6 +5770,18 @@ export interface SynthMethodOptions {
|
|
|
5177
5770
|
* @group Synthesizer.Options
|
|
5178
5771
|
*/
|
|
5179
5772
|
export interface SynthProcessorOptions {
|
|
5773
|
+
/**
|
|
5774
|
+
* The most decoded sample data the synthesizer keeps, in bytes.
|
|
5775
|
+
* When over it, the least recently played samples drop their decoded data and decode again when played.
|
|
5776
|
+
* Only samples that can decode again (loaded s16le or vorbis data) are dropped.
|
|
5777
|
+
* Defaults to Infinity, which keeps everything.
|
|
5778
|
+
*
|
|
5779
|
+
* > **Tip**
|
|
5780
|
+
* >
|
|
5781
|
+
* > Decoded data is 4 bytes per sample point, twice the size of 16-bit data.
|
|
5782
|
+
* > This helps with very large sound banks.
|
|
5783
|
+
*/
|
|
5784
|
+
decodedSampleBudget: number;
|
|
5180
5785
|
/**
|
|
5181
5786
|
* The maximum buffer size the synthesizer can render at once.
|
|
5182
5787
|
* Attempting to `.process()` more samples than this will result in an error.
|
|
@@ -5298,11 +5903,6 @@ export declare class MIDIChannel {
|
|
|
5298
5903
|
* The channel's number (0-based index).
|
|
5299
5904
|
*/
|
|
5300
5905
|
readonly channel: number;
|
|
5301
|
-
/**
|
|
5302
|
-
* If true, this skips sends as they all go through insertion.
|
|
5303
|
-
* Set by {@link SpessaSynthProcessor}.
|
|
5304
|
-
*/
|
|
5305
|
-
xgInsertionAssigned: boolean;
|
|
5306
5906
|
/**
|
|
5307
5907
|
* Current amount of voices that are playing on this channel.
|
|
5308
5908
|
*/
|
|
@@ -5464,7 +6064,7 @@ interface ChannelMIDIParameter {
|
|
|
5464
6064
|
randomPan: boolean;
|
|
5465
6065
|
/**
|
|
5466
6066
|
* Assign mode for the channel:
|
|
5467
|
-
* - `0` - A new note will kill the previous one if it is still playing.
|
|
6067
|
+
* - `0` - A new note will kill the previous one on the same key if it is still playing.
|
|
5468
6068
|
* - Any other value - A new note will not kill the previous notes (default).
|
|
5469
6069
|
*
|
|
5470
6070
|
* While GS and XG differentiate 1 (Limited Multi for GS/Multi for XG) and 2 (Full Multi for GS/Inst (for Drum)),
|
|
@@ -5727,7 +6327,7 @@ interface ModifyMIDIOptions {
|
|
|
5727
6327
|
* > **Note**
|
|
5728
6328
|
* >
|
|
5729
6329
|
* > By default, a meaningful GM reset (one with notes after it)
|
|
5730
|
-
* > is replaced with a GS reset. Set the `system` parameter to `gm`
|
|
6330
|
+
* > is replaced with a GS reset (or `fallbackReset`, if set). Set the `system` parameter to `gm`
|
|
5731
6331
|
* > to keep the GM reset (and replace all others with GM).
|
|
5732
6332
|
* > This is done to allow the bank selections and other parameters to work.
|
|
5733
6333
|
*/
|
|
@@ -5754,8 +6354,9 @@ interface ModifyMIDIOptions {
|
|
|
5754
6354
|
* The GS Insertion Effect parameters.
|
|
5755
6355
|
* - `"clear"` - all existing parameter change MIDI messages are cleared.
|
|
5756
6356
|
* - {@link GSInsertionBlockSnapshot} - clear + the new parameters are set via System Exclusive messages.
|
|
6357
|
+
* The controller values of the EFX control sources are not part of it, they come from the controllers.
|
|
5757
6358
|
*/
|
|
5758
|
-
gsInsertionParams?: ClearableParameter<GSInsertionBlockSnapshot
|
|
6359
|
+
gsInsertionParams?: ClearableParameter<Omit<GSInsertionBlockSnapshot, "controlValues">>;
|
|
5759
6360
|
/**
|
|
5760
6361
|
* The desired XG reverb parameters.
|
|
5761
6362
|
* - `"clear"` - all existing parameter change MIDI messages are removed.
|
|
@@ -5786,8 +6387,9 @@ interface ModifyMIDIOptions {
|
|
|
5786
6387
|
/**
|
|
5787
6388
|
* The system reset to add when the file contains no reset.
|
|
5788
6389
|
* Unlike `midiParams.system`, existing resets are left untouched.
|
|
5789
|
-
* Ignored when `midiParams.system` is set (it takes precedence)
|
|
5790
|
-
*
|
|
6390
|
+
* Ignored when `midiParams.system` is set (it takes precedence).
|
|
6391
|
+
* When `midiParams.system` is `"clear"`, no reset is added,
|
|
6392
|
+
* but this still selects the system the setup messages are written for.
|
|
5791
6393
|
* When unset, the added reset defaults to `"xg"`
|
|
5792
6394
|
* if only XG setups are requested, otherwise to `"gs"`.
|
|
5793
6395
|
*
|
|
@@ -5835,7 +6437,7 @@ export interface RMIDInfoData {
|
|
|
5835
6437
|
creationDate: Date;
|
|
5836
6438
|
/**
|
|
5837
6439
|
* The copyright string.
|
|
5838
|
-
* If not provided, `Created
|
|
6440
|
+
* If not provided, `Created using SpessaSynth` is used.
|
|
5839
6441
|
*/
|
|
5840
6442
|
copyright: string;
|
|
5841
6443
|
/**
|
|
@@ -5849,6 +6451,7 @@ export interface RMIDInfoData {
|
|
|
5849
6451
|
midiEncoding: string;
|
|
5850
6452
|
/**
|
|
5851
6453
|
* The software used to write the file.
|
|
6454
|
+
* If not provided, `SpessaSynth` is used.
|
|
5852
6455
|
*/
|
|
5853
6456
|
software: string;
|
|
5854
6457
|
/**
|
|
@@ -5857,6 +6460,8 @@ export interface RMIDInfoData {
|
|
|
5857
6460
|
subject: string;
|
|
5858
6461
|
}
|
|
5859
6462
|
/**
|
|
6463
|
+
* A single tempo change in a MIDI sequence.
|
|
6464
|
+
*
|
|
5860
6465
|
* @group MIDI.Sequence
|
|
5861
6466
|
*/
|
|
5862
6467
|
export interface TempoChange {
|
|
@@ -5890,7 +6495,7 @@ export interface MIDILoop {
|
|
|
5890
6495
|
* the start of the file to ensure that synthesizer is in the correct state.
|
|
5891
6496
|
* This is the default behavior.
|
|
5892
6497
|
*
|
|
5893
|
-
* Soft loop types are enabled for Touhou and
|
|
6498
|
+
* Soft loop types are enabled for Touhou loop points (CC 2 and CC 4) and RPG Maker loop points (CC 111).
|
|
5894
6499
|
*/
|
|
5895
6500
|
type: "soft" | "hard";
|
|
5896
6501
|
}
|
|
@@ -5904,7 +6509,9 @@ export interface MIDILoop {
|
|
|
5904
6509
|
*/
|
|
5905
6510
|
export type MIDIFormat = 0 | 1 | 2;
|
|
5906
6511
|
/**
|
|
5907
|
-
*
|
|
6512
|
+
* A single note's time and velocity, as returned by {@link BasicMIDI.getNoteTimes}.
|
|
6513
|
+
*
|
|
6514
|
+
* @group MIDI.Sequence
|
|
5908
6515
|
*/
|
|
5909
6516
|
export interface NoteTime {
|
|
5910
6517
|
/**
|
|
@@ -5941,8 +6548,10 @@ export interface RMIDIWriteOptions {
|
|
|
5941
6548
|
*
|
|
5942
6549
|
* > **Warning**
|
|
5943
6550
|
* >
|
|
5944
|
-
* >
|
|
6551
|
+
* > Writing always sets the info encoding to `utf-8`,
|
|
6552
|
+
* > since the default fields (such as the creation date) are always written.
|
|
5945
6553
|
* > This behavior is forced due to lack of support for other encodings by the `TextEncoder` class.
|
|
6554
|
+
* > Existing info chunks in another encoding (see {@link BasicMIDI.infoEncoding}) are re-encoded to UTF-8.
|
|
5946
6555
|
*
|
|
5947
6556
|
*/
|
|
5948
6557
|
metadata: Partial<Omit<RMIDInfoData, "infoEncoding">>;
|
|
@@ -5954,7 +6563,7 @@ export interface RMIDIWriteOptions {
|
|
|
5954
6563
|
/**
|
|
5955
6564
|
* The sound bank instance that `soundBankBinary` contains.
|
|
5956
6565
|
* Used for correcting bank and program changes when `correctBankOffset` is enabled.
|
|
5957
|
-
* If omitted,
|
|
6566
|
+
* If it is omitted, the correction is skipped and a warning is logged.
|
|
5958
6567
|
*/
|
|
5959
6568
|
soundBank?: BasicSoundBank;
|
|
5960
6569
|
}
|
|
@@ -5965,6 +6574,8 @@ export interface RMIDIWriteOptions {
|
|
|
5965
6574
|
*/
|
|
5966
6575
|
export type RMIDInfoFourCC = "INAM" | "IPRD" | "IALB" | "IART" | "IGNR" | "IPIC" | "ICOP" | "ICRD" | "ICRT" | "ICMT" | "IENG" | "ISFT" | "ISBJ" | "IENC" | "MENC" | "DBNK";
|
|
5967
6576
|
/**
|
|
6577
|
+
* A reference to an event in {@link BasicMIDI.timeline}, pointing at its track and its index in that track.
|
|
6578
|
+
*
|
|
5968
6579
|
* @group MIDI.Sequence
|
|
5969
6580
|
*/
|
|
5970
6581
|
export interface TimelineEvent {
|
|
@@ -6128,7 +6739,7 @@ export declare class MIDITrack {
|
|
|
6128
6739
|
*/
|
|
6129
6740
|
port: number;
|
|
6130
6741
|
/**
|
|
6131
|
-
* A set that contains the MIDI channel numbers
|
|
6742
|
+
* A set that contains the MIDI channel numbers (0-15) that have note on events in this track.
|
|
6132
6743
|
*/
|
|
6133
6744
|
channels: Set<number>;
|
|
6134
6745
|
/**
|
|
@@ -6148,7 +6759,7 @@ export declare class MIDITrack {
|
|
|
6148
6759
|
copyFrom(track: MIDITrack): void;
|
|
6149
6760
|
/**
|
|
6150
6761
|
* Adds events to the track.
|
|
6151
|
-
* @param index The index at which to add these
|
|
6762
|
+
* @param index The index at which to add these events.
|
|
6152
6763
|
* @param events The events to add.
|
|
6153
6764
|
*/
|
|
6154
6765
|
addEvents(index: number, ...events: MIDIMessage[]): void;
|
|
@@ -6277,7 +6888,8 @@ export declare class BasicMIDI {
|
|
|
6277
6888
|
* The loop points (in ticks) of the sequence, including both start and end points.
|
|
6278
6889
|
*
|
|
6279
6890
|
* If there's nothing detected, the loop will start from the first note on event and end will be the last voice message.
|
|
6280
|
-
* Current looping detection is: CC 2/4,
|
|
6891
|
+
* Current looping detection is: CC 2/4 (Touhou), CC 111 (RPG Maker), CC 116/117 and 118/119 (EMIDI/XMI)
|
|
6892
|
+
* and the "start", "loopStart" and "loopEnd" markers.
|
|
6281
6893
|
*/
|
|
6282
6894
|
loop: MIDILoop;
|
|
6283
6895
|
/**
|
|
@@ -6291,6 +6903,7 @@ export declare class BasicMIDI {
|
|
|
6291
6903
|
format: MIDIFormat;
|
|
6292
6904
|
/**
|
|
6293
6905
|
* The RMID (Resource-Interchangeable MIDI) info data, if the file is RMID formatted.
|
|
6906
|
+
* XMF metadata and converted tracker modules are stored here as well.
|
|
6294
6907
|
* Otherwise, this object is empty.
|
|
6295
6908
|
* Info type: Chunk data as a binary array.
|
|
6296
6909
|
*
|
|
@@ -6356,7 +6969,7 @@ export declare class BasicMIDI {
|
|
|
6356
6969
|
* This function reads the MIDI file format, extracts the header and track chunks,
|
|
6357
6970
|
* and populates the BasicMIDI instance with the parsed data.
|
|
6358
6971
|
* It supports Standard MIDI Files (SMF), RIFF MIDI (RMIDI), and Extensible Music Format (XMF).
|
|
6359
|
-
* It also handles embedded soundbanks in RMIDI files.
|
|
6972
|
+
* It also handles embedded soundbanks in RMIDI and XMF files.
|
|
6360
6973
|
* Tracker modules (ProTracker MOD, Fast Tracker 2 XM, Scream Tracker 3 S3M) are converted
|
|
6361
6974
|
* into MIDI with an embedded sound bank.
|
|
6362
6975
|
*/
|
|
@@ -6373,7 +6986,7 @@ export declare class BasicMIDI {
|
|
|
6373
6986
|
*/
|
|
6374
6987
|
static copyFrom(mid: BasicMIDI): BasicMIDI;
|
|
6375
6988
|
/**
|
|
6376
|
-
* Copies another instance this `BasicMIDI` instance, including track data.
|
|
6989
|
+
* Copies another instance into this `BasicMIDI` instance, including track data.
|
|
6377
6990
|
* @param mid The MIDI to copy.
|
|
6378
6991
|
*/
|
|
6379
6992
|
copyFrom(mid: BasicMIDI): void;
|
|
@@ -6405,7 +7018,7 @@ export declare class BasicMIDI {
|
|
|
6405
7018
|
getUsedProgramsAndKeys<T extends MIDIPatchFull>(soundbank: CallableSoundBank<T>): PresetsWithKeyCombinations<T>;
|
|
6406
7019
|
/**
|
|
6407
7020
|
* Preloads all voices for this sequence in a given {@link SpessaSynthProcessor}.
|
|
6408
|
-
* This caches all the needed voices for playing back this
|
|
7021
|
+
* This caches all the needed voices for playing back this sequence, resulting in a smooth playback.
|
|
6409
7022
|
* The sequencer calls this function by default when loading the songs. (it can be disabled: {@link SpessaSynthSequencer.preload}).
|
|
6410
7023
|
* @param synth The synthesizer to preload.
|
|
6411
7024
|
*/
|
|
@@ -6424,6 +7037,12 @@ export declare class BasicMIDI {
|
|
|
6424
7037
|
flush(sortEvents?: boolean): void;
|
|
6425
7038
|
/**
|
|
6426
7039
|
* Calculates all note times in seconds.
|
|
7040
|
+
*
|
|
7041
|
+
* > **Note**
|
|
7042
|
+
* >
|
|
7043
|
+
* > MIDI ports are ignored, so the channels of every port are merged into the 16 channels.
|
|
7044
|
+
* > For example, channel 1 of port 2 is returned as channel 1.
|
|
7045
|
+
*
|
|
6427
7046
|
* @param minDrumLength In seconds, represents the minimum allowed time for a drum note,
|
|
6428
7047
|
* since they sometimes have a length of 0.
|
|
6429
7048
|
* @returns An array of 16 channels, each channel containing its notes,
|
|
@@ -6472,7 +7091,7 @@ export declare class BasicMIDI {
|
|
|
6472
7091
|
*/
|
|
6473
7092
|
writeMIDI(): ArrayBuffer;
|
|
6474
7093
|
/**
|
|
6475
|
-
* Writes out an RMIDI file (MIDI + SF2).
|
|
7094
|
+
* Writes out an RMIDI file (MIDI + SF2 or DLS).
|
|
6476
7095
|
* [See more info about this format](https://github.com/spessasus/sf2-rmidi-specification#readme).
|
|
6477
7096
|
*
|
|
6478
7097
|
* Note that this method modifies the MIDI file in-place.
|
|
@@ -6481,11 +7100,16 @@ export declare class BasicMIDI {
|
|
|
6481
7100
|
* The method is called on a `BasicMIDI` instance;
|
|
6482
7101
|
* that instance is the MIDI file to embed.
|
|
6483
7102
|
*
|
|
7103
|
+
* > **Warning**
|
|
7104
|
+
* >
|
|
7105
|
+
* > Do not call in audioWorkletGlobalScope as it uses TextDecoder and TextEncoder.
|
|
7106
|
+
* > Bank offset correction (on by default) needs `soundBank`. Without it, the correction is skipped with a warning.
|
|
7107
|
+
*
|
|
6484
7108
|
* > **Tip**
|
|
6485
7109
|
* >
|
|
6486
7110
|
* > Use {@link BasicSoundBank.trim} to drastically reduce the file size.
|
|
6487
|
-
* >
|
|
6488
|
-
* > (using these
|
|
7111
|
+
* > Consider also using compression (like shown in example) to save even more space.
|
|
7112
|
+
* > (using both of these methods, I managed to shrink a 1GB sound bank into a 5MB RMIDI!)
|
|
6489
7113
|
*
|
|
6490
7114
|
* @param soundBankBinary The binary sound bank (SF2 or DLS) to embed into the file.
|
|
6491
7115
|
* @param configuration Extra options for writing the file.
|
|
@@ -6523,7 +7147,7 @@ export declare class BasicMIDI {
|
|
|
6523
7147
|
*
|
|
6524
7148
|
* // trim the soundfont
|
|
6525
7149
|
* soundBank.trim(midi.getUsedProgramsAndKeys(soundBank));
|
|
6526
|
-
* // write out with compression to save space
|
|
7150
|
+
* // write out with compression to save space
|
|
6527
7151
|
* await soundBank.setSampleFormat({
|
|
6528
7152
|
* format: "compressed",
|
|
6529
7153
|
* compressionFunction: SampleEncodingFunction // Remember to get your compression function
|
|
@@ -6559,6 +7183,8 @@ export declare class BasicMIDI {
|
|
|
6559
7183
|
* and inserts/deletes messages appropriately.
|
|
6560
7184
|
*
|
|
6561
7185
|
* This modifies the MIDI sequence _in-place_.
|
|
7186
|
+
*
|
|
7187
|
+
* @param opts The modifications to apply.
|
|
6562
7188
|
*/
|
|
6563
7189
|
modify(opts: Partial<ModifyMIDIOptions>): void;
|
|
6564
7190
|
/**
|
|
@@ -6566,8 +7192,10 @@ export declare class BasicMIDI {
|
|
|
6566
7192
|
* This means changing the programs and controllers if they are locked.
|
|
6567
7193
|
*
|
|
6568
7194
|
* For example, if channel 1 has locked preset on `Drawbar Organ`,
|
|
6569
|
-
* this will remove all program changes for channel 1 and add one
|
|
7195
|
+
* this will remove all program changes for channel 1 and add one before the channel's first note on
|
|
7196
|
+
* (and again after every system reset) to change the program to
|
|
6570
7197
|
* `Drawbar organ` (using bank MSB/LSB and program change).
|
|
7198
|
+
* Muted channels are removed from the sequence.
|
|
6571
7199
|
*
|
|
6572
7200
|
* > **Warning**
|
|
6573
7201
|
* >
|
|
@@ -6613,6 +7241,12 @@ export declare class BasicMIDI {
|
|
|
6613
7241
|
* > **Note**
|
|
6614
7242
|
* >
|
|
6615
7243
|
* > This sets the Info encoding to `utf-8`.
|
|
7244
|
+
* > Text chunks that are already present get re-encoded from their old encoding (IENC) to UTF-8,
|
|
7245
|
+
* > so they stay readable. Without IENC, they are assumed to be UTF-8 already, like {@link BasicMIDI.getRMIDInfo} does.
|
|
7246
|
+
*
|
|
7247
|
+
* > **Warning**
|
|
7248
|
+
* >
|
|
7249
|
+
* > Do not call in audioWorkletGlobalScope as it uses TextDecoder and TextEncoder.
|
|
6616
7250
|
*
|
|
6617
7251
|
* @param infoType The type to set.
|
|
6618
7252
|
* @param infoData The value to set it to.
|
|
@@ -6620,6 +7254,11 @@ export declare class BasicMIDI {
|
|
|
6620
7254
|
setRMIDInfo<K extends keyof RMIDInfoData>(infoType: K, infoData: RMIDInfoData[K]): void;
|
|
6621
7255
|
/**
|
|
6622
7256
|
* Gets a given chunk from the RMIDI information.
|
|
7257
|
+
*
|
|
7258
|
+
* > **Warning**
|
|
7259
|
+
* >
|
|
7260
|
+
* > Do not call in audioWorkletGlobalScope as it uses TextDecoder.
|
|
7261
|
+
*
|
|
6623
7262
|
* @param infoType The metadata type.
|
|
6624
7263
|
* @returns `string`, `Date`, `ArrayBuffer` or undefined if the info is not set.
|
|
6625
7264
|
*/
|
|
@@ -6633,7 +7272,7 @@ export declare class BasicMIDI {
|
|
|
6633
7272
|
* > if you are not editing the MIDI file in your loop.
|
|
6634
7273
|
* > It is usually a faster solution and allows custom loops.
|
|
6635
7274
|
*
|
|
6636
|
-
*
|
|
7275
|
+
* If the track data is being edited, remember to call {@link BasicMIDI.flush} after editing!
|
|
6637
7276
|
*
|
|
6638
7277
|
* @param callback The callback function to process each event.
|
|
6639
7278
|
*/
|
|
@@ -6667,11 +7306,13 @@ export interface MIDIBuilderOptions {
|
|
|
6667
7306
|
/**
|
|
6668
7307
|
* The MIDI file track format.
|
|
6669
7308
|
* Format 0 allows only one track while format 1 allows more than one.
|
|
6670
|
-
* Format 2 is very rare and
|
|
7309
|
+
* Format 2 is very rare and is not supported by the builder (an error is thrown).
|
|
7310
|
+
* Defaults to 0.
|
|
6671
7311
|
*/
|
|
6672
7312
|
format: MIDIFormat;
|
|
6673
7313
|
/**
|
|
6674
7314
|
* The MIDI file's name. Will be appended to the conductor (first) track and encoded with UTF-8.
|
|
7315
|
+
* Defaults to `Untitled song`.
|
|
6675
7316
|
*/
|
|
6676
7317
|
name: string;
|
|
6677
7318
|
}
|
|
@@ -6686,6 +7327,7 @@ export interface MIDIBuilderOptions {
|
|
|
6686
7327
|
* > **Warning**
|
|
6687
7328
|
* >
|
|
6688
7329
|
* > Remember to call {@link BasicMIDI.flush} after you're done building the file!
|
|
7330
|
+
* > Do not use in audioWorkletGlobalScope as it uses TextEncoder.
|
|
6689
7331
|
*
|
|
6690
7332
|
* @group MIDI.Files
|
|
6691
7333
|
*/
|
|
@@ -6829,7 +7471,7 @@ export declare class MIDIUtils {
|
|
|
6829
7471
|
* @param channel The MIDI channel number.
|
|
6830
7472
|
* @param rpn The 14-bit RPN number.
|
|
6831
7473
|
* @param value The 14-bit value for that number.
|
|
6832
|
-
* @returns The analysis result
|
|
7474
|
+
* @returns The analysis result of the message.
|
|
6833
7475
|
*/
|
|
6834
7476
|
static analyzeRPN(channel: number, rpn: number, value: number): AnalyzedParameter;
|
|
6835
7477
|
/**
|
|
@@ -6840,7 +7482,7 @@ export declare class MIDIUtils {
|
|
|
6840
7482
|
* @param value The 14-bit value for that number.
|
|
6841
7483
|
* @param drumPitchStep The drum pitch coarse resolution in semitones.
|
|
6842
7484
|
* 0.5 for GS (SC-88 and above), 1 for XG and the SC-55 drum map (bank LSB 1).
|
|
6843
|
-
* @returns The analysis result
|
|
7485
|
+
* @returns The analysis result of the message.
|
|
6844
7486
|
*/
|
|
6845
7487
|
static analyzeNRPN(channel: number, nrpn: number, value: number, drumPitchStep?: number): AnalyzedParameter;
|
|
6846
7488
|
/**
|
|
@@ -6876,7 +7518,7 @@ export declare class MIDIUtils {
|
|
|
6876
7518
|
/**
|
|
6877
7519
|
* Returns a MIDI event needed to set the given GS Insertion Parameter.
|
|
6878
7520
|
* @param ticks The MIDI tick time for the output event.
|
|
6879
|
-
* @param parameter The parameter to set: `"type"`, a send level name,
|
|
7521
|
+
* @param parameter The parameter to set: `"type"`, a send level or EFX control name (see {@link GSInsertionParameter}),
|
|
6880
7522
|
* or a 0-based effect-specific parameter number (0-19).
|
|
6881
7523
|
* @param value The value to set it to.
|
|
6882
7524
|
* @returns The {@link MIDIMessage} needed to set this GS Insertion Parameter.
|
|
@@ -7104,7 +7746,7 @@ export declare class DrumParameterUtils {
|
|
|
7104
7746
|
*/
|
|
7105
7747
|
static copyInto(source: DrumParameter, dest: DrumParameter): void;
|
|
7106
7748
|
/**
|
|
7107
|
-
* Checks if this
|
|
7749
|
+
* Checks if this drum parameter is the default.
|
|
7108
7750
|
* @param param the param to check.
|
|
7109
7751
|
* @param midiNote the MIDI note of this parameter.
|
|
7110
7752
|
*/
|
|
@@ -7162,7 +7804,11 @@ export interface SequencerEvent {
|
|
|
7162
7804
|
newTime: number;
|
|
7163
7805
|
};
|
|
7164
7806
|
/**
|
|
7165
|
-
* This event is called when the playback stops.
|
|
7807
|
+
* This event is called when the song finishes and the playback stops.
|
|
7808
|
+
* It is not called when pausing manually.
|
|
7809
|
+
*
|
|
7810
|
+
* With more than one song in the list, the sequencer moves on to the next song instead,
|
|
7811
|
+
* so this event is not called.
|
|
7166
7812
|
*/
|
|
7167
7813
|
songEnded: object;
|
|
7168
7814
|
/**
|
|
@@ -7170,7 +7816,8 @@ export interface SequencerEvent {
|
|
|
7170
7816
|
*/
|
|
7171
7817
|
songChange: {
|
|
7172
7818
|
/**
|
|
7173
|
-
* The
|
|
7819
|
+
* The new {@link SpessaSynthSequencer.songIndex}.
|
|
7820
|
+
* If shuffle mode is enabled, this is the index in the shuffled song list, not in {@link SpessaSynthSequencer.songs}.
|
|
7174
7821
|
*/
|
|
7175
7822
|
songIndex: number;
|
|
7176
7823
|
};
|
|
@@ -7476,7 +8123,7 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
7476
8123
|
* Constructs a new default GS reverb processor.
|
|
7477
8124
|
* @param sampleRate The sample rate, in Hertz.
|
|
7478
8125
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
7479
|
-
*
|
|
8126
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
7480
8127
|
*/
|
|
7481
8128
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
7482
8129
|
private _delayFeedback;
|
|
@@ -7498,12 +8145,12 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
7498
8145
|
get preLowpass(): number;
|
|
7499
8146
|
set preLowpass(value: number);
|
|
7500
8147
|
/**
|
|
7501
|
-
*
|
|
7502
|
-
* @param input 0
|
|
7503
|
-
* @param outputLeft
|
|
7504
|
-
* @param outputRight
|
|
7505
|
-
* @param startIndex
|
|
7506
|
-
* @param sampleCount
|
|
8148
|
+
* Process the effect and **adds** it to the output.
|
|
8149
|
+
* @param input The input buffer to process. It always starts at index 0.
|
|
8150
|
+
* @param outputLeft The left output buffer.
|
|
8151
|
+
* @param outputRight The right output buffer.
|
|
8152
|
+
* @param startIndex The index to start mixing at into the output buffers.
|
|
8153
|
+
* @param sampleCount The amount of samples to mix.
|
|
7507
8154
|
*/
|
|
7508
8155
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
7509
8156
|
getSnapshot(): GSReverbParameter;
|
|
@@ -7550,7 +8197,7 @@ export declare class DefaultGSChorus implements GSChorusProcessor {
|
|
|
7550
8197
|
* Constructs a new default GS chorus processor.
|
|
7551
8198
|
* @param sampleRate The sample rate, in Hertz.
|
|
7552
8199
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
7553
|
-
*
|
|
8200
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
7554
8201
|
*/
|
|
7555
8202
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
7556
8203
|
private _sendLevelToReverb;
|
|
@@ -7630,7 +8277,7 @@ export declare class DefaultGSDelay implements GSDelayProcessor {
|
|
|
7630
8277
|
* Constructs a new default GS delay processor.
|
|
7631
8278
|
* @param sampleRate The sample rate, in Hertz.
|
|
7632
8279
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
7633
|
-
*
|
|
8280
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
7634
8281
|
*/
|
|
7635
8282
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
7636
8283
|
private _sendLevelToReverb;
|
|
@@ -7688,6 +8335,14 @@ export declare class DefaultGSInsertion implements GSInsertionBlock {
|
|
|
7688
8335
|
sendLevelToReverb: number;
|
|
7689
8336
|
sendLevelToChorus: number;
|
|
7690
8337
|
sendLevelToDelay: number;
|
|
8338
|
+
controlSource1: number;
|
|
8339
|
+
controlDepth1: number;
|
|
8340
|
+
controlSource2: number;
|
|
8341
|
+
controlDepth2: number;
|
|
8342
|
+
/**
|
|
8343
|
+
* The last controller values of both control sources (signed, pitch bend is centered).
|
|
8344
|
+
*/
|
|
8345
|
+
private readonly controlValues;
|
|
7691
8346
|
/**
|
|
7692
8347
|
* The list of effects available in this block.
|
|
7693
8348
|
* Effect type: processor.
|
|
@@ -7722,16 +8377,21 @@ export declare class DefaultGSInsertion implements GSInsertionBlock {
|
|
|
7722
8377
|
* Constructs a new default GS insertion block.
|
|
7723
8378
|
* @param sampleRate The sample rate, in Hertz.
|
|
7724
8379
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
7725
|
-
*
|
|
8380
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
7726
8381
|
*/
|
|
7727
8382
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
7728
8383
|
setType(type: number): void;
|
|
7729
8384
|
getType(): number;
|
|
7730
8385
|
reset(): void;
|
|
8386
|
+
setControllerValue(source: number, value: number): void;
|
|
7731
8387
|
setParameter(param: number, value: number): void;
|
|
7732
8388
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputChorus: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
7733
8389
|
getSnapshot(): GSInsertionBlockSnapshot;
|
|
7734
8390
|
applySnapshot(snapshot: GSInsertionBlockSnapshot): void;
|
|
8391
|
+
/**
|
|
8392
|
+
* Sends the offsets of both control sources to the processor.
|
|
8393
|
+
*/
|
|
8394
|
+
private updateControl;
|
|
7735
8395
|
}
|
|
7736
8396
|
/**
|
|
7737
8397
|
* Synthesizer's default voice cap.
|
|
@@ -7777,6 +8437,82 @@ export declare const DEFAULT_MIDI_CONTROLLERS: Readonly<Int16Array>;
|
|
|
7777
8437
|
* @group Synthesizer.Drum Sets
|
|
7778
8438
|
*/
|
|
7779
8439
|
export declare const DEFAULT_DRUM_REVERB: Int8Array<ArrayBuffer>;
|
|
8440
|
+
/**
|
|
8441
|
+
* The default clone options, matching {@link BasicSoundBank.clonePreset} and the other clone methods:
|
|
8442
|
+
* every element with a name already in the bank is reused, and the copies are added to the bank.
|
|
8443
|
+
*
|
|
8444
|
+
* @group Sound Banks
|
|
8445
|
+
*/
|
|
8446
|
+
export declare const DEFAULT_SOUND_BANK_CLONE_OPTIONS: SoundBankCloneOptions;
|
|
8447
|
+
/**
|
|
8448
|
+
* Clones presets, instruments and samples into a sound bank, as one session.
|
|
8449
|
+
* Elements copied once in a session are reused when something else in the session uses them again,
|
|
8450
|
+
* so an instrument used by two cloned presets is only copied once.
|
|
8451
|
+
* Stereo pairs are always cloned together.
|
|
8452
|
+
*
|
|
8453
|
+
* > **Tip**
|
|
8454
|
+
* >
|
|
8455
|
+
* > With `addToBank: false`, nothing is added to the bank. The new elements are listed in {@link created},
|
|
8456
|
+
* > in an order they can be added in (samples first, then instruments, then presets).
|
|
8457
|
+
* > Their zones still link to the children they use, like {@link BasicInstrument.createZone} does,
|
|
8458
|
+
* > so a reused child in the bank counts them as users.
|
|
8459
|
+
*
|
|
8460
|
+
* @group Sound Banks
|
|
8461
|
+
*/
|
|
8462
|
+
export declare class SoundBankCloner {
|
|
8463
|
+
/**
|
|
8464
|
+
* The new elements this session made, in the order they were made. Reused elements are not listed.
|
|
8465
|
+
*/
|
|
8466
|
+
readonly created: {
|
|
8467
|
+
samples: BasicSample[];
|
|
8468
|
+
instruments: BasicInstrument[];
|
|
8469
|
+
presets: BasicPreset[];
|
|
8470
|
+
};
|
|
8471
|
+
/**
|
|
8472
|
+
* The bank the elements are cloned into.
|
|
8473
|
+
*/
|
|
8474
|
+
readonly bank: BasicSoundBank;
|
|
8475
|
+
/**
|
|
8476
|
+
* The options of this session.
|
|
8477
|
+
*/
|
|
8478
|
+
readonly options: SoundBankCloneOptions;
|
|
8479
|
+
private readonly sampleClones;
|
|
8480
|
+
private readonly instrumentClones;
|
|
8481
|
+
/**
|
|
8482
|
+
* Creates a new clone session.
|
|
8483
|
+
* @param bank The bank to clone elements into.
|
|
8484
|
+
* @param options The options for this session.
|
|
8485
|
+
*/
|
|
8486
|
+
constructor(bank: BasicSoundBank, options?: Partial<SoundBankCloneOptions>);
|
|
8487
|
+
/**
|
|
8488
|
+
* Clones a sample and its stereo partner.
|
|
8489
|
+
* The data is shared with the original, not copied.
|
|
8490
|
+
* @param sample The sample to clone.
|
|
8491
|
+
* @returns The clone, or the existing sample with the same name if it is reused.
|
|
8492
|
+
*/
|
|
8493
|
+
cloneSample(sample: BasicSample): BasicSample;
|
|
8494
|
+
/**
|
|
8495
|
+
* Clones an instrument and the samples it uses.
|
|
8496
|
+
* @param instrument The instrument to clone.
|
|
8497
|
+
* @returns The clone, or the existing instrument with the same name if it is reused.
|
|
8498
|
+
*/
|
|
8499
|
+
cloneInstrument(instrument: BasicInstrument): BasicInstrument;
|
|
8500
|
+
/**
|
|
8501
|
+
* Clones a preset and the instruments and samples it uses.
|
|
8502
|
+
* @param preset The preset to clone.
|
|
8503
|
+
* @returns The clone, or the existing preset with the same name if it is reused.
|
|
8504
|
+
*/
|
|
8505
|
+
clonePreset(preset: BasicPreset): BasicPreset;
|
|
8506
|
+
private copyInstrument;
|
|
8507
|
+
private copySample;
|
|
8508
|
+
private getFreeName;
|
|
8509
|
+
}
|
|
8510
|
+
/**
|
|
8511
|
+
* The default options for loading a sound bank: full loading with copied sample data.
|
|
8512
|
+
*
|
|
8513
|
+
* @group Sound Banks
|
|
8514
|
+
*/
|
|
8515
|
+
export declare const DEFAULT_SOUND_BANK_LOAD_OPTIONS: SoundBankLoadOptions;
|
|
7780
8516
|
/**
|
|
7781
8517
|
* A helper class for loading sound bank files as {@link BasicSoundBank} instances.
|
|
7782
8518
|
*
|
|
@@ -7786,9 +8522,10 @@ export declare class SoundBankLoader {
|
|
|
7786
8522
|
/**
|
|
7787
8523
|
* Loads a sound bank from a file buffer.
|
|
7788
8524
|
* @param buffer The binary file buffer to load.
|
|
8525
|
+
* @param options Options for loading the sample data.
|
|
7789
8526
|
* @returns The loaded sound bank.
|
|
7790
8527
|
*/
|
|
7791
|
-
static fromArrayBuffer(buffer: ArrayBuffer): BasicSoundBank;
|
|
8528
|
+
static fromArrayBuffer(buffer: ArrayBuffer, options?: Partial<SoundBankLoadOptions>): BasicSoundBank;
|
|
7792
8529
|
}
|
|
7793
|
-
export type { ChannelDrumModification, ChannelGenerators, ChannelMIDIParameter, ChannelModification, ChannelSnapshot, ChannelSystemParameter, ClearableParameter, FourCC, GenericRIFFFourCC, GlobalMIDIParameter, GlobalSystemParameter, MIDIController, MIDIMessageType, ModifyMIDIOptions, SynthesizerSnapshot, UserDrumModification, WAVFourCC };
|
|
8530
|
+
export type { ChannelDrumModification, ChannelGenerators, ChannelMIDIParameter, ChannelModification, ChannelSnapshot, ChannelSystemParameter, ClearableParameter, FourCC, GenericRIFFFourCC, GlobalMIDIParameter, GlobalSystemParameter, LinkableZoneChild, MIDIController, MIDIMessageType, ModifyMIDIOptions, SynthesizerSnapshot, UserDrumModification, WAVFourCC };
|
|
7794
8531
|
//# sourceMappingURL=index.d.ts.map
|