spessasynth_core 4.4.5 → 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 +383 -125
- package/dist/index.js +795 -299
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -425,7 +426,7 @@ export declare const ModulatorControllerSources: {
|
|
|
425
426
|
*/
|
|
426
427
|
readonly pitchWheel: 14;
|
|
427
428
|
/**
|
|
428
|
-
* The current pitch wheel range (where 1 means
|
|
429
|
+
* The current pitch wheel range (where 1 means 128 semitones) on the channel.
|
|
429
430
|
*/
|
|
430
431
|
readonly pitchWheelRange: 16;
|
|
431
432
|
/**
|
|
@@ -454,7 +455,7 @@ export declare const ModulatorCurveTypes: {
|
|
|
454
455
|
*/
|
|
455
456
|
readonly concave: 1;
|
|
456
457
|
/**
|
|
457
|
-
*
|
|
458
|
+
* Exponential ramp, the inverse of concave.
|
|
458
459
|
*/
|
|
459
460
|
readonly convex: 2;
|
|
460
461
|
/**
|
|
@@ -506,7 +507,7 @@ export declare class ModulatorSource {
|
|
|
506
507
|
/**
|
|
507
508
|
* If this field is set true, the direction of the controller should be from the maximum value to the minimum value. So, for
|
|
508
509
|
* example, if the controller source is Key Number, then a Key Number value of 0 corresponds to the maximum possible
|
|
509
|
-
* 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.
|
|
510
511
|
*/
|
|
511
512
|
isNegative: boolean;
|
|
512
513
|
/**
|
|
@@ -787,12 +788,14 @@ export declare class MIDIPatchTools {
|
|
|
787
788
|
/**
|
|
788
789
|
* Converts a given {@link MIDIPatch} to a string.
|
|
789
790
|
* The format is:
|
|
790
|
-
* - `DRUM:program` for `isGMGSDrum` set to `true`.
|
|
791
|
+
* - `DRUM:bankMSB:bankLSB:program` for `isGMGSDrum` set to `true`.
|
|
791
792
|
* - `bankLSB:bankMSB:program` for `isGMGSDrum` set to `false`.
|
|
793
|
+
* @param patch The patch to convert.
|
|
792
794
|
*/
|
|
793
795
|
static toMIDIString(patch: MIDIPatch): string;
|
|
794
796
|
/**
|
|
795
797
|
* Gets {@link MIDIPatch} from a given string.
|
|
798
|
+
* @param string The string in the {@link MIDIPatchTools.toMIDIString} format.
|
|
796
799
|
*/
|
|
797
800
|
static fromMIDIString(string: string): MIDIPatch;
|
|
798
801
|
/**
|
|
@@ -800,23 +803,30 @@ export declare class MIDIPatchTools {
|
|
|
800
803
|
* The format is:
|
|
801
804
|
* - `<MIDIPatch string> D <name>` for `isDrum` set to `true`.
|
|
802
805
|
* - `<MIDIPatch string> M <name>` for `isDrum` set to `false`.
|
|
806
|
+
* @param patch The patch to convert.
|
|
803
807
|
*/
|
|
804
808
|
static toFullMIDIString(patch: MIDIPatchFull): string;
|
|
805
809
|
/**
|
|
806
810
|
* Gets {@link MIDIPatchFull} from a given string.
|
|
811
|
+
* @param string The string in the {@link MIDIPatchTools.toFullMIDIString} format.
|
|
807
812
|
*/
|
|
808
813
|
static fromFullMIDIString(string: string): MIDIPatchFull;
|
|
809
814
|
/**
|
|
810
815
|
* Checks if two MIDI patches represent the same one.
|
|
816
|
+
* @param patch1 The first patch.
|
|
817
|
+
* @param patch2 The second patch.
|
|
811
818
|
*/
|
|
812
819
|
static matches(patch1: MIDIPatch, patch2: MIDIPatch): boolean;
|
|
813
820
|
/**
|
|
814
821
|
* A comparison function for `.sort()` or `.toSorted()`,
|
|
815
|
-
* 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.
|
|
816
825
|
*/
|
|
817
826
|
static compare(a: MIDIPatch, b: MIDIPatch): number;
|
|
818
827
|
/**
|
|
819
828
|
* Checks if the given {@link MIDIPatchFull} is an XG/GM2 drum patch.
|
|
829
|
+
* @param p The patch to check.
|
|
820
830
|
*/
|
|
821
831
|
static isXGDrum(p: MIDIPatchFull): boolean;
|
|
822
832
|
/**
|
|
@@ -826,7 +836,7 @@ export declare class MIDIPatchTools {
|
|
|
826
836
|
* @param patch The {@link MIDIPatch} to select.
|
|
827
837
|
* @param system The MIDI system to select for.
|
|
828
838
|
* @returns The selected patch.
|
|
829
|
-
* @throws Error An error if the array is empty
|
|
839
|
+
* @throws Error An error if the array is empty.
|
|
830
840
|
*/
|
|
831
841
|
static selectPatch<T extends MIDIPatchFull>(patches: T[], patch: MIDIPatch, system: MIDISystem): T;
|
|
832
842
|
private static getAnyDrums;
|
|
@@ -956,7 +966,7 @@ export declare class BasicPreset implements MIDIPatchFull {
|
|
|
956
966
|
* >
|
|
957
967
|
* > Consider reading about [the DLS conversion problem](../../../docs/extra/dls-conversion-problem.md).
|
|
958
968
|
*
|
|
959
|
-
* @returns The instrument containing the flattened zones. If flattening was successful, it should exactly the same as this preset.
|
|
969
|
+
* @returns The instrument containing the flattened zones. If flattening was successful, it should sound exactly the same as this preset.
|
|
960
970
|
*/
|
|
961
971
|
toFlattenedInstrument(): BasicInstrument;
|
|
962
972
|
}
|
|
@@ -964,9 +974,8 @@ export declare class BasicPreset implements MIDIPatchFull {
|
|
|
964
974
|
* This module handles parsing and writing SoundFont2 (`.sf2`, `.sf3` and `.sfogg`) files.
|
|
965
975
|
* It represents a single sound bank.
|
|
966
976
|
*
|
|
967
|
-
* 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/).
|
|
968
978
|
*
|
|
969
|
-
|
|
970
979
|
* **Specifications:**
|
|
971
980
|
*
|
|
972
981
|
* - [SoundFont2 Specification](http://www.synthfont.com/sfspec24.pdf)
|
|
@@ -1001,7 +1010,7 @@ export declare class BasicSoundBank {
|
|
|
1001
1010
|
*/
|
|
1002
1011
|
soundBankInfo: SoundBankInfoData;
|
|
1003
1012
|
/**
|
|
1004
|
-
* 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.
|
|
1005
1014
|
*/
|
|
1006
1015
|
presets: BasicPreset[];
|
|
1007
1016
|
/**
|
|
@@ -1052,12 +1061,15 @@ export declare class BasicSoundBank {
|
|
|
1052
1061
|
*/
|
|
1053
1062
|
static mergeSoundBanks(...soundBanks: BasicSoundBank[]): BasicSoundBank;
|
|
1054
1063
|
/**
|
|
1055
|
-
* Creates a simple
|
|
1064
|
+
* Creates a simple SF2 file with a single saw wave preset.
|
|
1056
1065
|
* Useful for testing synthesizer's functionality without providing a file.
|
|
1066
|
+
* @returns The binary representation of the SF2 file.
|
|
1057
1067
|
*/
|
|
1058
1068
|
static getSampleSoundBankFile(): ArrayBuffer;
|
|
1059
1069
|
/**
|
|
1060
|
-
* 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`.
|
|
1061
1073
|
* @param bank The sound bank to copy.
|
|
1062
1074
|
*/
|
|
1063
1075
|
static copyFrom(bank: BasicSoundBank): BasicSoundBank;
|
|
@@ -1071,8 +1083,8 @@ export declare class BasicSoundBank {
|
|
|
1071
1083
|
*
|
|
1072
1084
|
* > **Warning**
|
|
1073
1085
|
* >
|
|
1074
|
-
* > Note that
|
|
1075
|
-
* > 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.
|
|
1076
1088
|
* > This method is memory and CPU intensive with large sound banks.
|
|
1077
1089
|
*
|
|
1078
1090
|
* @param options Options associated with setting the sample format.
|
|
@@ -1082,7 +1094,7 @@ export declare class BasicSoundBank {
|
|
|
1082
1094
|
setSampleFormat(options: SetSampleFormatOptions): Promise<BasicSample[]>;
|
|
1083
1095
|
/**
|
|
1084
1096
|
* Writes out a DLS Level 2 sound bank. This may not be 100% accurate.
|
|
1085
|
-
*
|
|
1097
|
+
* Sample data is always written in the S16LE PCM encoding.
|
|
1086
1098
|
*
|
|
1087
1099
|
* > **Note**
|
|
1088
1100
|
* >
|
|
@@ -1180,16 +1192,15 @@ export declare class BasicSoundBank {
|
|
|
1180
1192
|
/**
|
|
1181
1193
|
* Trims the sound bank _in-place_ to only contain samples in a given MIDI file.
|
|
1182
1194
|
*
|
|
1183
|
-
|
|
1184
1195
|
* Absent presets will be removed from the sound bank,
|
|
1185
1196
|
* and samples that don't get activated in the remaining presets will be removed as well.
|
|
1186
1197
|
*
|
|
1187
1198
|
* > **Note**
|
|
1188
1199
|
* >
|
|
1189
|
-
* > This exact type is returned from {@link BasicMIDI.getUsedProgramsAndKeys}
|
|
1200
|
+
* > This exact type is returned from {@link BasicMIDI.getUsedProgramsAndKeys}.
|
|
1190
1201
|
* > Consider reading the page for more explanation about the parameter.
|
|
1191
1202
|
*
|
|
1192
|
-
* @param presetData
|
|
1203
|
+
* @param presetData A `Map`: `BasicPreset` -> `Map<MIDI note, Set<velocity>>`.
|
|
1193
1204
|
* Absent presets will be removed from the sound bank,
|
|
1194
1205
|
* and samples that don't get activated in the remaining presets will be removed as well.
|
|
1195
1206
|
*/
|
|
@@ -1438,7 +1449,7 @@ export declare class BasicSample {
|
|
|
1438
1449
|
*
|
|
1439
1450
|
* > **Warning**
|
|
1440
1451
|
* >
|
|
1441
|
-
* > Do not change this value directly.
|
|
1452
|
+
* > Do not change this value directly. Use {@link BasicSample.setSampleType},
|
|
1442
1453
|
* > {@link BasicSample.setLinkedSample} or {@link BasicSample.unlinkSample} instead.
|
|
1443
1454
|
*/
|
|
1444
1455
|
sampleType: SampleType;
|
|
@@ -1500,7 +1511,7 @@ export declare class BasicSample {
|
|
|
1500
1511
|
* @param sampleRate The sample's rate in Hz.
|
|
1501
1512
|
* @param originalKey The sample's pitch as a MIDI note number.
|
|
1502
1513
|
* @param pitchCorrection The sample's pitch correction in cents.
|
|
1503
|
-
* @param sampleType The sample's type,
|
|
1514
|
+
* @param sampleType The sample's type, one of the {@link SampleTypes}.
|
|
1504
1515
|
* @param loopStart The sample's loop start relative to the sample start in sample points.
|
|
1505
1516
|
* @param loopEnd The sample's loop end relative to the sample start in sample points. Exclusive.
|
|
1506
1517
|
*/
|
|
@@ -1700,7 +1711,7 @@ export declare const MIDIMessageTypes: {
|
|
|
1700
1711
|
*/
|
|
1701
1712
|
type MIDIMessageType = (typeof MIDIMessageTypes)[keyof typeof MIDIMessageTypes];
|
|
1702
1713
|
/**
|
|
1703
|
-
* All MIDI 1.0 controller
|
|
1714
|
+
* All MIDI 1.0 controller numbers.
|
|
1704
1715
|
*
|
|
1705
1716
|
* > **Tip**
|
|
1706
1717
|
* >
|
|
@@ -1757,10 +1768,10 @@ export declare const MIDIControllers: {
|
|
|
1757
1768
|
readonly effectControl2LSB: 45;
|
|
1758
1769
|
readonly undefinedCC14LSB: 46;
|
|
1759
1770
|
readonly undefinedCC15LSB: 47;
|
|
1760
|
-
readonly
|
|
1761
|
-
readonly
|
|
1762
|
-
readonly
|
|
1763
|
-
readonly
|
|
1771
|
+
readonly generalPurposeController1LSB: 48;
|
|
1772
|
+
readonly generalPurposeController2LSB: 49;
|
|
1773
|
+
readonly generalPurposeController3LSB: 50;
|
|
1774
|
+
readonly generalPurposeController4LSB: 51;
|
|
1764
1775
|
readonly undefinedCC20LSB: 52;
|
|
1765
1776
|
readonly undefinedCC21LSB: 53;
|
|
1766
1777
|
readonly undefinedCC22LSB: 54;
|
|
@@ -1811,32 +1822,120 @@ export declare const MIDIControllers: {
|
|
|
1811
1822
|
readonly nonRegisteredParameterMSB: 99;
|
|
1812
1823
|
readonly registeredParameterLSB: 100;
|
|
1813
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
|
+
*/
|
|
1814
1870
|
readonly undefinedCC102LSB: 102;
|
|
1871
|
+
/**
|
|
1872
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC103} instead.
|
|
1873
|
+
*/
|
|
1815
1874
|
readonly undefinedCC103LSB: 103;
|
|
1875
|
+
/**
|
|
1876
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC104} instead.
|
|
1877
|
+
*/
|
|
1816
1878
|
readonly undefinedCC104LSB: 104;
|
|
1879
|
+
/**
|
|
1880
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC105} instead.
|
|
1881
|
+
*/
|
|
1817
1882
|
readonly undefinedCC105LSB: 105;
|
|
1883
|
+
/**
|
|
1884
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC106} instead.
|
|
1885
|
+
*/
|
|
1818
1886
|
readonly undefinedCC106LSB: 106;
|
|
1887
|
+
/**
|
|
1888
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC107} instead.
|
|
1889
|
+
*/
|
|
1819
1890
|
readonly undefinedCC107LSB: 107;
|
|
1891
|
+
/**
|
|
1892
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC108} instead.
|
|
1893
|
+
*/
|
|
1820
1894
|
readonly undefinedCC108LSB: 108;
|
|
1895
|
+
/**
|
|
1896
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC109} instead.
|
|
1897
|
+
*/
|
|
1821
1898
|
readonly undefinedCC109LSB: 109;
|
|
1899
|
+
/**
|
|
1900
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC110} instead.
|
|
1901
|
+
*/
|
|
1822
1902
|
readonly undefinedCC110LSB: 110;
|
|
1903
|
+
/**
|
|
1904
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC111} instead.
|
|
1905
|
+
*/
|
|
1823
1906
|
readonly undefinedCC111LSB: 111;
|
|
1907
|
+
/**
|
|
1908
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC112} instead.
|
|
1909
|
+
*/
|
|
1824
1910
|
readonly undefinedCC112LSB: 112;
|
|
1911
|
+
/**
|
|
1912
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC113} instead.
|
|
1913
|
+
*/
|
|
1825
1914
|
readonly undefinedCC113LSB: 113;
|
|
1915
|
+
/**
|
|
1916
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC114} instead.
|
|
1917
|
+
*/
|
|
1826
1918
|
readonly undefinedCC114LSB: 114;
|
|
1919
|
+
/**
|
|
1920
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC115} instead.
|
|
1921
|
+
*/
|
|
1827
1922
|
readonly undefinedCC115LSB: 115;
|
|
1923
|
+
/**
|
|
1924
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC116} instead.
|
|
1925
|
+
*/
|
|
1828
1926
|
readonly undefinedCC116LSB: 116;
|
|
1927
|
+
/**
|
|
1928
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC117} instead.
|
|
1929
|
+
*/
|
|
1829
1930
|
readonly undefinedCC117LSB: 117;
|
|
1931
|
+
/**
|
|
1932
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC118} instead.
|
|
1933
|
+
*/
|
|
1830
1934
|
readonly undefinedCC118LSB: 118;
|
|
1935
|
+
/**
|
|
1936
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC119} instead.
|
|
1937
|
+
*/
|
|
1831
1938
|
readonly undefinedCC119LSB: 119;
|
|
1832
|
-
readonly allSoundOff: 120;
|
|
1833
|
-
readonly resetAllControllers: 121;
|
|
1834
|
-
readonly localControlOnOff: 122;
|
|
1835
|
-
readonly allNotesOff: 123;
|
|
1836
|
-
readonly omniModeOff: 124;
|
|
1837
|
-
readonly omniModeOn: 125;
|
|
1838
|
-
readonly monoModeOn: 126;
|
|
1839
|
-
readonly polyModeOn: 127;
|
|
1840
1939
|
};
|
|
1841
1940
|
/**
|
|
1842
1941
|
* @inheritDoc MIDIControllers
|
|
@@ -2057,7 +2156,8 @@ export interface VoiceParameters {
|
|
|
2057
2156
|
* This function is used to compress/encode a {@link BasicSample}.
|
|
2058
2157
|
* The function is recommended to be asynchronous.
|
|
2059
2158
|
*
|
|
2060
|
-
*
|
|
2159
|
+
* > **Note**
|
|
2160
|
+
* >
|
|
2061
2161
|
* > Using a custom function allows for using *any* type of compression for the SF3 soundBank.
|
|
2062
2162
|
* > This is allowed by the [RFC describing SF3 spec](https://github.com/FluidSynth/fluidsynth/wiki/SoundFont3Format),
|
|
2063
2163
|
* > but SpessaSynth can only read Ogg Vorbis compression.
|
|
@@ -2099,7 +2199,7 @@ export type SetSampleFormatOptions = {
|
|
|
2099
2199
|
* - `pcm` - decompresses the sound bank and changes its version to `2.04` (SF2)
|
|
2100
2200
|
* - `compressed` - compresses the sound bank with a given function and changes its version to `3.0` (SF3)
|
|
2101
2201
|
*
|
|
2102
|
-
* Note that
|
|
2202
|
+
* Note that compressing usually results in permanent sample quality loss! Decompressing does not restore it.
|
|
2103
2203
|
*/
|
|
2104
2204
|
format: "pcm";
|
|
2105
2205
|
} | {
|
|
@@ -2108,7 +2208,7 @@ export type SetSampleFormatOptions = {
|
|
|
2108
2208
|
* - `pcm` - decompresses the sound bank and changes its version to `2.04` (SF2)
|
|
2109
2209
|
* - `compressed` - compresses the sound bank with a given function and changes its version to `3.0` (SF3)
|
|
2110
2210
|
*
|
|
2111
|
-
* Note that
|
|
2211
|
+
* Note that compressing usually results in permanent sample quality loss! Decompressing does not restore it.
|
|
2112
2212
|
*/
|
|
2113
2213
|
format: "compressed";
|
|
2114
2214
|
/**
|
|
@@ -2129,7 +2229,7 @@ export interface SoundBankWriteOptions {
|
|
|
2129
2229
|
*/
|
|
2130
2230
|
software: string;
|
|
2131
2231
|
/**
|
|
2132
|
-
* 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.
|
|
2133
2233
|
*/
|
|
2134
2234
|
progressFunction?: ProgressFunction;
|
|
2135
2235
|
}
|
|
@@ -2189,7 +2289,7 @@ export interface GenericRange {
|
|
|
2189
2289
|
* - Key: The MIDI note number.
|
|
2190
2290
|
* - Value: A set of all velocities this key was pressed with.
|
|
2191
2291
|
*
|
|
2192
|
-
* @group
|
|
2292
|
+
* @group Sound Banks
|
|
2193
2293
|
*/
|
|
2194
2294
|
export type PresetsWithKeyCombinations<T extends MIDIPatchFull> = Map<T, Map<number, Set<number>>>;
|
|
2195
2295
|
/**
|
|
@@ -2291,9 +2391,28 @@ export declare const InterpolationTypes: {
|
|
|
2291
2391
|
*/
|
|
2292
2392
|
readonly nearestNeighbor: 1;
|
|
2293
2393
|
/**
|
|
2294
|
-
*
|
|
2394
|
+
* Cubic Hermite interpolation. Good quality with little artifacting. (Default)
|
|
2395
|
+
*
|
|
2396
|
+
* Recommended for most use-cases.
|
|
2295
2397
|
*/
|
|
2296
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;
|
|
2297
2416
|
};
|
|
2298
2417
|
/**
|
|
2299
2418
|
* @inheritDoc InterpolationTypes
|
|
@@ -2401,7 +2520,9 @@ interface ChannelSystemParameter {
|
|
|
2401
2520
|
*/
|
|
2402
2521
|
interpolationType: InterpolationType | null;
|
|
2403
2522
|
/**
|
|
2404
|
-
* 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.
|
|
2405
2526
|
*
|
|
2406
2527
|
* Overrides the global parameter if set.
|
|
2407
2528
|
*/
|
|
@@ -2409,7 +2530,7 @@ interface ChannelSystemParameter {
|
|
|
2409
2530
|
/**
|
|
2410
2531
|
* Indicates whether the channel is in monophonic retrigger mode.
|
|
2411
2532
|
* This emulates the behavior of Microsoft GS Wavetable Synth,
|
|
2412
|
-
*
|
|
2533
|
+
* where a new note will kill the previous one on the same key if it is still playing.
|
|
2413
2534
|
*
|
|
2414
2535
|
* Overrides the global parameter if set.
|
|
2415
2536
|
*/
|
|
@@ -2625,7 +2746,7 @@ export interface GSChorusProcessor extends GSChorusParameter {
|
|
|
2625
2746
|
*/
|
|
2626
2747
|
export interface GSDelayParameter extends GSSystemEffectParameter {
|
|
2627
2748
|
/**
|
|
2628
|
-
*
|
|
2749
|
+
* 1-115
|
|
2629
2750
|
* 0.1ms-340ms-1000ms
|
|
2630
2751
|
* The delay effect has three delay times; center, left and
|
|
2631
2752
|
* right (when listening in stereo). Delay Time Center sets the delay time of the delay
|
|
@@ -2634,7 +2755,7 @@ export interface GSDelayParameter extends GSSystemEffectParameter {
|
|
|
2634
2755
|
*/
|
|
2635
2756
|
timeCenter: number;
|
|
2636
2757
|
/**
|
|
2637
|
-
*
|
|
2758
|
+
* 1-120
|
|
2638
2759
|
* 4% - 500%
|
|
2639
2760
|
* This parameter sets the delay time of the delay located at the left as a percentage of
|
|
2640
2761
|
* the Delay Time Center (up to a max. of 1.0 s).
|
|
@@ -2918,7 +3039,7 @@ export interface XGEffectBlockSnapshot {
|
|
|
2918
3039
|
*
|
|
2919
3040
|
* It represents a single effect block.
|
|
2920
3041
|
*
|
|
2921
|
-
* There are 4 effect
|
|
3042
|
+
* There are 4 effect block types in XG:
|
|
2922
3043
|
* - Reverb
|
|
2923
3044
|
* - Chorus
|
|
2924
3045
|
* - Variation
|
|
@@ -2998,7 +3119,14 @@ export interface XGSystemEffectBlockSnapshot extends XGSystemEffectParameter, XG
|
|
|
2998
3119
|
* @group Synthesizer.XG Effects
|
|
2999
3120
|
*/
|
|
3000
3121
|
export interface XGSystemEffectBlock extends XGEffectBlock, XGSystemEffectParameter {
|
|
3122
|
+
/**
|
|
3123
|
+
* Gets a snapshot of this XG effect block.
|
|
3124
|
+
*/
|
|
3001
3125
|
getSnapshot(): XGSystemEffectBlockSnapshot;
|
|
3126
|
+
/**
|
|
3127
|
+
* Restores this XG effect block from a snapshot.
|
|
3128
|
+
* @param snapshot The snapshot to restore.
|
|
3129
|
+
*/
|
|
3002
3130
|
applySnapshot(snapshot: XGSystemEffectBlockSnapshot): void;
|
|
3003
3131
|
}
|
|
3004
3132
|
/**
|
|
@@ -3080,13 +3208,20 @@ export interface XGChorusBlock extends XGSystemEffectBlock, XGChorusParameter {
|
|
|
3080
3208
|
* @param inputRight The input buffer to process. It always starts at index 0.
|
|
3081
3209
|
* @param outputLeft The left output buffer.
|
|
3082
3210
|
* @param outputRight The right output buffer.
|
|
3083
|
-
* @param reverbLeft The left reverb send buffer.
|
|
3084
|
-
* @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.
|
|
3085
3213
|
* @param startIndex The index to start mixing at into the output buffers.
|
|
3086
3214
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3087
3215
|
*/
|
|
3088
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
|
+
*/
|
|
3089
3220
|
getSnapshot(): XGChorusBlockSnapshot;
|
|
3221
|
+
/**
|
|
3222
|
+
* Restores this XG effect block from a snapshot.
|
|
3223
|
+
* @param snapshot The snapshot to restore.
|
|
3224
|
+
*/
|
|
3090
3225
|
applySnapshot(snapshot: XGChorusBlockSnapshot): void;
|
|
3091
3226
|
}
|
|
3092
3227
|
/**
|
|
@@ -3098,7 +3233,7 @@ export interface XGInsertionParameter {
|
|
|
3098
3233
|
/**
|
|
3099
3234
|
* The channel routed through the insertion effect, 0-based.
|
|
3100
3235
|
*
|
|
3101
|
-
* 127 or
|
|
3236
|
+
* 127 or any value that's not below the current channel count means OFF.
|
|
3102
3237
|
*/
|
|
3103
3238
|
partNumber: number;
|
|
3104
3239
|
}
|
|
@@ -3143,7 +3278,14 @@ export interface XGInsertionBlock extends XGInsertionParameter, XGEffectBlock {
|
|
|
3143
3278
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3144
3279
|
*/
|
|
3145
3280
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
3281
|
+
/**
|
|
3282
|
+
* Gets a snapshot of this XG effect block.
|
|
3283
|
+
*/
|
|
3146
3284
|
getSnapshot(): XGInsertionBlockSnapshot;
|
|
3285
|
+
/**
|
|
3286
|
+
* Restores this XG effect block from a snapshot.
|
|
3287
|
+
* @param snapshot The snapshot to restore.
|
|
3288
|
+
*/
|
|
3147
3289
|
applySnapshot(snapshot: XGInsertionBlockSnapshot): void;
|
|
3148
3290
|
}
|
|
3149
3291
|
/**
|
|
@@ -3156,7 +3298,7 @@ export interface XGVariationParameter extends XGSystemEffectParameter, XGInserti
|
|
|
3156
3298
|
* Indicates if variation is in the insertion mode (CONNECTION).
|
|
3157
3299
|
* If `false`, then variation is in the `system` mode.
|
|
3158
3300
|
*
|
|
3159
|
-
* The two connection modes work as
|
|
3301
|
+
* The two connection modes work as follows:
|
|
3160
3302
|
* - `system` routes all channels via sends (like reverb and chorus).
|
|
3161
3303
|
* - `insertion` routes a single `partNumber` channel straight through. Note that variation is processed last, after all insertion effects.
|
|
3162
3304
|
*/
|
|
@@ -3232,7 +3374,14 @@ export interface XGVariationBlock extends XGVariationParameter, XGSystemEffectBl
|
|
|
3232
3374
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3233
3375
|
*/
|
|
3234
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
|
+
*/
|
|
3235
3380
|
getSnapshot(): XGVariationBlockSnapshot;
|
|
3381
|
+
/**
|
|
3382
|
+
* Restores this XG effect block from a snapshot.
|
|
3383
|
+
* @param snapshot The snapshot to restore.
|
|
3384
|
+
*/
|
|
3236
3385
|
applySnapshot(snapshot: XGVariationBlockSnapshot): void;
|
|
3237
3386
|
}
|
|
3238
3387
|
/**
|
|
@@ -3283,7 +3432,7 @@ interface GlobalSystemParameter {
|
|
|
3283
3432
|
* The reverb effect gain.
|
|
3284
3433
|
* From 0 to any number. 1 is 100% reverb.
|
|
3285
3434
|
*
|
|
3286
|
-
* Applies to both GS and XG reverb.
|
|
3435
|
+
* Applies to both GS and XG reverb, including XG parts with an insertion effect assigned.
|
|
3287
3436
|
*/
|
|
3288
3437
|
reverbGain: number;
|
|
3289
3438
|
/**
|
|
@@ -3304,7 +3453,7 @@ interface GlobalSystemParameter {
|
|
|
3304
3453
|
* The chorus effect gain.
|
|
3305
3454
|
* From 0 to any number. 1 is 100% chorus.
|
|
3306
3455
|
*
|
|
3307
|
-
* Applies to both GS and XG chorus.
|
|
3456
|
+
* Applies to both GS and XG chorus, including XG parts with an insertion effect assigned.
|
|
3308
3457
|
*/
|
|
3309
3458
|
chorusGain: number;
|
|
3310
3459
|
/**
|
|
@@ -3432,7 +3581,11 @@ interface GlobalSystemParameter {
|
|
|
3432
3581
|
*/
|
|
3433
3582
|
interpolationType: InterpolationType;
|
|
3434
3583
|
/**
|
|
3435
|
-
* 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}.
|
|
3436
3589
|
*/
|
|
3437
3590
|
nrpnParamLock: boolean;
|
|
3438
3591
|
/**
|
|
@@ -3918,6 +4071,11 @@ export declare class SpessaSynthProcessor {
|
|
|
3918
4071
|
* Current total amount of voices that are playing.
|
|
3919
4072
|
*/
|
|
3920
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;
|
|
3921
4079
|
/**
|
|
3922
4080
|
* Locks or unlocks a given {@link GlobalMIDIParameter}.
|
|
3923
4081
|
* This prevents any changes to it until it's unlocked.
|
|
@@ -3948,7 +4106,7 @@ export declare class SpessaSynthProcessor {
|
|
|
3948
4106
|
* > Refer to the [MIDI Implementation](../../docs/extra/midi-implementation.md)
|
|
3949
4107
|
* > for the list of supported System Exclusives.
|
|
3950
4108
|
*
|
|
3951
|
-
* @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.
|
|
3952
4110
|
* @param channelOffset The channel offset for the message as they usually can only address the first 16 channels.
|
|
3953
4111
|
* For example, to send a system exclusive on channel 16,
|
|
3954
4112
|
* send a system exclusive for channel 0 and set an offset of 16.
|
|
@@ -4039,11 +4197,11 @@ export declare class SpessaSynthProcessor {
|
|
|
4039
4197
|
*/
|
|
4040
4198
|
processMessages(messages: (SysExAcceptedArray | MIDIMessage)[], channelOffset?: number, options?: SynthMethodOptions): void;
|
|
4041
4199
|
/**
|
|
4042
|
-
*
|
|
4200
|
+
* Destroy the synthesizer processor, clearing all channels and voices.
|
|
4043
4201
|
*
|
|
4044
|
-
*
|
|
4045
|
-
*
|
|
4046
|
-
*
|
|
4202
|
+
* > **Warning**
|
|
4203
|
+
* >
|
|
4204
|
+
* > This is irreversible, so use with caution.
|
|
4047
4205
|
*/
|
|
4048
4206
|
destroy(): void;
|
|
4049
4207
|
/**
|
|
@@ -4053,6 +4211,9 @@ export declare class SpessaSynthProcessor {
|
|
|
4053
4211
|
* >
|
|
4054
4212
|
* > This method overrides the existing System Parameters with the ones from the snapshot.
|
|
4055
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
|
+
*
|
|
4056
4217
|
* @param snapshot The snapshot to apply.
|
|
4057
4218
|
*/
|
|
4058
4219
|
applySnapshot(snapshot: SynthesizerSnapshot): void;
|
|
@@ -4113,11 +4274,6 @@ export declare class SpessaSynthProcessor {
|
|
|
4113
4274
|
* > For edits inside existing presets, {@link clearCache} is enough.
|
|
4114
4275
|
*/
|
|
4115
4276
|
refreshPresets(): void;
|
|
4116
|
-
/**
|
|
4117
|
-
* The decoded sample data kept under {@link SynthProcessorOptions.decodedSampleBudget}, in bytes.
|
|
4118
|
-
* It is only counted when a budget is set.
|
|
4119
|
-
*/
|
|
4120
|
-
get decodedSampleBytes(): number;
|
|
4121
4277
|
/**
|
|
4122
4278
|
* Clears the synthesizer's voice cache.
|
|
4123
4279
|
* This can be used to hear the changes after editing a {@link BasicSoundBank}
|
|
@@ -4258,7 +4414,7 @@ export type ChannelMIDIParameterMessage = { [P in keyof ChannelMIDIParameter]: {
|
|
|
4258
4414
|
channel: number;
|
|
4259
4415
|
}; }[keyof ChannelMIDIParameter];
|
|
4260
4416
|
/**
|
|
4261
|
-
* Represents an analyzed
|
|
4417
|
+
* Represents an analyzed GS Reverb Processor change.
|
|
4262
4418
|
*
|
|
4263
4419
|
* @group MIDI.Protocol
|
|
4264
4420
|
*/
|
|
@@ -4290,7 +4446,7 @@ export type GSReverbParameterMessage = { [P in keyof GSReverbParameter]: {
|
|
|
4290
4446
|
value: number;
|
|
4291
4447
|
};
|
|
4292
4448
|
/**
|
|
4293
|
-
* Represents an analyzed
|
|
4449
|
+
* Represents an analyzed GS Chorus Processor change.
|
|
4294
4450
|
*
|
|
4295
4451
|
* @group MIDI.Protocol
|
|
4296
4452
|
*/
|
|
@@ -4322,7 +4478,7 @@ export type GSChorusParameterMessage = { [P in keyof GSChorusParameter]: {
|
|
|
4322
4478
|
value: number;
|
|
4323
4479
|
};
|
|
4324
4480
|
/**
|
|
4325
|
-
* Represents an analyzed
|
|
4481
|
+
* Represents an analyzed GS Delay Processor change.
|
|
4326
4482
|
*
|
|
4327
4483
|
* @group MIDI.Protocol
|
|
4328
4484
|
*/
|
|
@@ -4354,7 +4510,7 @@ export type GSDelayParameterMessage = { [P in keyof GSDelayParameter]: {
|
|
|
4354
4510
|
value: number;
|
|
4355
4511
|
};
|
|
4356
4512
|
/**
|
|
4357
|
-
* Represents an analyzed
|
|
4513
|
+
* Represents an analyzed GS Insertion Processor change.
|
|
4358
4514
|
*
|
|
4359
4515
|
* @group MIDI.Protocol
|
|
4360
4516
|
*/
|
|
@@ -4869,7 +5025,7 @@ export interface ControllerChangeEvent extends ChannelEvent {
|
|
|
4869
5025
|
}
|
|
4870
5026
|
/**
|
|
4871
5027
|
* This event is triggered when a MIDI polyphonic pressure event is received. This controls the pressure of a single note.
|
|
4872
|
-
*
|
|
5028
|
+
* It has no effect by default, it has to be assigned with sound bank modulators or system exclusives.
|
|
4873
5029
|
*
|
|
4874
5030
|
* @group Synthesizer.Events
|
|
4875
5031
|
*/
|
|
@@ -5145,12 +5301,11 @@ export type UserDrumSetChangeEvent = { [P in keyof UserDrumSetParameter]: {
|
|
|
5145
5301
|
* | `noteOff` | {@link NoteOffEvent} | Key has been released. |
|
|
5146
5302
|
* | `controllerChange` | {@link ControllerChangeEvent} | Controller has been changed. |
|
|
5147
5303
|
* | `programChange` | {@link ProgramChangeEvent} | Program has been changed. |
|
|
5148
|
-
* | `
|
|
5149
|
-
* | `polyPressure` | {@link PolyPressureEvent} | Note's pressure has been changed. |
|
|
5304
|
+
* | `polyPressure` | {@link PolyPressureEvent} | Note's pressure has been changed. |
|
|
5150
5305
|
* | `stopAll` | {@link StopAllEvent} | All voices were stopped on a given channel. |
|
|
5151
5306
|
* | `channelAdded` | — | A new channel was added to the synth. |
|
|
5152
5307
|
* | `presetListChange` | — | The preset list has been changed/initialized. |
|
|
5153
|
-
* | `reset` | — | The synthesizer
|
|
5308
|
+
* | `reset` | — | The synthesizer is about to be reset. |
|
|
5154
5309
|
* | `displayMessage` | — | The synthesizer has received a display message. |
|
|
5155
5310
|
* | `globalParamChange` | {@link GlobalMIDIParameterChangeEvent} | A global MIDI Parameter has been changed. |
|
|
5156
5311
|
* | `channelParamChange` | {@link ChannelMIDIParameterChangeEvent} | A channel MIDI Parameter has been changed. |
|
|
@@ -5163,6 +5318,11 @@ export type UserDrumSetChangeEvent = { [P in keyof UserDrumSetParameter]: {
|
|
|
5163
5318
|
* > It automatically combines the sound banks and sends the list of presets as they will be played.
|
|
5164
5319
|
* > It also signals that the sound bank has been fully loaded.
|
|
5165
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
|
+
*
|
|
5166
5326
|
* @group Synthesizer.Events
|
|
5167
5327
|
*/
|
|
5168
5328
|
export interface SynthesizerEvent {
|
|
@@ -5176,7 +5336,7 @@ export interface SynthesizerEvent {
|
|
|
5176
5336
|
noteOff: NoteOffEvent;
|
|
5177
5337
|
/**
|
|
5178
5338
|
* This event is triggered when a controller is changed on any channel (usually MIDI controller change),
|
|
5179
|
-
* though
|
|
5339
|
+
* though [some system exclusives can change it too.](../../docs/extra/midi-implementation.md)
|
|
5180
5340
|
*
|
|
5181
5341
|
* > **Note**
|
|
5182
5342
|
* >
|
|
@@ -5195,7 +5355,7 @@ export interface SynthesizerEvent {
|
|
|
5195
5355
|
programChange: ProgramChangeEvent;
|
|
5196
5356
|
/**
|
|
5197
5357
|
* This event is triggered when a MIDI polyphonic pressure event is received. This controls the pressure of a single note.
|
|
5198
|
-
*
|
|
5358
|
+
* It has no effect by default, it has to be assigned with sound bank modulators or system exclusives.
|
|
5199
5359
|
*/
|
|
5200
5360
|
polyPressure: PolyPressureEvent;
|
|
5201
5361
|
/**
|
|
@@ -5228,9 +5388,10 @@ export interface SynthesizerEvent {
|
|
|
5228
5388
|
*/
|
|
5229
5389
|
presetListChange: MIDIPatchFull[];
|
|
5230
5390
|
/**
|
|
5231
|
-
* 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.
|
|
5232
5393
|
*
|
|
5233
|
-
* The data is the new system the synthesizer
|
|
5394
|
+
* The data is the new system the synthesizer will be reset to.
|
|
5234
5395
|
*
|
|
5235
5396
|
* > **Note**
|
|
5236
5397
|
* >
|
|
@@ -5244,9 +5405,10 @@ export interface SynthesizerEvent {
|
|
|
5244
5405
|
*
|
|
5245
5406
|
* Notable messages that can trigger this event:
|
|
5246
5407
|
*
|
|
5247
|
-
* -
|
|
5408
|
+
* - GS Display Data (Model ID `0x45`) messages with the first address byte `0x10` or `0x20`
|
|
5248
5409
|
* - GS Patch Name
|
|
5249
5410
|
* - GS Drum Map Name
|
|
5411
|
+
* - GS User Drum Set Name
|
|
5250
5412
|
* - XG Display Letter
|
|
5251
5413
|
* - XG Display Bitmap
|
|
5252
5414
|
*
|
|
@@ -5361,6 +5523,8 @@ interface DefaultXGEffectProcessorConstructor {
|
|
|
5361
5523
|
export declare abstract class DefaultXGEffect implements XGEffectBlock {
|
|
5362
5524
|
/**
|
|
5363
5525
|
* The currently used processor.
|
|
5526
|
+
* Hidden from the docs as the processor types are internal.
|
|
5527
|
+
* @hidden
|
|
5364
5528
|
*/
|
|
5365
5529
|
protected processor: DefaultXGEffectProcessor;
|
|
5366
5530
|
protected readonly outputLeft: Float32Array<ArrayBuffer>;
|
|
@@ -5380,8 +5544,9 @@ export declare abstract class DefaultXGEffect implements XGEffectBlock {
|
|
|
5380
5544
|
* @param defaultType The default effect type.
|
|
5381
5545
|
* @param sampleRate The sample rate, in Hertz.
|
|
5382
5546
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5383
|
-
*
|
|
5547
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5384
5548
|
* @param variation True for the variation and insertion blocks.
|
|
5549
|
+
* @hidden
|
|
5385
5550
|
*/
|
|
5386
5551
|
protected constructor(effectMap: Map<number, DefaultXGEffectProcessorConstructor>, fallbackProcessor: DefaultXGEffectProcessorConstructor, defaultType: number, sampleRate: number, maxBufferSize: number, variation: boolean);
|
|
5387
5552
|
setType(type: number): void;
|
|
@@ -5404,8 +5569,18 @@ export declare abstract class DefaultXGEffect implements XGEffectBlock {
|
|
|
5404
5569
|
export declare abstract class DefaultXGSystemEffect extends DefaultXGEffect implements XGSystemEffectBlock {
|
|
5405
5570
|
return: number;
|
|
5406
5571
|
pan: number;
|
|
5572
|
+
/**
|
|
5573
|
+
* Resets this block to default values, including the processor type.
|
|
5574
|
+
*/
|
|
5407
5575
|
reset(): void;
|
|
5576
|
+
/**
|
|
5577
|
+
* Gets a snapshot of this XG effect block.
|
|
5578
|
+
*/
|
|
5408
5579
|
getSnapshot(): XGSystemEffectBlockSnapshot;
|
|
5580
|
+
/**
|
|
5581
|
+
* Restores this XG effect block from a snapshot.
|
|
5582
|
+
* @param snapshot The snapshot to restore.
|
|
5583
|
+
*/
|
|
5409
5584
|
applySnapshot(snapshot: XGSystemEffectBlockSnapshot): void;
|
|
5410
5585
|
/**
|
|
5411
5586
|
* Mixes the staged wet output into the system effect destination, applying return and pan.
|
|
@@ -5419,6 +5594,8 @@ export declare abstract class DefaultXGSystemEffect extends DefaultXGEffect impl
|
|
|
5419
5594
|
/**
|
|
5420
5595
|
* The default implementation for {@link XGReverbBlock}.
|
|
5421
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
|
+
*
|
|
5422
5599
|
* @group Synthesizer.XG Effects
|
|
5423
5600
|
* @sealed
|
|
5424
5601
|
*/
|
|
@@ -5427,7 +5604,7 @@ export declare class DefaultXGReverb extends DefaultXGSystemEffect implements XG
|
|
|
5427
5604
|
* Constructs a new default XG reverb processor.
|
|
5428
5605
|
* @param sampleRate The sample rate, in Hertz.
|
|
5429
5606
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5430
|
-
*
|
|
5607
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5431
5608
|
*/
|
|
5432
5609
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5433
5610
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
@@ -5435,6 +5612,8 @@ export declare class DefaultXGReverb extends DefaultXGSystemEffect implements XG
|
|
|
5435
5612
|
/**
|
|
5436
5613
|
* The default implementation for {@link XGChorusBlock}.
|
|
5437
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
|
+
*
|
|
5438
5617
|
* @group Synthesizer.XG Effects
|
|
5439
5618
|
* @sealed
|
|
5440
5619
|
*/
|
|
@@ -5444,11 +5623,17 @@ export declare class DefaultXGChorus extends DefaultXGSystemEffect implements XG
|
|
|
5444
5623
|
* Constructs a new default XG chorus processor.
|
|
5445
5624
|
* @param sampleRate The sample rate, in Hertz.
|
|
5446
5625
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5447
|
-
*
|
|
5626
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5448
5627
|
*/
|
|
5449
5628
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5629
|
+
/**
|
|
5630
|
+
* Resets this block to default values, including the processor type.
|
|
5631
|
+
*/
|
|
5450
5632
|
reset(): void;
|
|
5451
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
|
+
*/
|
|
5452
5637
|
getSnapshot(): {
|
|
5453
5638
|
sendToReverb: number;
|
|
5454
5639
|
return: number;
|
|
@@ -5456,11 +5641,18 @@ export declare class DefaultXGChorus extends DefaultXGSystemEffect implements XG
|
|
|
5456
5641
|
type: number;
|
|
5457
5642
|
params: Int16Array;
|
|
5458
5643
|
};
|
|
5644
|
+
/**
|
|
5645
|
+
* Restores this XG effect block from a snapshot.
|
|
5646
|
+
* @param snapshot The snapshot to restore.
|
|
5647
|
+
*/
|
|
5459
5648
|
applySnapshot(snapshot: XGChorusBlockSnapshot): void;
|
|
5460
5649
|
}
|
|
5461
5650
|
/**
|
|
5462
5651
|
* The default implementation for {@link XGVariationBlock}.
|
|
5463
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
|
+
*
|
|
5464
5656
|
* @group Synthesizer.XG Effects
|
|
5465
5657
|
* @sealed
|
|
5466
5658
|
*/
|
|
@@ -5473,12 +5665,18 @@ export declare class DefaultXGVariation extends DefaultXGSystemEffect implements
|
|
|
5473
5665
|
* Constructs a new default XG variation processor.
|
|
5474
5666
|
* @param sampleRate The sample rate, in Hertz.
|
|
5475
5667
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5476
|
-
*
|
|
5668
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5477
5669
|
*/
|
|
5478
5670
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5671
|
+
/**
|
|
5672
|
+
* Resets this block to default values, including the processor type.
|
|
5673
|
+
*/
|
|
5479
5674
|
reset(): void;
|
|
5480
5675
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, chorusLeft: Float32Array, chorusRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
5481
5676
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
5677
|
+
/**
|
|
5678
|
+
* Gets a snapshot of this XG effect block.
|
|
5679
|
+
*/
|
|
5482
5680
|
getSnapshot(): {
|
|
5483
5681
|
insertionMode: boolean;
|
|
5484
5682
|
partNumber: number;
|
|
@@ -5489,11 +5687,19 @@ export declare class DefaultXGVariation extends DefaultXGSystemEffect implements
|
|
|
5489
5687
|
type: number;
|
|
5490
5688
|
params: Int16Array;
|
|
5491
5689
|
};
|
|
5690
|
+
/**
|
|
5691
|
+
* Restores this XG effect block from a snapshot.
|
|
5692
|
+
* @param snapshot The snapshot to restore.
|
|
5693
|
+
*/
|
|
5492
5694
|
applySnapshot(snapshot: XGVariationBlockSnapshot): void;
|
|
5493
5695
|
}
|
|
5494
5696
|
/**
|
|
5495
5697
|
* The default implementation for {@link XGInsertionBlock}.
|
|
5496
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
|
+
*
|
|
5497
5703
|
* @group Synthesizer.XG Effects
|
|
5498
5704
|
* @sealed
|
|
5499
5705
|
*/
|
|
@@ -5503,16 +5709,26 @@ export declare class DefaultXGInsertion extends DefaultXGEffect implements XGIns
|
|
|
5503
5709
|
* Constructs a new default XG insertion processor.
|
|
5504
5710
|
* @param sampleRate The sample rate, in Hertz.
|
|
5505
5711
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
5506
|
-
*
|
|
5712
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
5507
5713
|
*/
|
|
5508
5714
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
5715
|
+
/**
|
|
5716
|
+
* Resets this block to default values, including the processor type.
|
|
5717
|
+
*/
|
|
5509
5718
|
reset(): void;
|
|
5510
5719
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
5720
|
+
/**
|
|
5721
|
+
* Gets a snapshot of this XG effect block.
|
|
5722
|
+
*/
|
|
5511
5723
|
getSnapshot(): {
|
|
5512
5724
|
partNumber: number;
|
|
5513
5725
|
type: number;
|
|
5514
5726
|
params: Int16Array<ArrayBufferLike>;
|
|
5515
5727
|
};
|
|
5728
|
+
/**
|
|
5729
|
+
* Restores this XG effect block from a snapshot.
|
|
5730
|
+
* @param snapshot The snapshot to restore.
|
|
5731
|
+
*/
|
|
5516
5732
|
applySnapshot(snapshot: XGInsertionBlockSnapshot): void;
|
|
5517
5733
|
}
|
|
5518
5734
|
/**
|
|
@@ -5532,7 +5748,8 @@ export interface SoundBankManagerListEntry {
|
|
|
5532
5748
|
soundBank: BasicSoundBank;
|
|
5533
5749
|
/**
|
|
5534
5750
|
* The bank MSB offset for this sound bank.
|
|
5535
|
-
* 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.
|
|
5536
5753
|
*/
|
|
5537
5754
|
bankOffset: number;
|
|
5538
5755
|
}
|
|
@@ -5686,11 +5903,6 @@ export declare class MIDIChannel {
|
|
|
5686
5903
|
* The channel's number (0-based index).
|
|
5687
5904
|
*/
|
|
5688
5905
|
readonly channel: number;
|
|
5689
|
-
/**
|
|
5690
|
-
* If true, this skips sends as they all go through insertion.
|
|
5691
|
-
* Set by {@link SpessaSynthProcessor}.
|
|
5692
|
-
*/
|
|
5693
|
-
xgInsertionAssigned: boolean;
|
|
5694
5906
|
/**
|
|
5695
5907
|
* Current amount of voices that are playing on this channel.
|
|
5696
5908
|
*/
|
|
@@ -5852,7 +6064,7 @@ interface ChannelMIDIParameter {
|
|
|
5852
6064
|
randomPan: boolean;
|
|
5853
6065
|
/**
|
|
5854
6066
|
* Assign mode for the channel:
|
|
5855
|
-
* - `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.
|
|
5856
6068
|
* - Any other value - A new note will not kill the previous notes (default).
|
|
5857
6069
|
*
|
|
5858
6070
|
* While GS and XG differentiate 1 (Limited Multi for GS/Multi for XG) and 2 (Full Multi for GS/Inst (for Drum)),
|
|
@@ -6115,7 +6327,7 @@ interface ModifyMIDIOptions {
|
|
|
6115
6327
|
* > **Note**
|
|
6116
6328
|
* >
|
|
6117
6329
|
* > By default, a meaningful GM reset (one with notes after it)
|
|
6118
|
-
* > 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`
|
|
6119
6331
|
* > to keep the GM reset (and replace all others with GM).
|
|
6120
6332
|
* > This is done to allow the bank selections and other parameters to work.
|
|
6121
6333
|
*/
|
|
@@ -6175,8 +6387,9 @@ interface ModifyMIDIOptions {
|
|
|
6175
6387
|
/**
|
|
6176
6388
|
* The system reset to add when the file contains no reset.
|
|
6177
6389
|
* Unlike `midiParams.system`, existing resets are left untouched.
|
|
6178
|
-
* Ignored when `midiParams.system` is set (it takes precedence)
|
|
6179
|
-
*
|
|
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.
|
|
6180
6393
|
* When unset, the added reset defaults to `"xg"`
|
|
6181
6394
|
* if only XG setups are requested, otherwise to `"gs"`.
|
|
6182
6395
|
*
|
|
@@ -6224,7 +6437,7 @@ export interface RMIDInfoData {
|
|
|
6224
6437
|
creationDate: Date;
|
|
6225
6438
|
/**
|
|
6226
6439
|
* The copyright string.
|
|
6227
|
-
* If not provided, `Created
|
|
6440
|
+
* If not provided, `Created using SpessaSynth` is used.
|
|
6228
6441
|
*/
|
|
6229
6442
|
copyright: string;
|
|
6230
6443
|
/**
|
|
@@ -6238,6 +6451,7 @@ export interface RMIDInfoData {
|
|
|
6238
6451
|
midiEncoding: string;
|
|
6239
6452
|
/**
|
|
6240
6453
|
* The software used to write the file.
|
|
6454
|
+
* If not provided, `SpessaSynth` is used.
|
|
6241
6455
|
*/
|
|
6242
6456
|
software: string;
|
|
6243
6457
|
/**
|
|
@@ -6246,6 +6460,8 @@ export interface RMIDInfoData {
|
|
|
6246
6460
|
subject: string;
|
|
6247
6461
|
}
|
|
6248
6462
|
/**
|
|
6463
|
+
* A single tempo change in a MIDI sequence.
|
|
6464
|
+
*
|
|
6249
6465
|
* @group MIDI.Sequence
|
|
6250
6466
|
*/
|
|
6251
6467
|
export interface TempoChange {
|
|
@@ -6279,7 +6495,7 @@ export interface MIDILoop {
|
|
|
6279
6495
|
* the start of the file to ensure that synthesizer is in the correct state.
|
|
6280
6496
|
* This is the default behavior.
|
|
6281
6497
|
*
|
|
6282
|
-
* 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).
|
|
6283
6499
|
*/
|
|
6284
6500
|
type: "soft" | "hard";
|
|
6285
6501
|
}
|
|
@@ -6293,7 +6509,9 @@ export interface MIDILoop {
|
|
|
6293
6509
|
*/
|
|
6294
6510
|
export type MIDIFormat = 0 | 1 | 2;
|
|
6295
6511
|
/**
|
|
6296
|
-
*
|
|
6512
|
+
* A single note's time and velocity, as returned by {@link BasicMIDI.getNoteTimes}.
|
|
6513
|
+
*
|
|
6514
|
+
* @group MIDI.Sequence
|
|
6297
6515
|
*/
|
|
6298
6516
|
export interface NoteTime {
|
|
6299
6517
|
/**
|
|
@@ -6330,8 +6548,10 @@ export interface RMIDIWriteOptions {
|
|
|
6330
6548
|
*
|
|
6331
6549
|
* > **Warning**
|
|
6332
6550
|
* >
|
|
6333
|
-
* >
|
|
6551
|
+
* > Writing always sets the info encoding to `utf-8`,
|
|
6552
|
+
* > since the default fields (such as the creation date) are always written.
|
|
6334
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.
|
|
6335
6555
|
*
|
|
6336
6556
|
*/
|
|
6337
6557
|
metadata: Partial<Omit<RMIDInfoData, "infoEncoding">>;
|
|
@@ -6343,7 +6563,7 @@ export interface RMIDIWriteOptions {
|
|
|
6343
6563
|
/**
|
|
6344
6564
|
* The sound bank instance that `soundBankBinary` contains.
|
|
6345
6565
|
* Used for correcting bank and program changes when `correctBankOffset` is enabled.
|
|
6346
|
-
* If omitted,
|
|
6566
|
+
* If it is omitted, the correction is skipped and a warning is logged.
|
|
6347
6567
|
*/
|
|
6348
6568
|
soundBank?: BasicSoundBank;
|
|
6349
6569
|
}
|
|
@@ -6354,6 +6574,8 @@ export interface RMIDIWriteOptions {
|
|
|
6354
6574
|
*/
|
|
6355
6575
|
export type RMIDInfoFourCC = "INAM" | "IPRD" | "IALB" | "IART" | "IGNR" | "IPIC" | "ICOP" | "ICRD" | "ICRT" | "ICMT" | "IENG" | "ISFT" | "ISBJ" | "IENC" | "MENC" | "DBNK";
|
|
6356
6576
|
/**
|
|
6577
|
+
* A reference to an event in {@link BasicMIDI.timeline}, pointing at its track and its index in that track.
|
|
6578
|
+
*
|
|
6357
6579
|
* @group MIDI.Sequence
|
|
6358
6580
|
*/
|
|
6359
6581
|
export interface TimelineEvent {
|
|
@@ -6517,7 +6739,7 @@ export declare class MIDITrack {
|
|
|
6517
6739
|
*/
|
|
6518
6740
|
port: number;
|
|
6519
6741
|
/**
|
|
6520
|
-
* 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.
|
|
6521
6743
|
*/
|
|
6522
6744
|
channels: Set<number>;
|
|
6523
6745
|
/**
|
|
@@ -6537,7 +6759,7 @@ export declare class MIDITrack {
|
|
|
6537
6759
|
copyFrom(track: MIDITrack): void;
|
|
6538
6760
|
/**
|
|
6539
6761
|
* Adds events to the track.
|
|
6540
|
-
* @param index The index at which to add these
|
|
6762
|
+
* @param index The index at which to add these events.
|
|
6541
6763
|
* @param events The events to add.
|
|
6542
6764
|
*/
|
|
6543
6765
|
addEvents(index: number, ...events: MIDIMessage[]): void;
|
|
@@ -6666,7 +6888,8 @@ export declare class BasicMIDI {
|
|
|
6666
6888
|
* The loop points (in ticks) of the sequence, including both start and end points.
|
|
6667
6889
|
*
|
|
6668
6890
|
* If there's nothing detected, the loop will start from the first note on event and end will be the last voice message.
|
|
6669
|
-
* 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.
|
|
6670
6893
|
*/
|
|
6671
6894
|
loop: MIDILoop;
|
|
6672
6895
|
/**
|
|
@@ -6680,6 +6903,7 @@ export declare class BasicMIDI {
|
|
|
6680
6903
|
format: MIDIFormat;
|
|
6681
6904
|
/**
|
|
6682
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.
|
|
6683
6907
|
* Otherwise, this object is empty.
|
|
6684
6908
|
* Info type: Chunk data as a binary array.
|
|
6685
6909
|
*
|
|
@@ -6745,7 +6969,7 @@ export declare class BasicMIDI {
|
|
|
6745
6969
|
* This function reads the MIDI file format, extracts the header and track chunks,
|
|
6746
6970
|
* and populates the BasicMIDI instance with the parsed data.
|
|
6747
6971
|
* It supports Standard MIDI Files (SMF), RIFF MIDI (RMIDI), and Extensible Music Format (XMF).
|
|
6748
|
-
* It also handles embedded soundbanks in RMIDI files.
|
|
6972
|
+
* It also handles embedded soundbanks in RMIDI and XMF files.
|
|
6749
6973
|
* Tracker modules (ProTracker MOD, Fast Tracker 2 XM, Scream Tracker 3 S3M) are converted
|
|
6750
6974
|
* into MIDI with an embedded sound bank.
|
|
6751
6975
|
*/
|
|
@@ -6762,7 +6986,7 @@ export declare class BasicMIDI {
|
|
|
6762
6986
|
*/
|
|
6763
6987
|
static copyFrom(mid: BasicMIDI): BasicMIDI;
|
|
6764
6988
|
/**
|
|
6765
|
-
* Copies another instance this `BasicMIDI` instance, including track data.
|
|
6989
|
+
* Copies another instance into this `BasicMIDI` instance, including track data.
|
|
6766
6990
|
* @param mid The MIDI to copy.
|
|
6767
6991
|
*/
|
|
6768
6992
|
copyFrom(mid: BasicMIDI): void;
|
|
@@ -6794,7 +7018,7 @@ export declare class BasicMIDI {
|
|
|
6794
7018
|
getUsedProgramsAndKeys<T extends MIDIPatchFull>(soundbank: CallableSoundBank<T>): PresetsWithKeyCombinations<T>;
|
|
6795
7019
|
/**
|
|
6796
7020
|
* Preloads all voices for this sequence in a given {@link SpessaSynthProcessor}.
|
|
6797
|
-
* 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.
|
|
6798
7022
|
* The sequencer calls this function by default when loading the songs. (it can be disabled: {@link SpessaSynthSequencer.preload}).
|
|
6799
7023
|
* @param synth The synthesizer to preload.
|
|
6800
7024
|
*/
|
|
@@ -6813,6 +7037,12 @@ export declare class BasicMIDI {
|
|
|
6813
7037
|
flush(sortEvents?: boolean): void;
|
|
6814
7038
|
/**
|
|
6815
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
|
+
*
|
|
6816
7046
|
* @param minDrumLength In seconds, represents the minimum allowed time for a drum note,
|
|
6817
7047
|
* since they sometimes have a length of 0.
|
|
6818
7048
|
* @returns An array of 16 channels, each channel containing its notes,
|
|
@@ -6861,7 +7091,7 @@ export declare class BasicMIDI {
|
|
|
6861
7091
|
*/
|
|
6862
7092
|
writeMIDI(): ArrayBuffer;
|
|
6863
7093
|
/**
|
|
6864
|
-
* Writes out an RMIDI file (MIDI + SF2).
|
|
7094
|
+
* Writes out an RMIDI file (MIDI + SF2 or DLS).
|
|
6865
7095
|
* [See more info about this format](https://github.com/spessasus/sf2-rmidi-specification#readme).
|
|
6866
7096
|
*
|
|
6867
7097
|
* Note that this method modifies the MIDI file in-place.
|
|
@@ -6870,11 +7100,16 @@ export declare class BasicMIDI {
|
|
|
6870
7100
|
* The method is called on a `BasicMIDI` instance;
|
|
6871
7101
|
* that instance is the MIDI file to embed.
|
|
6872
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
|
+
*
|
|
6873
7108
|
* > **Tip**
|
|
6874
7109
|
* >
|
|
6875
7110
|
* > Use {@link BasicSoundBank.trim} to drastically reduce the file size.
|
|
6876
|
-
* >
|
|
6877
|
-
* > (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!)
|
|
6878
7113
|
*
|
|
6879
7114
|
* @param soundBankBinary The binary sound bank (SF2 or DLS) to embed into the file.
|
|
6880
7115
|
* @param configuration Extra options for writing the file.
|
|
@@ -6912,7 +7147,7 @@ export declare class BasicMIDI {
|
|
|
6912
7147
|
*
|
|
6913
7148
|
* // trim the soundfont
|
|
6914
7149
|
* soundBank.trim(midi.getUsedProgramsAndKeys(soundBank));
|
|
6915
|
-
* // write out with compression to save space
|
|
7150
|
+
* // write out with compression to save space
|
|
6916
7151
|
* await soundBank.setSampleFormat({
|
|
6917
7152
|
* format: "compressed",
|
|
6918
7153
|
* compressionFunction: SampleEncodingFunction // Remember to get your compression function
|
|
@@ -6948,6 +7183,8 @@ export declare class BasicMIDI {
|
|
|
6948
7183
|
* and inserts/deletes messages appropriately.
|
|
6949
7184
|
*
|
|
6950
7185
|
* This modifies the MIDI sequence _in-place_.
|
|
7186
|
+
*
|
|
7187
|
+
* @param opts The modifications to apply.
|
|
6951
7188
|
*/
|
|
6952
7189
|
modify(opts: Partial<ModifyMIDIOptions>): void;
|
|
6953
7190
|
/**
|
|
@@ -6955,8 +7192,10 @@ export declare class BasicMIDI {
|
|
|
6955
7192
|
* This means changing the programs and controllers if they are locked.
|
|
6956
7193
|
*
|
|
6957
7194
|
* For example, if channel 1 has locked preset on `Drawbar Organ`,
|
|
6958
|
-
* 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
|
|
6959
7197
|
* `Drawbar organ` (using bank MSB/LSB and program change).
|
|
7198
|
+
* Muted channels are removed from the sequence.
|
|
6960
7199
|
*
|
|
6961
7200
|
* > **Warning**
|
|
6962
7201
|
* >
|
|
@@ -7002,6 +7241,12 @@ export declare class BasicMIDI {
|
|
|
7002
7241
|
* > **Note**
|
|
7003
7242
|
* >
|
|
7004
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.
|
|
7005
7250
|
*
|
|
7006
7251
|
* @param infoType The type to set.
|
|
7007
7252
|
* @param infoData The value to set it to.
|
|
@@ -7009,6 +7254,11 @@ export declare class BasicMIDI {
|
|
|
7009
7254
|
setRMIDInfo<K extends keyof RMIDInfoData>(infoType: K, infoData: RMIDInfoData[K]): void;
|
|
7010
7255
|
/**
|
|
7011
7256
|
* Gets a given chunk from the RMIDI information.
|
|
7257
|
+
*
|
|
7258
|
+
* > **Warning**
|
|
7259
|
+
* >
|
|
7260
|
+
* > Do not call in audioWorkletGlobalScope as it uses TextDecoder.
|
|
7261
|
+
*
|
|
7012
7262
|
* @param infoType The metadata type.
|
|
7013
7263
|
* @returns `string`, `Date`, `ArrayBuffer` or undefined if the info is not set.
|
|
7014
7264
|
*/
|
|
@@ -7022,7 +7272,7 @@ export declare class BasicMIDI {
|
|
|
7022
7272
|
* > if you are not editing the MIDI file in your loop.
|
|
7023
7273
|
* > It is usually a faster solution and allows custom loops.
|
|
7024
7274
|
*
|
|
7025
|
-
*
|
|
7275
|
+
* If the track data is being edited, remember to call {@link BasicMIDI.flush} after editing!
|
|
7026
7276
|
*
|
|
7027
7277
|
* @param callback The callback function to process each event.
|
|
7028
7278
|
*/
|
|
@@ -7056,11 +7306,13 @@ export interface MIDIBuilderOptions {
|
|
|
7056
7306
|
/**
|
|
7057
7307
|
* The MIDI file track format.
|
|
7058
7308
|
* Format 0 allows only one track while format 1 allows more than one.
|
|
7059
|
-
* 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.
|
|
7060
7311
|
*/
|
|
7061
7312
|
format: MIDIFormat;
|
|
7062
7313
|
/**
|
|
7063
7314
|
* The MIDI file's name. Will be appended to the conductor (first) track and encoded with UTF-8.
|
|
7315
|
+
* Defaults to `Untitled song`.
|
|
7064
7316
|
*/
|
|
7065
7317
|
name: string;
|
|
7066
7318
|
}
|
|
@@ -7075,6 +7327,7 @@ export interface MIDIBuilderOptions {
|
|
|
7075
7327
|
* > **Warning**
|
|
7076
7328
|
* >
|
|
7077
7329
|
* > Remember to call {@link BasicMIDI.flush} after you're done building the file!
|
|
7330
|
+
* > Do not use in audioWorkletGlobalScope as it uses TextEncoder.
|
|
7078
7331
|
*
|
|
7079
7332
|
* @group MIDI.Files
|
|
7080
7333
|
*/
|
|
@@ -7218,7 +7471,7 @@ export declare class MIDIUtils {
|
|
|
7218
7471
|
* @param channel The MIDI channel number.
|
|
7219
7472
|
* @param rpn The 14-bit RPN number.
|
|
7220
7473
|
* @param value The 14-bit value for that number.
|
|
7221
|
-
* @returns The analysis result
|
|
7474
|
+
* @returns The analysis result of the message.
|
|
7222
7475
|
*/
|
|
7223
7476
|
static analyzeRPN(channel: number, rpn: number, value: number): AnalyzedParameter;
|
|
7224
7477
|
/**
|
|
@@ -7229,7 +7482,7 @@ export declare class MIDIUtils {
|
|
|
7229
7482
|
* @param value The 14-bit value for that number.
|
|
7230
7483
|
* @param drumPitchStep The drum pitch coarse resolution in semitones.
|
|
7231
7484
|
* 0.5 for GS (SC-88 and above), 1 for XG and the SC-55 drum map (bank LSB 1).
|
|
7232
|
-
* @returns The analysis result
|
|
7485
|
+
* @returns The analysis result of the message.
|
|
7233
7486
|
*/
|
|
7234
7487
|
static analyzeNRPN(channel: number, nrpn: number, value: number, drumPitchStep?: number): AnalyzedParameter;
|
|
7235
7488
|
/**
|
|
@@ -7493,7 +7746,7 @@ export declare class DrumParameterUtils {
|
|
|
7493
7746
|
*/
|
|
7494
7747
|
static copyInto(source: DrumParameter, dest: DrumParameter): void;
|
|
7495
7748
|
/**
|
|
7496
|
-
* Checks if this
|
|
7749
|
+
* Checks if this drum parameter is the default.
|
|
7497
7750
|
* @param param the param to check.
|
|
7498
7751
|
* @param midiNote the MIDI note of this parameter.
|
|
7499
7752
|
*/
|
|
@@ -7551,7 +7804,11 @@ export interface SequencerEvent {
|
|
|
7551
7804
|
newTime: number;
|
|
7552
7805
|
};
|
|
7553
7806
|
/**
|
|
7554
|
-
* 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.
|
|
7555
7812
|
*/
|
|
7556
7813
|
songEnded: object;
|
|
7557
7814
|
/**
|
|
@@ -7559,7 +7816,8 @@ export interface SequencerEvent {
|
|
|
7559
7816
|
*/
|
|
7560
7817
|
songChange: {
|
|
7561
7818
|
/**
|
|
7562
|
-
* 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}.
|
|
7563
7821
|
*/
|
|
7564
7822
|
songIndex: number;
|
|
7565
7823
|
};
|
|
@@ -7865,7 +8123,7 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
7865
8123
|
* Constructs a new default GS reverb processor.
|
|
7866
8124
|
* @param sampleRate The sample rate, in Hertz.
|
|
7867
8125
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
7868
|
-
*
|
|
8126
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
7869
8127
|
*/
|
|
7870
8128
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
7871
8129
|
private _delayFeedback;
|
|
@@ -7887,12 +8145,12 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
7887
8145
|
get preLowpass(): number;
|
|
7888
8146
|
set preLowpass(value: number);
|
|
7889
8147
|
/**
|
|
7890
|
-
*
|
|
7891
|
-
* @param input 0
|
|
7892
|
-
* @param outputLeft
|
|
7893
|
-
* @param outputRight
|
|
7894
|
-
* @param startIndex
|
|
7895
|
-
* @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.
|
|
7896
8154
|
*/
|
|
7897
8155
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
7898
8156
|
getSnapshot(): GSReverbParameter;
|
|
@@ -7939,7 +8197,7 @@ export declare class DefaultGSChorus implements GSChorusProcessor {
|
|
|
7939
8197
|
* Constructs a new default GS chorus processor.
|
|
7940
8198
|
* @param sampleRate The sample rate, in Hertz.
|
|
7941
8199
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
7942
|
-
*
|
|
8200
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
7943
8201
|
*/
|
|
7944
8202
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
7945
8203
|
private _sendLevelToReverb;
|
|
@@ -8019,7 +8277,7 @@ export declare class DefaultGSDelay implements GSDelayProcessor {
|
|
|
8019
8277
|
* Constructs a new default GS delay processor.
|
|
8020
8278
|
* @param sampleRate The sample rate, in Hertz.
|
|
8021
8279
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
8022
|
-
*
|
|
8280
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
8023
8281
|
*/
|
|
8024
8282
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
8025
8283
|
private _sendLevelToReverb;
|
|
@@ -8119,7 +8377,7 @@ export declare class DefaultGSInsertion implements GSInsertionBlock {
|
|
|
8119
8377
|
* Constructs a new default GS insertion block.
|
|
8120
8378
|
* @param sampleRate The sample rate, in Hertz.
|
|
8121
8379
|
* @param maxBufferSize The maximum buffer size the synthesizer can render at once.
|
|
8122
|
-
*
|
|
8380
|
+
* Processing more samples than this is not supported and produces undefined output.
|
|
8123
8381
|
*/
|
|
8124
8382
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
8125
8383
|
setType(type: number): void;
|