spessasynth_core 4.1.6 → 4.2.0
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 +11 -4
- package/dist/index.d.ts +863 -175
- package/dist/index.js +7518 -2847
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -247,15 +247,15 @@ declare const DLSLoopTypes: {
|
|
|
247
247
|
type DLSLoopType = (typeof DLSLoopTypes)[keyof typeof DLSLoopTypes];
|
|
248
248
|
|
|
249
249
|
declare class LowpassFilter {
|
|
250
|
+
/**
|
|
251
|
+
* For smoothing the filter cutoff frequency.
|
|
252
|
+
*/
|
|
253
|
+
static smoothingConstant: number;
|
|
250
254
|
/**
|
|
251
255
|
* Cached coefficient calculations.
|
|
252
256
|
* stored as cachedCoefficients[resonanceCb + currentInitialFc * 961].
|
|
253
257
|
*/
|
|
254
258
|
private static cachedCoefficients;
|
|
255
|
-
/**
|
|
256
|
-
* For smoothing the filter cutoff frequency.
|
|
257
|
-
*/
|
|
258
|
-
private static smoothingConstant;
|
|
259
259
|
/**
|
|
260
260
|
* Resonance in centibels.
|
|
261
261
|
*/
|
|
@@ -267,48 +267,48 @@ declare class LowpassFilter {
|
|
|
267
267
|
/**
|
|
268
268
|
* Filter coefficient 1.
|
|
269
269
|
*/
|
|
270
|
-
|
|
270
|
+
a0: number;
|
|
271
271
|
/**
|
|
272
272
|
* Filter coefficient 2.
|
|
273
273
|
*/
|
|
274
|
-
|
|
274
|
+
a1: number;
|
|
275
275
|
/**
|
|
276
276
|
* Filter coefficient 3.
|
|
277
277
|
*/
|
|
278
|
-
|
|
278
|
+
a2: number;
|
|
279
279
|
/**
|
|
280
280
|
* Filter coefficient 4.
|
|
281
281
|
*/
|
|
282
|
-
|
|
282
|
+
a3: number;
|
|
283
283
|
/**
|
|
284
284
|
* Filter coefficient 5.
|
|
285
285
|
*/
|
|
286
|
-
|
|
286
|
+
a4: number;
|
|
287
287
|
/**
|
|
288
288
|
* Input history 1.
|
|
289
289
|
*/
|
|
290
|
-
|
|
290
|
+
x1: number;
|
|
291
291
|
/**
|
|
292
292
|
* Input history 2.
|
|
293
293
|
*/
|
|
294
|
-
|
|
294
|
+
x2: number;
|
|
295
295
|
/**
|
|
296
296
|
* Output history 1.
|
|
297
297
|
*/
|
|
298
|
-
|
|
298
|
+
y1: number;
|
|
299
299
|
/**
|
|
300
300
|
* Output history 2.
|
|
301
301
|
*/
|
|
302
|
-
|
|
302
|
+
y2: number;
|
|
303
303
|
/**
|
|
304
304
|
* For tracking the last cutoff frequency in the apply method, absolute cents.
|
|
305
305
|
* Set to infinity to force recalculation.
|
|
306
306
|
*/
|
|
307
|
-
|
|
307
|
+
lastTargetCutoff: number;
|
|
308
308
|
/**
|
|
309
309
|
* Used for tracking if the filter has been initialized.
|
|
310
310
|
*/
|
|
311
|
-
|
|
311
|
+
initialized: boolean;
|
|
312
312
|
/**
|
|
313
313
|
* Filter's sample rate in Hz.
|
|
314
314
|
*/
|
|
@@ -325,14 +325,6 @@ declare class LowpassFilter {
|
|
|
325
325
|
constructor(sampleRate: number);
|
|
326
326
|
static initCache(sampleRate: number): void;
|
|
327
327
|
init(): void;
|
|
328
|
-
/**
|
|
329
|
-
* Applies the lowpass filter to the output buffer of a voice.
|
|
330
|
-
* @param sampleCount The amount of samples to write.
|
|
331
|
-
* @param voice The voice to apply the filter to.
|
|
332
|
-
* @param outputBuffer The output buffer to filter.
|
|
333
|
-
* @param fcOffset The frequency excursion in cents to apply to the filter.
|
|
334
|
-
*/
|
|
335
|
-
process(sampleCount: number, voice: Voice, outputBuffer: Float32Array, fcOffset: number): void;
|
|
336
328
|
/**
|
|
337
329
|
* Calculates the filter coefficients based on the current resonance and cutoff frequency and caches them.
|
|
338
330
|
* @param cutoffCents The cutoff frequency in cents.
|
|
@@ -820,6 +812,275 @@ declare const midiControllers: {
|
|
|
820
812
|
};
|
|
821
813
|
type MIDIController = (typeof midiControllers)[keyof typeof midiControllers];
|
|
822
814
|
|
|
815
|
+
interface EffectProcessor {
|
|
816
|
+
/**
|
|
817
|
+
* 0-127
|
|
818
|
+
* This parameter sets the amount of the effect sent to the effect output.
|
|
819
|
+
*/
|
|
820
|
+
level: number;
|
|
821
|
+
/**
|
|
822
|
+
* 0-7
|
|
823
|
+
* A low-pass filter can be applied to the sound coming into the effect to cut the high
|
|
824
|
+
* frequency range. Higher values will cut more of the high frequencies, resulting in a
|
|
825
|
+
* more mellow effect sound.
|
|
826
|
+
*/
|
|
827
|
+
preLowpass: number;
|
|
828
|
+
}
|
|
829
|
+
interface ReverbProcessorSnapshot extends EffectProcessor {
|
|
830
|
+
/**
|
|
831
|
+
* 0-7.
|
|
832
|
+
* If character is not available, it should default to the first one.
|
|
833
|
+
*
|
|
834
|
+
* This parameter selects the type of reverb. 0–5 are reverb effects, and 6 and 7 are delay
|
|
835
|
+
* effects.
|
|
836
|
+
*/
|
|
837
|
+
character: number;
|
|
838
|
+
/**
|
|
839
|
+
* 0-127
|
|
840
|
+
* This parameter sets the time over which the reverberation will continue.
|
|
841
|
+
* Higher values result in longer reverberation.
|
|
842
|
+
*/
|
|
843
|
+
time: number;
|
|
844
|
+
/**
|
|
845
|
+
* 0-127
|
|
846
|
+
* This parameter is used when the Reverb Character is set to 6 or 7, or the Reverb Type
|
|
847
|
+
* is set to Delay or Panning Delay (Rev Character 6, 7). It sets the way in which delays
|
|
848
|
+
* repeat. Higher values result in more delay repeats.
|
|
849
|
+
*/
|
|
850
|
+
delayFeedback: number;
|
|
851
|
+
/**
|
|
852
|
+
* 0 - 127 (ms)
|
|
853
|
+
* This parameter sets the delay time until the reverberant sound is heard.
|
|
854
|
+
* Higher values result in a longer pre-delay time, simulating a larger reverberant space.
|
|
855
|
+
*/
|
|
856
|
+
preDelayTime: number;
|
|
857
|
+
}
|
|
858
|
+
interface ReverbProcessor extends ReverbProcessorSnapshot {
|
|
859
|
+
/**
|
|
860
|
+
* Process the effect and ADDS it to the output.
|
|
861
|
+
* @param input The input buffer to process. It always starts at index 0.
|
|
862
|
+
* @param outputLeft The left output buffer.
|
|
863
|
+
* @param outputRight The right output buffer.
|
|
864
|
+
* @param startIndex The index to start mixing at into the output buffers.
|
|
865
|
+
* @param sampleCount The amount of samples to mix.
|
|
866
|
+
*/
|
|
867
|
+
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
868
|
+
/**
|
|
869
|
+
* Gets a synthesizer from this effect processor instance.
|
|
870
|
+
*/
|
|
871
|
+
getSnapshot(): ReverbProcessorSnapshot;
|
|
872
|
+
}
|
|
873
|
+
interface ChorusProcessorSnapshot extends EffectProcessor {
|
|
874
|
+
/**
|
|
875
|
+
* 0-127
|
|
876
|
+
* This parameter sets the level at which the chorus sound is re-input (fed back) into the
|
|
877
|
+
* chorus. By using feedback, a denser chorus sound can be created.
|
|
878
|
+
* Higher values result in a greater feedback level.
|
|
879
|
+
*/
|
|
880
|
+
feedback: number;
|
|
881
|
+
/**
|
|
882
|
+
* 0-127
|
|
883
|
+
* This parameter sets the delay time of the chorus effect.
|
|
884
|
+
*/
|
|
885
|
+
delay: number;
|
|
886
|
+
/**
|
|
887
|
+
* 0-127
|
|
888
|
+
* This parameter sets the speed (frequency) at which the chorus sound is modulated.
|
|
889
|
+
* Higher values result in faster modulation.
|
|
890
|
+
*/
|
|
891
|
+
rate: number;
|
|
892
|
+
/**
|
|
893
|
+
* 0-127
|
|
894
|
+
* This parameter sets the depth at which the chorus sound is modulated.
|
|
895
|
+
* Higher values result in deeper modulation.
|
|
896
|
+
*/
|
|
897
|
+
depth: number;
|
|
898
|
+
/**
|
|
899
|
+
* 0-127
|
|
900
|
+
* This parameter sets the amount of chorus sound that will be sent to the reverb.
|
|
901
|
+
* Higher values result in more sound being sent.
|
|
902
|
+
*/
|
|
903
|
+
sendLevelToReverb: number;
|
|
904
|
+
/**
|
|
905
|
+
* 0-127
|
|
906
|
+
* This parameter sets the amount of chorus sound that will be sent to the delay.
|
|
907
|
+
* Higher values result in more sound being sent.
|
|
908
|
+
*/
|
|
909
|
+
sendLevelToDelay: number;
|
|
910
|
+
}
|
|
911
|
+
interface ChorusProcessor extends ChorusProcessorSnapshot {
|
|
912
|
+
/**
|
|
913
|
+
* Process the effect and ADDS it to the output.
|
|
914
|
+
* @param input The input buffer to process. It always starts at index 0.
|
|
915
|
+
* @param outputLeft The left output buffer.
|
|
916
|
+
* @param outputRight The right output buffer.
|
|
917
|
+
* @param outputReverb The mono input for reverb. It always starts at index 0.
|
|
918
|
+
* @param outputDelay The mono input for delay. It always starts at index 0.
|
|
919
|
+
* @param startIndex The index to start mixing at into the output buffers.
|
|
920
|
+
* @param sampleCount The amount of samples to mix.
|
|
921
|
+
*/
|
|
922
|
+
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
923
|
+
/**
|
|
924
|
+
* Gets a synthesizer from this effect processor instance.
|
|
925
|
+
*/
|
|
926
|
+
getSnapshot(): ChorusProcessorSnapshot;
|
|
927
|
+
}
|
|
928
|
+
interface DelayProcessorSnapshot extends EffectProcessor {
|
|
929
|
+
/**
|
|
930
|
+
* 0-115
|
|
931
|
+
* 0.1ms-340ms-1000ms
|
|
932
|
+
* The delay effect has three delay times; center, left and
|
|
933
|
+
* right (when listening in stereo). Delay Time Center sets the delay time of the delay
|
|
934
|
+
* located at the center.
|
|
935
|
+
* Refer to SC-8850 Owner's Manual p. 236 for the exact mapping of the values.
|
|
936
|
+
*/
|
|
937
|
+
timeCenter: number;
|
|
938
|
+
/**
|
|
939
|
+
* 0-120
|
|
940
|
+
* 4% - 500%
|
|
941
|
+
* This parameter sets the delay time of the delay located at the left as a percentage of
|
|
942
|
+
* the Delay Time Center (up to a max. of 1.0 s).
|
|
943
|
+
* The resolution is 100/24(%).
|
|
944
|
+
*/
|
|
945
|
+
timeRatioLeft: number;
|
|
946
|
+
/**
|
|
947
|
+
* 1-120
|
|
948
|
+
* 4%-500%
|
|
949
|
+
* This parameter sets the delay time of the delay located at the right as a percentage of
|
|
950
|
+
* the Delay Time Center (up to a max. of 1.0 s).
|
|
951
|
+
* The resolution is 100/24(%).
|
|
952
|
+
*/
|
|
953
|
+
timeRatioRight: number;
|
|
954
|
+
/**
|
|
955
|
+
* 0-127
|
|
956
|
+
* This parameter sets the volume of the central delay. Higher values result in a louder
|
|
957
|
+
* center delay.
|
|
958
|
+
*/
|
|
959
|
+
levelCenter: number;
|
|
960
|
+
/**
|
|
961
|
+
* 0-127
|
|
962
|
+
* This parameter sets the volume of the left delay. Higher values result in a louder left
|
|
963
|
+
* delay.
|
|
964
|
+
*/
|
|
965
|
+
levelLeft: number;
|
|
966
|
+
/**
|
|
967
|
+
* 0-127
|
|
968
|
+
* This parameter sets the volume of the right delay. Higher values result in a louder
|
|
969
|
+
* right delay.
|
|
970
|
+
*/
|
|
971
|
+
levelRight: number;
|
|
972
|
+
/**
|
|
973
|
+
* 0-127
|
|
974
|
+
* (-64)-63
|
|
975
|
+
* This parameter affects the number of times the delay will repeat. With a value of 0,
|
|
976
|
+
* the delay will not repeat. With higher values there will be more repeats.
|
|
977
|
+
* With negative (-) values, the center delay will be fed back with inverted phase.
|
|
978
|
+
* Negative values are effective with short delay times.
|
|
979
|
+
*/
|
|
980
|
+
feedback: number;
|
|
981
|
+
/**
|
|
982
|
+
* 0-127
|
|
983
|
+
* This parameter sets the amount of delay sound that is sent to the reverb.
|
|
984
|
+
* Higher values result in more sound being sent.
|
|
985
|
+
*/
|
|
986
|
+
sendLevelToReverb: number;
|
|
987
|
+
}
|
|
988
|
+
interface DelayProcessor extends DelayProcessorSnapshot {
|
|
989
|
+
/**
|
|
990
|
+
* Process the effect and ADDS it to the output.
|
|
991
|
+
* @param input The input buffer to process. It always starts at index 0.
|
|
992
|
+
* @param outputLeft The left output buffer.
|
|
993
|
+
* @param outputRight The right output buffer.
|
|
994
|
+
* @param outputReverb The mono input for reverb. It always starts at index 0.
|
|
995
|
+
* @param startIndex The index to start mixing at into the output buffers.
|
|
996
|
+
* @param sampleCount The amount of samples to mix.
|
|
997
|
+
*/
|
|
998
|
+
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, startIndex: number, sampleCount: number): void;
|
|
999
|
+
/**
|
|
1000
|
+
* Gets a synthesizer from this effect processor instance.
|
|
1001
|
+
*/
|
|
1002
|
+
getSnapshot(): DelayProcessorSnapshot;
|
|
1003
|
+
}
|
|
1004
|
+
interface InsertionProcessor {
|
|
1005
|
+
/**
|
|
1006
|
+
* The EFX type of this processor, stored as MSB << | LSB.
|
|
1007
|
+
* For example 0x30, 0x10 is 0x3010
|
|
1008
|
+
*/
|
|
1009
|
+
readonly type: number;
|
|
1010
|
+
/**
|
|
1011
|
+
* 0-1 (floating point)
|
|
1012
|
+
* This parameter sets the amount of insertion sound that will be sent to the reverb.
|
|
1013
|
+
* Higher values result in more sound being sent.
|
|
1014
|
+
*/
|
|
1015
|
+
sendLevelToReverb: number;
|
|
1016
|
+
/**
|
|
1017
|
+
* 0-1 (floating point)
|
|
1018
|
+
* This parameter sets the amount of insertion sound that will be sent to the chorus.
|
|
1019
|
+
* Higher values result in more sound being sent.
|
|
1020
|
+
*/
|
|
1021
|
+
sendLevelToChorus: number;
|
|
1022
|
+
/**
|
|
1023
|
+
* 0-1 (floating point)
|
|
1024
|
+
* This parameter sets the amount of insertion sound that will be sent to the delay.
|
|
1025
|
+
* Higher values result in more sound being sent.
|
|
1026
|
+
*/
|
|
1027
|
+
sendLevelToDelay: number;
|
|
1028
|
+
/**
|
|
1029
|
+
* Resets the params to their default values.
|
|
1030
|
+
* This does not need to reset send levels.
|
|
1031
|
+
*/
|
|
1032
|
+
reset(): void;
|
|
1033
|
+
/**
|
|
1034
|
+
* Sets an EFX parameter.
|
|
1035
|
+
* @param parameter The parameter number (0x03-0x16).
|
|
1036
|
+
* @param value The new value (0-127).
|
|
1037
|
+
*/
|
|
1038
|
+
setParameter(parameter: number, value: number): void;
|
|
1039
|
+
/**
|
|
1040
|
+
* Process the effect and ADDS it to the output.
|
|
1041
|
+
* @param inputLeft The left input buffer to process. It always starts at index 0.
|
|
1042
|
+
* @param inputRight The right input buffer to process. It always starts at index 0.
|
|
1043
|
+
* @param outputLeft The left output buffer.
|
|
1044
|
+
* @param outputRight The right output buffer.
|
|
1045
|
+
* @param outputReverb The mono input for reverb. It always starts at index 0.
|
|
1046
|
+
* @param outputChorus The mono input for chorus. It always starts at index 0.
|
|
1047
|
+
* @param outputDelay The mono input for delay. It always starts at index 0.
|
|
1048
|
+
* @param startIndex The index to start mixing at into the output buffers.
|
|
1049
|
+
* @param sampleCount The amount of samples to mix.
|
|
1050
|
+
*/
|
|
1051
|
+
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputChorus: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
1052
|
+
}
|
|
1053
|
+
interface InsertionProcessorSnapshot {
|
|
1054
|
+
type: number;
|
|
1055
|
+
/**
|
|
1056
|
+
* Parameters for the effect, 255 means "no change"
|
|
1057
|
+
*/
|
|
1058
|
+
params: Uint8Array;
|
|
1059
|
+
/**
|
|
1060
|
+
* 0-127
|
|
1061
|
+
* This parameter sets the amount of insertion sound that will be sent to the reverb.
|
|
1062
|
+
* Higher values result in more sound being sent.
|
|
1063
|
+
*/
|
|
1064
|
+
sendLevelToReverb: number;
|
|
1065
|
+
/**
|
|
1066
|
+
* 0-127
|
|
1067
|
+
* This parameter sets the amount of insertion sound that will be sent to the chorus.
|
|
1068
|
+
* Higher values result in more sound being sent.
|
|
1069
|
+
*/
|
|
1070
|
+
sendLevelToChorus: number;
|
|
1071
|
+
/**
|
|
1072
|
+
* 0-127
|
|
1073
|
+
* This parameter sets the amount of insertion sound that will be sent to the delay.
|
|
1074
|
+
* Higher values result in more sound being sent.
|
|
1075
|
+
*/
|
|
1076
|
+
sendLevelToDelay: number;
|
|
1077
|
+
/**
|
|
1078
|
+
* A boolean list for channels that have the insertion effect enabled.
|
|
1079
|
+
*/
|
|
1080
|
+
channels: boolean[];
|
|
1081
|
+
}
|
|
1082
|
+
type InsertionProcessorConstructor = new (sampleRate: number) => InsertionProcessor;
|
|
1083
|
+
|
|
823
1084
|
type SynthSystem = "gm" | "gm2" | "gs" | "xg";
|
|
824
1085
|
interface NoteOnCallback {
|
|
825
1086
|
/** The MIDI note number. */
|
|
@@ -935,6 +1196,71 @@ interface ChannelPropertyChangeCallback {
|
|
|
935
1196
|
*/
|
|
936
1197
|
property: ChannelProperty;
|
|
937
1198
|
}
|
|
1199
|
+
type FXType<K> = Exclude<keyof K, "process" | "getSnapshot"> | "macro";
|
|
1200
|
+
type EffectChangeCallback = {
|
|
1201
|
+
/**
|
|
1202
|
+
* The effect that was changed, "reverb", "chorus", "delay" or "insertion"
|
|
1203
|
+
*/
|
|
1204
|
+
effect: "reverb";
|
|
1205
|
+
/**
|
|
1206
|
+
* The parameter type or "macro".
|
|
1207
|
+
*/
|
|
1208
|
+
parameter: FXType<ReverbProcessor>;
|
|
1209
|
+
/**
|
|
1210
|
+
* The new 7-bit value.
|
|
1211
|
+
*/
|
|
1212
|
+
value: number;
|
|
1213
|
+
} | {
|
|
1214
|
+
/**
|
|
1215
|
+
* The effect that was changed, "reverb", "chorus", "delay" or "insertion"
|
|
1216
|
+
*/
|
|
1217
|
+
effect: "chorus";
|
|
1218
|
+
/**
|
|
1219
|
+
* The parameter type or "macro".
|
|
1220
|
+
*/
|
|
1221
|
+
parameter: FXType<ChorusProcessor>;
|
|
1222
|
+
/**
|
|
1223
|
+
* The new 7-bit value.
|
|
1224
|
+
*/
|
|
1225
|
+
value: number;
|
|
1226
|
+
} | {
|
|
1227
|
+
/**
|
|
1228
|
+
* The effect that was changed, "reverb", "chorus", "delay" or "insertion"
|
|
1229
|
+
*/
|
|
1230
|
+
effect: "delay";
|
|
1231
|
+
/**
|
|
1232
|
+
* The parameter type or "macro".
|
|
1233
|
+
*/
|
|
1234
|
+
parameter: FXType<DelayProcessor>;
|
|
1235
|
+
/**
|
|
1236
|
+
* The new 7-bit value.
|
|
1237
|
+
*/
|
|
1238
|
+
value: number;
|
|
1239
|
+
} | {
|
|
1240
|
+
/**
|
|
1241
|
+
* The effect that was changed, "reverb", "chorus", "delay" or "insertion"
|
|
1242
|
+
*/
|
|
1243
|
+
effect: "insertion";
|
|
1244
|
+
/**
|
|
1245
|
+
* The parameter that was changed. This maps to GS address map at addr2 = 0x03.
|
|
1246
|
+
* See SC-8850 Manual p.237,
|
|
1247
|
+
* for example:
|
|
1248
|
+
* - 0x0 - EFX type, the value is 16 bit in this special case. Note that this resets the parameters!
|
|
1249
|
+
* - 0x3 - EFX param 1
|
|
1250
|
+
* - 0x16 - EFX param 20 (usually level)
|
|
1251
|
+
* - 0x17 - EFX send to reverb
|
|
1252
|
+
*
|
|
1253
|
+
* There are two exceptions:
|
|
1254
|
+
* - -1 - the channel has ENABLED the effect.
|
|
1255
|
+
* - -2 - the channel has DISABLED the effect.
|
|
1256
|
+
* For both of these cases, `value` is the channel number.
|
|
1257
|
+
*/
|
|
1258
|
+
parameter: number;
|
|
1259
|
+
/**
|
|
1260
|
+
* The new value for the parameter.
|
|
1261
|
+
*/
|
|
1262
|
+
value: number;
|
|
1263
|
+
};
|
|
938
1264
|
interface SynthProcessorEventData {
|
|
939
1265
|
/**
|
|
940
1266
|
* This event fires when a note is played.
|
|
@@ -1004,6 +1330,10 @@ interface SynthProcessorEventData {
|
|
|
1004
1330
|
* This event fires when a channel property changes.
|
|
1005
1331
|
*/
|
|
1006
1332
|
channelPropertyChange: ChannelPropertyChangeCallback;
|
|
1333
|
+
/**
|
|
1334
|
+
* This event fires when an effect processor is modified.
|
|
1335
|
+
*/
|
|
1336
|
+
effectChange: EffectChangeCallback;
|
|
1007
1337
|
}
|
|
1008
1338
|
type SynthProcessorEvent = {
|
|
1009
1339
|
[K in keyof SynthProcessorEventData]: {
|
|
@@ -1050,6 +1380,11 @@ interface ChannelProperty {
|
|
|
1050
1380
|
* Indicates whether the channel is a drum channel.
|
|
1051
1381
|
*/
|
|
1052
1382
|
isDrum: boolean;
|
|
1383
|
+
/**
|
|
1384
|
+
* Indicates whether the channel uses an insertion effect.
|
|
1385
|
+
* This means that there will be no separate dry output for processSplit().
|
|
1386
|
+
*/
|
|
1387
|
+
isEFX: boolean;
|
|
1053
1388
|
/**
|
|
1054
1389
|
* The channel's transposition, in semitones.
|
|
1055
1390
|
*/
|
|
@@ -1068,6 +1403,18 @@ interface SynthProcessorOptions {
|
|
|
1068
1403
|
* Indicates if the effects are enabled. This can be changed later.
|
|
1069
1404
|
*/
|
|
1070
1405
|
enableEffects: boolean;
|
|
1406
|
+
/**
|
|
1407
|
+
* Reverb processor for the synthesizer. Leave undefined to use the default.
|
|
1408
|
+
*/
|
|
1409
|
+
reverbProcessor: ReverbProcessor;
|
|
1410
|
+
/**
|
|
1411
|
+
* Chorus processor for the synthesizer. Leave undefined to use the default.
|
|
1412
|
+
*/
|
|
1413
|
+
chorusProcessor: ChorusProcessor;
|
|
1414
|
+
/**
|
|
1415
|
+
* Delay processor for the synthesizer. Leave undefined to use the default.
|
|
1416
|
+
*/
|
|
1417
|
+
delayProcessor: DelayProcessor;
|
|
1071
1418
|
}
|
|
1072
1419
|
/**
|
|
1073
1420
|
* The master parameters of the synthesizer.
|
|
@@ -1083,8 +1430,20 @@ interface MasterParameterType {
|
|
|
1083
1430
|
masterPan: number;
|
|
1084
1431
|
/**
|
|
1085
1432
|
* The maximum number of voices that can be played at once.
|
|
1433
|
+
*
|
|
1434
|
+
* @remarks
|
|
1435
|
+
* Increasing this value causes memory allocation for more voices.
|
|
1436
|
+
* It is recommended to set it at the beginning, before rendering audio to avoid GC.
|
|
1437
|
+
* Decreasing it does not cause memory usage change, so it's fine to use.
|
|
1086
1438
|
*/
|
|
1087
1439
|
voiceCap: number;
|
|
1440
|
+
/**
|
|
1441
|
+
* Enabling this parameter will cause a new voice allocation when the voice cap is hit, rather than stealing existing voices.
|
|
1442
|
+
*
|
|
1443
|
+
* @remarks
|
|
1444
|
+
* This is not recommended in real-time environments.
|
|
1445
|
+
*/
|
|
1446
|
+
autoAllocateVoices: boolean;
|
|
1088
1447
|
/**
|
|
1089
1448
|
* The interpolation type used for sample playback.
|
|
1090
1449
|
*/
|
|
@@ -1103,10 +1462,61 @@ interface MasterParameterType {
|
|
|
1103
1462
|
* The reverb gain, from 0 to any number. 1 is 100% reverb.
|
|
1104
1463
|
*/
|
|
1105
1464
|
reverbGain: number;
|
|
1465
|
+
/**
|
|
1466
|
+
* If the synthesizer should prevent editing of the reverb parameters.
|
|
1467
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
1468
|
+
* the recommended use case would be setting
|
|
1469
|
+
* the reverb parameters then locking it to prevent changes by MIDI files.
|
|
1470
|
+
*/
|
|
1471
|
+
reverbLock: boolean;
|
|
1106
1472
|
/**
|
|
1107
1473
|
* The chorus gain, from 0 to any number. 1 is 100% chorus.
|
|
1108
1474
|
*/
|
|
1109
1475
|
chorusGain: number;
|
|
1476
|
+
/**
|
|
1477
|
+
* If the synthesizer should prevent editing of the chorus parameters.
|
|
1478
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
1479
|
+
* the recommended use case would be setting
|
|
1480
|
+
* the chorus parameters then locking it to prevent changes by MIDI files.
|
|
1481
|
+
*/
|
|
1482
|
+
chorusLock: boolean;
|
|
1483
|
+
/**
|
|
1484
|
+
* The delay gain, from 0 to any number. 1 is 100% delay.
|
|
1485
|
+
*/
|
|
1486
|
+
delayGain: number;
|
|
1487
|
+
/**
|
|
1488
|
+
* If the synthesizer should prevent editing of the delay parameters.
|
|
1489
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
1490
|
+
* the recommended use case would be setting
|
|
1491
|
+
* the delay parameters then locking it to prevent changes by MIDI files.
|
|
1492
|
+
*/
|
|
1493
|
+
delayLock: boolean;
|
|
1494
|
+
/**
|
|
1495
|
+
* If the synthesizer should prevent changing the insertion effect type and parameters (including enabling/disabling it on channels).
|
|
1496
|
+
* This effect is modified using MIDI system exclusive messages, so
|
|
1497
|
+
* the recommended use case would be setting
|
|
1498
|
+
* the insertion effect type and parameters then locking it to prevent changes by MIDI files.
|
|
1499
|
+
*/
|
|
1500
|
+
insertionEffectLock: boolean;
|
|
1501
|
+
/**
|
|
1502
|
+
* If the synthesizer should prevent editing of the drum parameters.
|
|
1503
|
+
* These params are modified using MIDI system exclusive messages or NRPN, so
|
|
1504
|
+
* the recommended use case would be setting
|
|
1505
|
+
* the drum parameters then locking it to prevent changes by MIDI files.
|
|
1506
|
+
*/
|
|
1507
|
+
drumLock: boolean;
|
|
1508
|
+
/**
|
|
1509
|
+
* If the synthesizer should prevent applying the custom vibrato.
|
|
1510
|
+
* This effect is modified using NRPN, so
|
|
1511
|
+
* the recommended use case would be setting
|
|
1512
|
+
* the custom vibrato then locking it to prevent changes by MIDI files.
|
|
1513
|
+
*/
|
|
1514
|
+
customVibratoLock: boolean;
|
|
1515
|
+
/**
|
|
1516
|
+
* If the synthesizer should prevent changing any parameters via NRPN.
|
|
1517
|
+
* This includes the custom vibrato parameters.
|
|
1518
|
+
*/
|
|
1519
|
+
nprnParamLock: boolean;
|
|
1110
1520
|
/**
|
|
1111
1521
|
* Forces note killing instead of releasing. Improves performance in black MIDIs.
|
|
1112
1522
|
*/
|
|
@@ -1329,6 +1739,22 @@ declare class Voice {
|
|
|
1329
1739
|
* From -500 to 500, where zero means disabled (use the channel pan). Used for random pan.
|
|
1330
1740
|
*/
|
|
1331
1741
|
overridePan: number;
|
|
1742
|
+
/**
|
|
1743
|
+
* In cents, used for drum tuning.
|
|
1744
|
+
*/
|
|
1745
|
+
pitchOffset: number;
|
|
1746
|
+
/**
|
|
1747
|
+
* Reverb send of the voice, used for drum parts, otherwise 1.
|
|
1748
|
+
*/
|
|
1749
|
+
reverbSend: number;
|
|
1750
|
+
/**
|
|
1751
|
+
* Chorus send of the voice, used for drum parts, otherwise 1.
|
|
1752
|
+
*/
|
|
1753
|
+
chorusSend: number;
|
|
1754
|
+
/**
|
|
1755
|
+
* Delay send of the voice, used for drum parts, otherwise 1.
|
|
1756
|
+
*/
|
|
1757
|
+
delaySend: number;
|
|
1332
1758
|
/**
|
|
1333
1759
|
* Exclusive class number for hi-hats etc.
|
|
1334
1760
|
*/
|
|
@@ -2314,9 +2740,9 @@ declare function controllerChange(this: MIDIChannel, controllerNumber: MIDIContr
|
|
|
2314
2740
|
|
|
2315
2741
|
/**
|
|
2316
2742
|
* Executes a data entry coarse (MSB) change for the current channel.
|
|
2317
|
-
* @param
|
|
2743
|
+
* @param dataCoarse The value to set for the data entry coarse controller (0-127).
|
|
2318
2744
|
*/
|
|
2319
|
-
declare function dataEntryCoarse(this: MIDIChannel,
|
|
2745
|
+
declare function dataEntryCoarse(this: MIDIChannel, dataCoarse: number): void;
|
|
2320
2746
|
|
|
2321
2747
|
/**
|
|
2322
2748
|
* Sends a "MIDI Note on" message and starts a note.
|
|
@@ -2393,7 +2819,36 @@ type SysExAcceptedArray = number[] | IndexedByteArray | Uint8Array | Int8Array |
|
|
|
2393
2819
|
* This is a rather extensive method that handles various system exclusive messages,
|
|
2394
2820
|
* including Roland GS, MIDI Tuning Standard, and other non-realtime messages.
|
|
2395
2821
|
*/
|
|
2396
|
-
declare function systemExclusiveInternal(this: SynthesizerCore, syx: SysExAcceptedArray, channelOffset
|
|
2822
|
+
declare function systemExclusiveInternal(this: SynthesizerCore, syx: SysExAcceptedArray, channelOffset?: number): void;
|
|
2823
|
+
|
|
2824
|
+
declare const NON_CC_INDEX_OFFSET = 128;
|
|
2825
|
+
declare const CONTROLLER_TABLE_SIZE = 147;
|
|
2826
|
+
/**
|
|
2827
|
+
* An array with the default MIDI controller values. Note that these are 14-bit, not 7-bit.
|
|
2828
|
+
*/
|
|
2829
|
+
declare const defaultMIDIControllerValues: Int16Array<ArrayBuffer>;
|
|
2830
|
+
declare const setResetValue: (i: MIDIController, v: number) => number;
|
|
2831
|
+
declare const CUSTOM_CONTROLLER_TABLE_SIZE: number;
|
|
2832
|
+
declare const customResetArray: Float32Array<ArrayBuffer>;
|
|
2833
|
+
declare const drumReverbResetArray: Int8Array<ArrayBuffer>;
|
|
2834
|
+
|
|
2835
|
+
declare const DEFAULT_MASTER_PARAMETERS: MasterParameterType;
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
* Default MIDI drum channel.
|
|
2839
|
+
*/
|
|
2840
|
+
declare const DEFAULT_PERCUSSION = 9;
|
|
2841
|
+
declare const ALL_CHANNELS_OR_DIFFERENT_ACTION = -1;
|
|
2842
|
+
|
|
2843
|
+
declare class ThruFX implements InsertionProcessor {
|
|
2844
|
+
sendLevelToReverb: number;
|
|
2845
|
+
sendLevelToChorus: number;
|
|
2846
|
+
sendLevelToDelay: number;
|
|
2847
|
+
readonly type = 0;
|
|
2848
|
+
reset(): void;
|
|
2849
|
+
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputChorus: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
2850
|
+
setParameter(parameter: number, value: number): void;
|
|
2851
|
+
}
|
|
2397
2852
|
|
|
2398
2853
|
/**
|
|
2399
2854
|
* The core synthesis engine which interacts with channels and holds all the synth parameters.
|
|
@@ -2406,7 +2861,31 @@ declare class SynthesizerCore {
|
|
|
2406
2861
|
/**
|
|
2407
2862
|
* All MIDI channels of the synthesizer.
|
|
2408
2863
|
*/
|
|
2409
|
-
midiChannels: MIDIChannel[];
|
|
2864
|
+
readonly midiChannels: MIDIChannel[];
|
|
2865
|
+
/**
|
|
2866
|
+
* The insertion processor's left input buffer.
|
|
2867
|
+
*/
|
|
2868
|
+
insertionInputL: Float32Array<ArrayBuffer>;
|
|
2869
|
+
/**
|
|
2870
|
+
* The insertion processor's right input buffer.
|
|
2871
|
+
*/
|
|
2872
|
+
insertionInputR: Float32Array<ArrayBuffer>;
|
|
2873
|
+
/**
|
|
2874
|
+
* The reverb processor's input buffer.
|
|
2875
|
+
*/
|
|
2876
|
+
reverbInput: Float32Array<ArrayBuffer>;
|
|
2877
|
+
/**
|
|
2878
|
+
* The chorus processor's input buffer.
|
|
2879
|
+
*/
|
|
2880
|
+
chorusInput: Float32Array<ArrayBuffer>;
|
|
2881
|
+
/**
|
|
2882
|
+
* The delay processor's input buffer.
|
|
2883
|
+
*/
|
|
2884
|
+
delayInput: Float32Array<ArrayBuffer>;
|
|
2885
|
+
/**
|
|
2886
|
+
* Delay is not used outside SC-88+ MIDIs, this is an optimization.
|
|
2887
|
+
*/
|
|
2888
|
+
delayActive: boolean;
|
|
2410
2889
|
/**
|
|
2411
2890
|
* The sound bank manager, which manages all sound banks and presets.
|
|
2412
2891
|
*/
|
|
@@ -2429,11 +2908,20 @@ declare class SynthesizerCore {
|
|
|
2429
2908
|
masterGain: number;
|
|
2430
2909
|
masterPan: number;
|
|
2431
2910
|
voiceCap: number;
|
|
2911
|
+
autoAllocateVoices: boolean;
|
|
2432
2912
|
interpolationType: InterpolationType;
|
|
2433
2913
|
midiSystem: SynthSystem;
|
|
2434
2914
|
monophonicRetriggerMode: boolean;
|
|
2435
2915
|
reverbGain: number;
|
|
2916
|
+
reverbLock: boolean;
|
|
2436
2917
|
chorusGain: number;
|
|
2918
|
+
chorusLock: boolean;
|
|
2919
|
+
delayGain: number;
|
|
2920
|
+
delayLock: boolean;
|
|
2921
|
+
insertionEffectLock: boolean;
|
|
2922
|
+
drumLock: boolean;
|
|
2923
|
+
customVibratoLock: boolean;
|
|
2924
|
+
nprnParamLock: boolean;
|
|
2437
2925
|
blackMIDIMode: boolean;
|
|
2438
2926
|
transposition: number;
|
|
2439
2927
|
deviceID: number;
|
|
@@ -2446,11 +2934,6 @@ declare class SynthesizerCore {
|
|
|
2446
2934
|
* The volume gain, set by MIDI sysEx
|
|
2447
2935
|
*/
|
|
2448
2936
|
midiVolume: number;
|
|
2449
|
-
/**
|
|
2450
|
-
* Set via system exclusive.
|
|
2451
|
-
* Note: Remember to reset in system reset!
|
|
2452
|
-
*/
|
|
2453
|
-
reverbSend: number;
|
|
2454
2937
|
/**
|
|
2455
2938
|
* Are the chorus and reverb effects enabled?
|
|
2456
2939
|
*/
|
|
@@ -2459,11 +2942,6 @@ declare class SynthesizerCore {
|
|
|
2459
2942
|
* Is the event system enabled?
|
|
2460
2943
|
*/
|
|
2461
2944
|
enableEventSystem: boolean;
|
|
2462
|
-
/**
|
|
2463
|
-
* Set via system exclusive.
|
|
2464
|
-
* Note: Remember to reset in system reset!
|
|
2465
|
-
*/
|
|
2466
|
-
chorusSend: number;
|
|
2467
2945
|
/**
|
|
2468
2946
|
* The pan of the left channel.
|
|
2469
2947
|
*/
|
|
@@ -2522,10 +3000,50 @@ declare class SynthesizerCore {
|
|
|
2522
3000
|
* Current total amount of voices that are currently playing.
|
|
2523
3001
|
*/
|
|
2524
3002
|
voiceCount: number;
|
|
3003
|
+
/**
|
|
3004
|
+
* A sysEx may set a "Part" (channel) to receive on a different channel number.
|
|
3005
|
+
* This slows down the access, so this toggle tracks if it's enabled or not.
|
|
3006
|
+
*/
|
|
3007
|
+
customChannelNumbers: boolean;
|
|
3008
|
+
/**
|
|
3009
|
+
* The synthesizer's reverb processor.
|
|
3010
|
+
*/
|
|
3011
|
+
readonly reverbProcessor: ReverbProcessor;
|
|
3012
|
+
/**
|
|
3013
|
+
* The synthesizer's chorus processor.
|
|
3014
|
+
*/
|
|
3015
|
+
readonly chorusProcessor: ChorusProcessor;
|
|
3016
|
+
/**
|
|
3017
|
+
* The synthesizer's delay processor.
|
|
3018
|
+
*/
|
|
3019
|
+
readonly delayProcessor: DelayProcessor;
|
|
3020
|
+
/**
|
|
3021
|
+
* The fallback processor when the requested insertion is not available.
|
|
3022
|
+
*/
|
|
3023
|
+
protected readonly insertionFallback: ThruFX;
|
|
3024
|
+
/**
|
|
3025
|
+
* The current insertion processor.
|
|
3026
|
+
*/
|
|
3027
|
+
protected insertionProcessor: InsertionProcessor;
|
|
3028
|
+
/**
|
|
3029
|
+
* All the insertion effects available to the processor.
|
|
3030
|
+
* The key is the EFX type stored as MSB << 8 | LSB
|
|
3031
|
+
*/
|
|
3032
|
+
protected readonly insertionEffects: Map<number, InsertionProcessor>;
|
|
3033
|
+
/**
|
|
3034
|
+
* Insertion is not used outside SC-88Pro+ MIDIs, this is an optimization.
|
|
3035
|
+
*/
|
|
3036
|
+
protected insertionActive: boolean;
|
|
2525
3037
|
/**
|
|
2526
3038
|
* For F5 system exclusive.
|
|
2527
3039
|
*/
|
|
2528
|
-
|
|
3040
|
+
protected portSelectChannelOffset: number;
|
|
3041
|
+
/**
|
|
3042
|
+
* For insertion snapshot tracking
|
|
3043
|
+
* note: 255 means "no change"
|
|
3044
|
+
* @protected
|
|
3045
|
+
*/
|
|
3046
|
+
protected insertionParams: Uint8Array<ArrayBuffer>;
|
|
2529
3047
|
/**
|
|
2530
3048
|
* Last time the priorities were assigned.
|
|
2531
3049
|
* Used to prevent assigning priorities multiple times when more than one voice is triggered during a quantum.
|
|
@@ -2540,6 +3058,13 @@ declare class SynthesizerCore {
|
|
|
2540
3058
|
*/
|
|
2541
3059
|
private readonly sampleTime;
|
|
2542
3060
|
constructor(eventCallbackHandler: <K extends keyof SynthProcessorEventData>(eventType: K, eventData: SynthProcessorEventData[K]) => unknown, missingPresetHandler: (patch: MIDIPatch, system: SynthSystem) => BasicPreset | undefined, sampleRate: number, options: SynthProcessorOptions);
|
|
3061
|
+
controllerChange(channel: number, controllerNumber: MIDIController, controllerValue: number): void;
|
|
3062
|
+
noteOn(channel: number, midiNote: number, velocity: number): void;
|
|
3063
|
+
noteOff(channel: number, midiNote: number): void;
|
|
3064
|
+
polyPressure(channel: number, midiNote: number, pressure: number): void;
|
|
3065
|
+
channelPressure(channel: number, pressure: number): void;
|
|
3066
|
+
pitchWheel(channel: number, pitch: number, midiNote?: number): void;
|
|
3067
|
+
programChange(channel: number, programNumber: number): void;
|
|
2543
3068
|
/**
|
|
2544
3069
|
* Assigns the first available voice for use.
|
|
2545
3070
|
* If none available, will assign priorities.
|
|
@@ -2557,7 +3082,7 @@ declare class SynthesizerCore {
|
|
|
2557
3082
|
* @param force If true, forces the message to be processed.
|
|
2558
3083
|
* @param options Additional options for scheduling the message.
|
|
2559
3084
|
*/
|
|
2560
|
-
processMessage(message: Uint8Array | number[], channelOffset
|
|
3085
|
+
processMessage(message: Uint8Array | number[], channelOffset?: number, force?: boolean, options?: SynthMethodOptions): void;
|
|
2561
3086
|
destroySynthProcessor(): void;
|
|
2562
3087
|
/**
|
|
2563
3088
|
* @param channel channel to get voices for
|
|
@@ -2573,17 +3098,53 @@ declare class SynthesizerCore {
|
|
|
2573
3098
|
* except for the locked controllers.
|
|
2574
3099
|
*/
|
|
2575
3100
|
resetAllControllers(system?: SynthSystem): void;
|
|
2576
|
-
|
|
2577
|
-
/**
|
|
2578
|
-
*
|
|
2579
|
-
*
|
|
2580
|
-
*
|
|
2581
|
-
*
|
|
2582
|
-
*
|
|
2583
|
-
*
|
|
2584
|
-
*
|
|
2585
|
-
|
|
2586
|
-
|
|
3101
|
+
process(left: Float32Array, right: Float32Array, startIndex?: number, sampleCount?: number): void;
|
|
3102
|
+
/**
|
|
3103
|
+
* The main rendering pipeline, renders all voices the processes the effects:
|
|
3104
|
+
* ```
|
|
3105
|
+
* ┌────────────────────────────────┐
|
|
3106
|
+
* │ Voice Processor │
|
|
3107
|
+
* └───────────────┬────────────────┘
|
|
3108
|
+
* │
|
|
3109
|
+
* ┌───────────────┴────────────────┐
|
|
3110
|
+
* │ Insertion Processor │
|
|
3111
|
+
* │ (Bypass or Process) │
|
|
3112
|
+
* └───────────────┬────────────────┘
|
|
3113
|
+
* │
|
|
3114
|
+
* ┌──────────┬─────────┼────────────────────────┐
|
|
3115
|
+
* │ │ │ │
|
|
3116
|
+
* │ │ │
|
|
3117
|
+
* │ │ ┌───────┴───────┐ │
|
|
3118
|
+
* │ │ │ Chorus │ │
|
|
3119
|
+
* │ │ │ Processor ├──────────┐ │
|
|
3120
|
+
* │ │ └─┬──────────┬──┘ │ │
|
|
3121
|
+
* │ │ │ │ │ │
|
|
3122
|
+
* │ │ │ │ │ │
|
|
3123
|
+
* │ │ │ │ │ │
|
|
3124
|
+
* │ │ │ │ │ │
|
|
3125
|
+
* │ │ │
|
|
3126
|
+
* │ │ │ ┌────────┴───────┐ ┌─┴─────┴────────┐
|
|
3127
|
+
* │ └───┼>┤ Delay ├─>>┤ Reverb │
|
|
3128
|
+
* │ │ │ Processor │ │ Processor │
|
|
3129
|
+
* │ │ └────────┬───────┘ └───────┬────────┘
|
|
3130
|
+
* │ │ │ │
|
|
3131
|
+
* │ │ │ │
|
|
3132
|
+
* │ │ │ │
|
|
3133
|
+
* │ │ │ │
|
|
3134
|
+
*
|
|
3135
|
+
* ┌─────────┴──────────┐ ┌─┴──────────┴───────────────────┴────┐
|
|
3136
|
+
* │ Dry Output Pairs │ │ Stereo Effects Output │
|
|
3137
|
+
* └────────────────────┘ └─────────────────────────────────────┘
|
|
3138
|
+
* ```
|
|
3139
|
+
* The pipeline is quite similar to the one on SC-8850 manual page 78.
|
|
3140
|
+
* All output arrays must be the same length, the method will crash otherwise.
|
|
3141
|
+
* @param outputs The stereo pairs for each MIDI channel's dry output, will be wrapped if less.
|
|
3142
|
+
* @param effectsLeft The left stereo effect output buffer.
|
|
3143
|
+
* @param effectsRight The right stereo effect output buffer.
|
|
3144
|
+
* @param startIndex The index to start writing at into the output buffer.
|
|
3145
|
+
* @param samples The amount of samples to write.
|
|
3146
|
+
*/
|
|
3147
|
+
processSplit(outputs: Float32Array[][], effectsLeft: Float32Array, effectsRight: Float32Array, startIndex?: number, samples?: number): void;
|
|
2587
3148
|
/**
|
|
2588
3149
|
* Gets voices for a preset.
|
|
2589
3150
|
* @param preset The preset to get voices for.
|
|
@@ -2593,10 +3154,12 @@ declare class SynthesizerCore {
|
|
|
2593
3154
|
*/
|
|
2594
3155
|
getVoicesForPreset(preset: BasicPreset, midiNote: number, velocity: number): CachedVoiceList;
|
|
2595
3156
|
clearCache(): void;
|
|
3157
|
+
getInsertionSnapshot(): InsertionProcessorSnapshot;
|
|
2596
3158
|
/**
|
|
2597
3159
|
* Copied callback so MIDI channels can call it.
|
|
2598
3160
|
*/
|
|
2599
3161
|
callEvent<K extends keyof SynthProcessorEventData>(eventName: K, eventData: SynthProcessorEventData[K]): void;
|
|
3162
|
+
protected resetInsertion(): void;
|
|
2600
3163
|
/**
|
|
2601
3164
|
* @param volume {number} 0 to 1
|
|
2602
3165
|
*/
|
|
@@ -2606,8 +3169,13 @@ declare class SynthesizerCore {
|
|
|
2606
3169
|
* @param cents
|
|
2607
3170
|
*/
|
|
2608
3171
|
protected setMasterTuning(cents: number): void;
|
|
3172
|
+
protected setReverbMacro(macro: number): void;
|
|
3173
|
+
protected setChorusMacro(macro: number): void;
|
|
3174
|
+
protected setDelayMacro(macro: number): void;
|
|
2609
3175
|
protected getCachedVoice(patch: MIDIPatch, midiNote: number, velocity: number): CachedVoiceList | undefined;
|
|
2610
3176
|
protected setCachedVoice(patch: MIDIPatch, midiNote: number, velocity: number, voices: CachedVoiceList): void;
|
|
3177
|
+
private registerInsertionProcessor;
|
|
3178
|
+
private processMessageInternal;
|
|
2611
3179
|
/**
|
|
2612
3180
|
* Assigns priorities to the voices.
|
|
2613
3181
|
* Gets the priority of a voice based on its channel and state.
|
|
@@ -2619,10 +3187,67 @@ declare class SynthesizerCore {
|
|
|
2619
3187
|
private getCachedVoiceIndex;
|
|
2620
3188
|
}
|
|
2621
3189
|
|
|
3190
|
+
/**
|
|
3191
|
+
* Represents a single drum instrument's XG/GS parameters.
|
|
3192
|
+
*/
|
|
3193
|
+
declare class DrumParameters {
|
|
3194
|
+
/**
|
|
3195
|
+
* Pitch offset in cents.
|
|
3196
|
+
*/
|
|
3197
|
+
pitch: number;
|
|
3198
|
+
/**
|
|
3199
|
+
* Gain multiplier.
|
|
3200
|
+
*/
|
|
3201
|
+
gain: number;
|
|
3202
|
+
/**
|
|
3203
|
+
* Exclusive class override.
|
|
3204
|
+
*/
|
|
3205
|
+
exclusiveClass: number;
|
|
3206
|
+
/**
|
|
3207
|
+
* Pan, 1-64-127, 0 is random. This adds to the channel pan!
|
|
3208
|
+
*/
|
|
3209
|
+
pan: number;
|
|
3210
|
+
/**
|
|
3211
|
+
* Reverb multiplier.
|
|
3212
|
+
*/
|
|
3213
|
+
reverbGain: number;
|
|
3214
|
+
/**
|
|
3215
|
+
* Chorus multiplier.
|
|
3216
|
+
*/
|
|
3217
|
+
chorusGain: number;
|
|
3218
|
+
/**
|
|
3219
|
+
* Delay multiplier.
|
|
3220
|
+
*/
|
|
3221
|
+
delayGain: number;
|
|
3222
|
+
/**
|
|
3223
|
+
* If note on should be received.
|
|
3224
|
+
*/
|
|
3225
|
+
rxNoteOn: boolean;
|
|
3226
|
+
/**
|
|
3227
|
+
* If note off should be received.
|
|
3228
|
+
* Note:
|
|
3229
|
+
* Due to the way sound banks implement drums (as 100s release time),
|
|
3230
|
+
* this means killing the voice on note off, not releasing it.
|
|
3231
|
+
*/
|
|
3232
|
+
rxNoteOff: boolean;
|
|
3233
|
+
copyInto(p: DrumParameters): this;
|
|
3234
|
+
}
|
|
3235
|
+
|
|
2622
3236
|
/**
|
|
2623
3237
|
* This class represents a single MIDI Channel within the synthesizer.
|
|
2624
3238
|
*/
|
|
2625
3239
|
declare class MIDIChannel {
|
|
3240
|
+
/**
|
|
3241
|
+
* An array of MIDI controllers for the channel.
|
|
3242
|
+
* This array is used to store the state of various MIDI controllers
|
|
3243
|
+
* such as volume, pan, modulation, etc.
|
|
3244
|
+
* @remarks
|
|
3245
|
+
* A bit of an explanation:
|
|
3246
|
+
* The controller table is stored as an int16 array, it stores 14-bit values.
|
|
3247
|
+
* This controller table is then extended with the modulatorSources section,
|
|
3248
|
+
* for example, pitch range and pitch range depth.
|
|
3249
|
+
* This allows us for precise control range and supports full pitch-wheel resolution.
|
|
3250
|
+
*/
|
|
2626
3251
|
readonly midiControllers: Int16Array;
|
|
2627
3252
|
/**
|
|
2628
3253
|
* An array for the MIDI 2.0 Per-note pitch wheels.
|
|
@@ -2639,20 +3264,24 @@ declare class MIDIChannel {
|
|
|
2639
3264
|
* Refer to controller_tables.ts for the index definitions.
|
|
2640
3265
|
*/
|
|
2641
3266
|
readonly customControllers: Float32Array;
|
|
2642
|
-
/**
|
|
2643
|
-
* The key shift of the channel (in semitones).
|
|
2644
|
-
*/
|
|
2645
|
-
channelTransposeKeyShift: number;
|
|
2646
3267
|
/**
|
|
2647
3268
|
* An array of octave tuning values for each note on the channel.
|
|
2648
3269
|
* Each index corresponds to a note (0 = C, 1 = C#, ..., 11 = B).
|
|
2649
3270
|
* Note: Repeated every 12 notes.
|
|
2650
3271
|
*/
|
|
2651
|
-
|
|
3272
|
+
readonly octaveTuning: Int8Array;
|
|
3273
|
+
/**
|
|
3274
|
+
* Parameters for each drum instrument.
|
|
3275
|
+
*/
|
|
3276
|
+
readonly drumParams: DrumParameters[];
|
|
2652
3277
|
/**
|
|
2653
3278
|
* A system for dynamic modulator assignment for advanced system exclusives.
|
|
2654
3279
|
*/
|
|
2655
3280
|
sysExModulators: DynamicModulatorSystem;
|
|
3281
|
+
/**
|
|
3282
|
+
* The key shift of the channel (in semitones).
|
|
3283
|
+
*/
|
|
3284
|
+
keyShift: number;
|
|
2656
3285
|
/**
|
|
2657
3286
|
* Indicates whether this channel is a drum channel.
|
|
2658
3287
|
*/
|
|
@@ -2661,6 +3290,26 @@ declare class MIDIChannel {
|
|
|
2661
3290
|
* Enables random panning for every note played on this channel.
|
|
2662
3291
|
*/
|
|
2663
3292
|
randomPan: boolean;
|
|
3293
|
+
/**
|
|
3294
|
+
* Indicates whether this channel uses the insertion EFX processor.
|
|
3295
|
+
*/
|
|
3296
|
+
insertionEnabled: boolean;
|
|
3297
|
+
/**
|
|
3298
|
+
* CC1 for GS system exclusive.
|
|
3299
|
+
* An arbitrary MIDI controller, which can be bound to any synthesis parameter.
|
|
3300
|
+
*/
|
|
3301
|
+
cc1: number;
|
|
3302
|
+
/**
|
|
3303
|
+
* CC2 for GS system exclusive.
|
|
3304
|
+
* An arbitrary MIDI controller, which can be bound to any synthesis parameter.
|
|
3305
|
+
*/
|
|
3306
|
+
cc2: number;
|
|
3307
|
+
/**
|
|
3308
|
+
* Drum map for GS system exclusive tracking.
|
|
3309
|
+
* Only used for selecting the correct channel when setting drum parameters through sysEx,
|
|
3310
|
+
* as those don't specify the channel, but the drum number.
|
|
3311
|
+
*/
|
|
3312
|
+
drumMap: number;
|
|
2664
3313
|
/**
|
|
2665
3314
|
* The current state of the data entry for the channel.
|
|
2666
3315
|
*/
|
|
@@ -2684,17 +3333,13 @@ declare class MIDIChannel {
|
|
|
2684
3333
|
* Indicates the MIDI system when the preset was locked.
|
|
2685
3334
|
*/
|
|
2686
3335
|
lockedSystem: SynthSystem;
|
|
2687
|
-
/**
|
|
2688
|
-
* Indicates whether the GS NRPN parameters are enabled for this channel.
|
|
2689
|
-
*/
|
|
2690
|
-
lockGSNRPNParams: boolean;
|
|
2691
3336
|
/**
|
|
2692
3337
|
* The vibrato settings for the channel.
|
|
2693
3338
|
* @property depth - Depth of the vibrato effect in cents.
|
|
2694
3339
|
* @property delay - Delay before the vibrato effect starts (in seconds).
|
|
2695
3340
|
* @property rate - Rate of the vibrato oscillation (in Hz).
|
|
2696
3341
|
*/
|
|
2697
|
-
channelVibrato: {
|
|
3342
|
+
readonly channelVibrato: {
|
|
2698
3343
|
delay: number;
|
|
2699
3344
|
depth: number;
|
|
2700
3345
|
rate: number;
|
|
@@ -2713,6 +3358,11 @@ declare class MIDIChannel {
|
|
|
2713
3358
|
* The channel's number (0-based index)
|
|
2714
3359
|
*/
|
|
2715
3360
|
readonly channel: number;
|
|
3361
|
+
/**
|
|
3362
|
+
* The channel's receiving number (0-based index)
|
|
3363
|
+
* Only used when customChannelNumbers is enabled
|
|
3364
|
+
*/
|
|
3365
|
+
rxChannel: number;
|
|
2716
3366
|
/**
|
|
2717
3367
|
* Core synthesis engine.
|
|
2718
3368
|
*/
|
|
@@ -2764,7 +3414,7 @@ declare class MIDIChannel {
|
|
|
2764
3414
|
* @param dataValue The value to set for the data entry coarse controller (0-127).
|
|
2765
3415
|
*/
|
|
2766
3416
|
dataEntryCoarse: typeof dataEntryCoarse;
|
|
2767
|
-
readonly renderVoice: (voice: Voice, timeNow: number, outputL: Float32Array<ArrayBufferLike>, outputR: Float32Array<ArrayBufferLike>,
|
|
3417
|
+
readonly renderVoice: (voice: Voice, timeNow: number, outputL: Float32Array<ArrayBufferLike>, outputR: Float32Array<ArrayBufferLike>, startIndex: number, sampleCount: number) => void;
|
|
2768
3418
|
/**
|
|
2769
3419
|
* Per-note pitch wheel mode uses the pitchWheels table as source
|
|
2770
3420
|
* instead of the regular entry in the midiControllers table.
|
|
@@ -2889,17 +3539,6 @@ declare class MIDIChannel {
|
|
|
2889
3539
|
* @param drums
|
|
2890
3540
|
*/
|
|
2891
3541
|
setGSDrums(drums: boolean): void;
|
|
2892
|
-
/**
|
|
2893
|
-
* Sets a custom vibrato.
|
|
2894
|
-
* @param depth In cents.
|
|
2895
|
-
* @param rate In Hertz.
|
|
2896
|
-
* @param delay seconds.
|
|
2897
|
-
*/
|
|
2898
|
-
setVibrato(depth: number, rate: number, delay: number): void;
|
|
2899
|
-
/**
|
|
2900
|
-
* Disables and locks all GS NPRN parameters, including the custom vibrato.
|
|
2901
|
-
*/
|
|
2902
|
-
disableAndLockGSNRPN(): void;
|
|
2903
3542
|
resetGeneratorOverrides(): void;
|
|
2904
3543
|
setGeneratorOverride(gen: GeneratorType, value: number, realtime?: boolean): void;
|
|
2905
3544
|
resetGeneratorOffsets(): void;
|
|
@@ -2924,6 +3563,8 @@ declare class MIDIChannel {
|
|
|
2924
3563
|
* Sends this channel's property
|
|
2925
3564
|
*/
|
|
2926
3565
|
sendChannelProperty(): void;
|
|
3566
|
+
protected resetDrumParams(): void;
|
|
3567
|
+
protected resetVibratoParams(): void;
|
|
2927
3568
|
protected computeModulatorsAll(sourceUsesCC: -1 | 0 | 1, sourceIndex: number): void;
|
|
2928
3569
|
protected setBankMSB(bankMSB: number): void;
|
|
2929
3570
|
protected setBankLSB(bankLSB: number): void;
|
|
@@ -2954,23 +3595,84 @@ declare class SpessaSynthProcessor {
|
|
|
2954
3595
|
/**
|
|
2955
3596
|
* Renders float32 audio data to stereo outputs; buffer size of 128 is recommended.
|
|
2956
3597
|
* All float arrays must have the same length.
|
|
2957
|
-
* @param
|
|
2958
|
-
* @param
|
|
2959
|
-
* @param chorus chorus stereo channels (L, R).
|
|
3598
|
+
* @param left the left output channel.
|
|
3599
|
+
* @param right the right output channel.
|
|
2960
3600
|
* @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
|
|
2961
3601
|
* @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
|
|
2962
3602
|
*/
|
|
2963
|
-
readonly
|
|
3603
|
+
readonly process: (left: Float32Array, right: Float32Array, startIndex?: number, sampleCount?: number) => void;
|
|
2964
3604
|
/**
|
|
2965
|
-
* Renders
|
|
3605
|
+
* Renders float32 audio data to stereo outputs; buffer size of 128 is recommended.
|
|
2966
3606
|
* All float arrays must have the same length.
|
|
2967
|
-
* @param
|
|
2968
|
-
* @param
|
|
2969
|
-
* @param
|
|
3607
|
+
* @param outputs any number stereo pairs (L, R) to render channels separately into.
|
|
3608
|
+
* @param effectsLeft the left stereo effect output buffer.
|
|
3609
|
+
* @param effectsRight the left stereo effect output buffer.
|
|
2970
3610
|
* @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
|
|
2971
3611
|
* @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
|
|
2972
3612
|
*/
|
|
2973
|
-
readonly
|
|
3613
|
+
readonly processSplit: (outputs: Float32Array[][], effectsLeft: Float32Array, effectsRight: Float32Array, startIndex?: number, sampleCount?: number) => void;
|
|
3614
|
+
/**
|
|
3615
|
+
* Executes a system exclusive message for the synthesizer.
|
|
3616
|
+
* @param syx The system exclusive message as an array of bytes.
|
|
3617
|
+
* @param channelOffset The channel offset to apply (default is 0).
|
|
3618
|
+
*/
|
|
3619
|
+
readonly systemExclusive: (syx: SysExAcceptedArray, channelOffset?: number) => void;
|
|
3620
|
+
/**
|
|
3621
|
+
* Executes a MIDI controller change message on the specified channel.
|
|
3622
|
+
* @param channel The MIDI channel to change the controller on.
|
|
3623
|
+
* @param controllerNumber The MIDI controller number to change.
|
|
3624
|
+
* @param controllerValue The value to set the controller to.
|
|
3625
|
+
*/
|
|
3626
|
+
readonly controllerChange: (channel: number, controllerNumber: MIDIController, controllerValue: number) => void;
|
|
3627
|
+
/**
|
|
3628
|
+
* Executes a MIDI Note-on message on the specified channel.
|
|
3629
|
+
* @param channel The MIDI channel to send the note on.
|
|
3630
|
+
* @param midiNote The MIDI note number to play.
|
|
3631
|
+
* @param velocity The velocity of the note, from 0 to 127.
|
|
3632
|
+
* @remarks
|
|
3633
|
+
* If the velocity is 0, it will be treated as a Note-off message.
|
|
3634
|
+
*/
|
|
3635
|
+
readonly noteOn: (channel: number, midiNote: number, velocity: number) => void;
|
|
3636
|
+
/**
|
|
3637
|
+
* Executes a MIDI Note-off message on the specified channel.
|
|
3638
|
+
* @param channel The MIDI channel to send the note off.
|
|
3639
|
+
* @param midiNote The MIDI note number to stop playing.
|
|
3640
|
+
*/
|
|
3641
|
+
readonly noteOff: (channel: number, midiNote: number) => void;
|
|
3642
|
+
/**
|
|
3643
|
+
* Executes a MIDI Poly Pressure (Aftertouch) message on the specified channel.
|
|
3644
|
+
* @param channel The MIDI channel to send the poly pressure on.
|
|
3645
|
+
* @param midiNote The MIDI note number to apply the pressure to.
|
|
3646
|
+
* @param pressure The pressure value, from 0 to 127.
|
|
3647
|
+
*/
|
|
3648
|
+
readonly polyPressure: (channel: number, midiNote: number, pressure: number) => void;
|
|
3649
|
+
/**
|
|
3650
|
+
* Executes a MIDI Channel Pressure (Aftertouch) message on the specified channel.
|
|
3651
|
+
* @param channel The MIDI channel to send the channel pressure on.
|
|
3652
|
+
* @param pressure The pressure value, from 0 to 127.
|
|
3653
|
+
*/
|
|
3654
|
+
readonly channelPressure: (channel: number, pressure: number) => void;
|
|
3655
|
+
/**
|
|
3656
|
+
* Executes a MIDI Pitch Wheel message on the specified channel.
|
|
3657
|
+
* @param channel The MIDI channel to send the pitch wheel on.
|
|
3658
|
+
* @param pitch The new pitch value: 0-16384
|
|
3659
|
+
* @param midiNote The MIDI note number (optional), pass -1 for the regular pitch wheel.
|
|
3660
|
+
*/
|
|
3661
|
+
readonly pitchWheel: (channel: number, pitch: number, midiNote?: number) => void;
|
|
3662
|
+
/**
|
|
3663
|
+
* Executes a MIDI Program Change message on the specified channel.
|
|
3664
|
+
* @param channel The MIDI channel to send the program change on.
|
|
3665
|
+
* @param programNumber The program number to change to, from 0 to 127.
|
|
3666
|
+
*/
|
|
3667
|
+
readonly programChange: (channel: number, programNumber: number) => void;
|
|
3668
|
+
/**
|
|
3669
|
+
* Processes a raw MIDI message.
|
|
3670
|
+
* @param message The message to process.
|
|
3671
|
+
* @param channelOffset The channel offset for the message.
|
|
3672
|
+
* @param force If true, forces the message to be processed.
|
|
3673
|
+
* @param options Additional options for scheduling the message.
|
|
3674
|
+
*/
|
|
3675
|
+
readonly processMessage: (message: Uint8Array | number[], channelOffset?: number, force?: boolean, options?: SynthMethodOptions) => void;
|
|
2974
3676
|
/**
|
|
2975
3677
|
* Core synthesis engine.
|
|
2976
3678
|
*/
|
|
@@ -3013,6 +3715,18 @@ declare class SpessaSynthProcessor {
|
|
|
3013
3715
|
* The current time of the synthesizer, in seconds. You probably should not modify this directly.
|
|
3014
3716
|
*/
|
|
3015
3717
|
get currentSynthTime(): number;
|
|
3718
|
+
/**
|
|
3719
|
+
* Synthesizer's reverb processor.
|
|
3720
|
+
*/
|
|
3721
|
+
get reverbProcessor(): ReverbProcessor;
|
|
3722
|
+
/**
|
|
3723
|
+
* Synthesizer's chorus processor.
|
|
3724
|
+
*/
|
|
3725
|
+
get chorusProcessor(): ChorusProcessor;
|
|
3726
|
+
/**
|
|
3727
|
+
* Synthesizer's delay processor.
|
|
3728
|
+
*/
|
|
3729
|
+
get delayProcessor(): DelayProcessor;
|
|
3016
3730
|
/**
|
|
3017
3731
|
* The sound bank manager, which manages all sound banks and presets.
|
|
3018
3732
|
*/
|
|
@@ -3021,6 +3735,29 @@ declare class SpessaSynthProcessor {
|
|
|
3021
3735
|
* Handles the custom key overrides: velocity and preset
|
|
3022
3736
|
*/
|
|
3023
3737
|
get keyModifierManager(): KeyModifierManager;
|
|
3738
|
+
/**
|
|
3739
|
+
* Renders float32 audio data to stereo outputs; buffer size of 128 is recommended.
|
|
3740
|
+
* All float arrays must have the same length.
|
|
3741
|
+
* @param outputs output stereo channels (L, R).
|
|
3742
|
+
* @param reverb unused legacy parameter.
|
|
3743
|
+
* @param chorus unused legacy parameter.
|
|
3744
|
+
* @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
|
|
3745
|
+
* @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
|
|
3746
|
+
* @deprecated use process() as the effects are now integrated.
|
|
3747
|
+
*/
|
|
3748
|
+
renderAudio(outputs: Float32Array[], reverb: Float32Array[], chorus: Float32Array[], startIndex?: number, sampleCount?: number): void;
|
|
3749
|
+
/**
|
|
3750
|
+
* Renders the float32 audio data of each channel, routing effects to external outputs.
|
|
3751
|
+
* Buffer size of 128 is recommended.
|
|
3752
|
+
* All float arrays must have the same length.
|
|
3753
|
+
* @param reverbChannels unused legacy parameter.
|
|
3754
|
+
* @param chorusChannels unused legacy parameter.
|
|
3755
|
+
* @param separateChannels a total of 16 stereo pairs (L, R) for each MIDI channel.
|
|
3756
|
+
* @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
|
|
3757
|
+
* @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
|
|
3758
|
+
* @deprecated use processSplit() as the effects are now integrated.
|
|
3759
|
+
*/
|
|
3760
|
+
renderAudioSplit(reverbChannels: Float32Array[], chorusChannels: Float32Array[], separateChannels: Float32Array[][], startIndex?: number, sampleCount?: number): void;
|
|
3024
3761
|
/**
|
|
3025
3762
|
* A handler for missing presets during program change. By default, it warns to console.
|
|
3026
3763
|
* @param patch The MIDI patch that was requested.
|
|
@@ -3028,12 +3765,6 @@ declare class SpessaSynthProcessor {
|
|
|
3028
3765
|
* @returns If a BasicPreset instance is returned, it will be used by the channel.
|
|
3029
3766
|
*/
|
|
3030
3767
|
onMissingPreset: (patch: MIDIPatch, system: SynthSystem) => BasicPreset | undefined;
|
|
3031
|
-
/**
|
|
3032
|
-
* Executes a system exclusive message for the synthesizer.
|
|
3033
|
-
* @param syx The system exclusive message as an array of bytes.
|
|
3034
|
-
* @param channelOffset The channel offset to apply (default is 0).
|
|
3035
|
-
*/
|
|
3036
|
-
systemExclusive(syx: SysExAcceptedArray, channelOffset?: number): void;
|
|
3037
3768
|
/**
|
|
3038
3769
|
* Sets a master parameter of the synthesizer.
|
|
3039
3770
|
* @param type The type of the master parameter to set.
|
|
@@ -3065,6 +3796,10 @@ declare class SpessaSynthProcessor {
|
|
|
3065
3796
|
* Gets a synthesizer snapshot from this processor instance.
|
|
3066
3797
|
*/
|
|
3067
3798
|
getSnapshot(): SynthesizerSnapshot;
|
|
3799
|
+
/**
|
|
3800
|
+
* @internal
|
|
3801
|
+
*/
|
|
3802
|
+
getInsertionSnapshot(): InsertionProcessorSnapshot;
|
|
3068
3803
|
/**
|
|
3069
3804
|
* Sets the embedded sound bank.
|
|
3070
3805
|
* @param bank The sound bank file to set.
|
|
@@ -3083,68 +3818,12 @@ declare class SpessaSynthProcessor {
|
|
|
3083
3818
|
* This is irreversible, so use with caution.
|
|
3084
3819
|
*/
|
|
3085
3820
|
destroySynthProcessor(): void;
|
|
3086
|
-
/**
|
|
3087
|
-
* Executes a MIDI controller change message on the specified channel.
|
|
3088
|
-
* @param channel The MIDI channel to change the controller on.
|
|
3089
|
-
* @param controllerNumber The MIDI controller number to change.
|
|
3090
|
-
* @param controllerValue The value to set the controller to.
|
|
3091
|
-
*/
|
|
3092
|
-
controllerChange(channel: number, controllerNumber: MIDIController, controllerValue: number): void;
|
|
3093
|
-
/**
|
|
3094
|
-
* Executes a MIDI Note-on message on the specified channel.
|
|
3095
|
-
* @param channel The MIDI channel to send the note on.
|
|
3096
|
-
* @param midiNote The MIDI note number to play.
|
|
3097
|
-
* @param velocity The velocity of the note, from 0 to 127.
|
|
3098
|
-
* @remarks
|
|
3099
|
-
* If the velocity is 0, it will be treated as a Note-off message.
|
|
3100
|
-
*/
|
|
3101
|
-
noteOn(channel: number, midiNote: number, velocity: number): void;
|
|
3102
|
-
/**
|
|
3103
|
-
* Executes a MIDI Note-off message on the specified channel.
|
|
3104
|
-
* @param channel The MIDI channel to send the note off.
|
|
3105
|
-
* @param midiNote The MIDI note number to stop playing.
|
|
3106
|
-
*/
|
|
3107
|
-
noteOff(channel: number, midiNote: number): void;
|
|
3108
|
-
/**
|
|
3109
|
-
* Executes a MIDI Poly Pressure (Aftertouch) message on the specified channel.
|
|
3110
|
-
* @param channel The MIDI channel to send the poly pressure on.
|
|
3111
|
-
* @param midiNote The MIDI note number to apply the pressure to.
|
|
3112
|
-
* @param pressure The pressure value, from 0 to 127.
|
|
3113
|
-
*/
|
|
3114
|
-
polyPressure(channel: number, midiNote: number, pressure: number): void;
|
|
3115
|
-
/**
|
|
3116
|
-
* Executes a MIDI Channel Pressure (Aftertouch) message on the specified channel.
|
|
3117
|
-
* @param channel The MIDI channel to send the channel pressure on.
|
|
3118
|
-
* @param pressure The pressure value, from 0 to 127.
|
|
3119
|
-
*/
|
|
3120
|
-
channelPressure(channel: number, pressure: number): void;
|
|
3121
|
-
/**
|
|
3122
|
-
* Executes a MIDI Pitch Wheel message on the specified channel.
|
|
3123
|
-
* @param channel The MIDI channel to send the pitch wheel on.
|
|
3124
|
-
* @param pitch The new pitch value: 0-16384
|
|
3125
|
-
* @param midiNote The MIDI note number, pass -1 for the regular pitch wheel
|
|
3126
|
-
*/
|
|
3127
|
-
pitchWheel(channel: number, pitch: number, midiNote?: number): void;
|
|
3128
|
-
/**
|
|
3129
|
-
* Executes a MIDI Program Change message on the specified channel.
|
|
3130
|
-
* @param channel The MIDI channel to send the program change on.
|
|
3131
|
-
* @param programNumber The program number to change to, from 0 to 127.
|
|
3132
|
-
*/
|
|
3133
|
-
programChange(channel: number, programNumber: number): void;
|
|
3134
3821
|
/**
|
|
3135
3822
|
* DEPRECATED, does nothing!
|
|
3136
3823
|
* @param amount
|
|
3137
3824
|
* @deprecated
|
|
3138
3825
|
*/
|
|
3139
3826
|
killVoices(amount: number): void;
|
|
3140
|
-
/**
|
|
3141
|
-
* Processes a raw MIDI message.
|
|
3142
|
-
* @param message The message to process.
|
|
3143
|
-
* @param channelOffset The channel offset for the message.
|
|
3144
|
-
* @param force If true, forces the message to be processed.
|
|
3145
|
-
* @param options Additional options for scheduling the message.
|
|
3146
|
-
*/
|
|
3147
|
-
processMessage(message: Uint8Array | number[], channelOffset?: number, force?: boolean, options?: SynthMethodOptions): void;
|
|
3148
3827
|
/**
|
|
3149
3828
|
* Clears the synthesizer's voice cache.
|
|
3150
3829
|
*/
|
|
@@ -3197,10 +3876,6 @@ declare class ChannelSnapshot {
|
|
|
3197
3876
|
* Array of custom (not SF2) control values such as RPN pitch tuning, transpose, modulation depth, etc.
|
|
3198
3877
|
*/
|
|
3199
3878
|
customControllers: Float32Array;
|
|
3200
|
-
/**
|
|
3201
|
-
* Indicates whether the channel vibrato is locked.
|
|
3202
|
-
*/
|
|
3203
|
-
lockVibrato: boolean;
|
|
3204
3879
|
/**
|
|
3205
3880
|
* The channel's vibrato settings.
|
|
3206
3881
|
* @property depth Vibrato depth, in gain.
|
|
@@ -3215,11 +3890,15 @@ declare class ChannelSnapshot {
|
|
|
3215
3890
|
/**
|
|
3216
3891
|
* Key shift for the channel.
|
|
3217
3892
|
*/
|
|
3218
|
-
|
|
3893
|
+
keyShift: number;
|
|
3219
3894
|
/**
|
|
3220
3895
|
* The channel's octave tuning in cents.
|
|
3221
3896
|
*/
|
|
3222
|
-
|
|
3897
|
+
octaveTuning: Int8Array;
|
|
3898
|
+
/**
|
|
3899
|
+
* Parameters for each drum instrument.
|
|
3900
|
+
*/
|
|
3901
|
+
drumParams: DrumParameters[];
|
|
3223
3902
|
/**
|
|
3224
3903
|
* Indicates whether the channel is muted.
|
|
3225
3904
|
*/
|
|
@@ -3232,11 +3911,11 @@ declare class ChannelSnapshot {
|
|
|
3232
3911
|
* The channel number this snapshot represents.
|
|
3233
3912
|
*/
|
|
3234
3913
|
channelNumber: number;
|
|
3235
|
-
constructor(patch: MIDIPatchNamed, lockPreset: boolean, lockedSystem: SynthSystem, midiControllers: Int16Array, lockedControllers: boolean[], customControllers: Float32Array,
|
|
3914
|
+
constructor(patch: MIDIPatchNamed, lockPreset: boolean, lockedSystem: SynthSystem, midiControllers: Int16Array, lockedControllers: boolean[], customControllers: Float32Array, channelVibrato: {
|
|
3236
3915
|
delay: number;
|
|
3237
3916
|
depth: number;
|
|
3238
3917
|
rate: number;
|
|
3239
|
-
}, channelTransposeKeyShift: number, channelOctaveTuning: Int8Array, isMuted: boolean, drumChannel: boolean, channelNumber: number);
|
|
3918
|
+
}, channelTransposeKeyShift: number, channelOctaveTuning: Int8Array, drumParams: DrumParameters[], isMuted: boolean, drumChannel: boolean, channelNumber: number);
|
|
3240
3919
|
/**
|
|
3241
3920
|
* Creates a copy of existing snapshot.
|
|
3242
3921
|
* @param snapshot The snapshot to create a copy from.
|
|
@@ -3268,7 +3947,11 @@ declare class SynthesizerSnapshot {
|
|
|
3268
3947
|
*/
|
|
3269
3948
|
keyMappings: (KeyModifier | undefined)[][];
|
|
3270
3949
|
masterParameters: MasterParameterType;
|
|
3271
|
-
|
|
3950
|
+
reverbSnapshot: ReverbProcessorSnapshot;
|
|
3951
|
+
chorusSnapshot: ChorusProcessorSnapshot;
|
|
3952
|
+
delaySnapshot: DelayProcessorSnapshot;
|
|
3953
|
+
insertionSnapshot: InsertionProcessorSnapshot;
|
|
3954
|
+
constructor(channelSnapshots: ChannelSnapshot[], masterParameters: MasterParameterType, keyMappings: (KeyModifier | undefined)[][], reverbSnapshot: ReverbProcessorSnapshot, chorusSnapshot: ChorusProcessorSnapshot, delaySnapshot: DelayProcessorSnapshot, insertionSnapshot: InsertionProcessorSnapshot);
|
|
3272
3955
|
/**
|
|
3273
3956
|
* Creates a new synthesizer snapshot from the given SpessaSynthProcessor.
|
|
3274
3957
|
* @param processor the processor to take a snapshot of.
|
|
@@ -3287,6 +3970,18 @@ declare class SynthesizerSnapshot {
|
|
|
3287
3970
|
apply(processor: SpessaSynthProcessor): void;
|
|
3288
3971
|
}
|
|
3289
3972
|
|
|
3973
|
+
interface ModifyMIDIOptions {
|
|
3974
|
+
programChanges: DesiredProgramChange[];
|
|
3975
|
+
controllerChanges: DesiredControllerChange[];
|
|
3976
|
+
channelsToClear: number[];
|
|
3977
|
+
channelsToTranspose: DesiredChannelTranspose[];
|
|
3978
|
+
clearDrumParams: boolean;
|
|
3979
|
+
reverbParams?: ReverbProcessorSnapshot;
|
|
3980
|
+
chorusParams?: ChorusProcessorSnapshot;
|
|
3981
|
+
delayParams?: DelayProcessorSnapshot;
|
|
3982
|
+
insertionParams?: InsertionProcessorSnapshot;
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3290
3985
|
declare class MIDITrack {
|
|
3291
3986
|
/**
|
|
3292
3987
|
* The name of this track.
|
|
@@ -3310,8 +4005,15 @@ declare class MIDITrack {
|
|
|
3310
4005
|
* Adds an event to the track.
|
|
3311
4006
|
* @param event The event to add.
|
|
3312
4007
|
* @param index The index at which to add this event.
|
|
4008
|
+
* @deprecated Use addEvents instead
|
|
3313
4009
|
*/
|
|
3314
4010
|
addEvent(event: MIDIMessage, index: number): void;
|
|
4011
|
+
/**
|
|
4012
|
+
* Adds events to the track.
|
|
4013
|
+
* @param index The index at which to add these event.
|
|
4014
|
+
* @param events The events to add.
|
|
4015
|
+
*/
|
|
4016
|
+
addEvents(index: number, ...events: MIDIMessage[]): void;
|
|
3315
4017
|
/**
|
|
3316
4018
|
* Removes an event from the track.
|
|
3317
4019
|
* @param index The index of the event to remove.
|
|
@@ -3496,11 +4198,15 @@ declare class BasicMIDI {
|
|
|
3496
4198
|
* Allows easy editing of the file by removing channels, changing programs,
|
|
3497
4199
|
* changing controllers and transposing channels. Note that this modifies the MIDI *in-place*.
|
|
3498
4200
|
* @param desiredProgramChanges - The programs to set on given channels.
|
|
3499
|
-
* @param
|
|
3500
|
-
* @param
|
|
3501
|
-
* @param
|
|
4201
|
+
* @param controllerChanges - The controllers to set on given channels.
|
|
4202
|
+
* @param channelsToClear - The channels to remove from the sequence.
|
|
4203
|
+
* @param channelsToTranspose - The channels to transpose.
|
|
4204
|
+
* @param clearDrumParams - If the drum parameters should be cleared.
|
|
4205
|
+
* @param reverbParams - The desired GS reverb params, leave undefined for no change.
|
|
4206
|
+
* @param chorusParams - The desired GS chorus params, leave undefined for no change.
|
|
4207
|
+
* @param delayParams - The desired GS delay params, leave undefined for no change.
|
|
3502
4208
|
*/
|
|
3503
|
-
modify(
|
|
4209
|
+
modify({ programChanges, controllerChanges, channelsToClear, channelsToTranspose, clearDrumParams, reverbParams, chorusParams, delayParams, insertionParams }: ModifyMIDIOptions): void;
|
|
3504
4210
|
/**
|
|
3505
4211
|
* Modifies the sequence *in-place* according to the locked presets and controllers in the given snapshot.
|
|
3506
4212
|
* @param snapshot the snapshot to apply.
|
|
@@ -4315,24 +5021,6 @@ declare class SpessaSynthSequencer {
|
|
|
4315
5021
|
protected sendMIDIPitchWheel(channel: number, pitch: number): void;
|
|
4316
5022
|
}
|
|
4317
5023
|
|
|
4318
|
-
declare const NON_CC_INDEX_OFFSET = 128;
|
|
4319
|
-
declare const CONTROLLER_TABLE_SIZE = 147;
|
|
4320
|
-
/**
|
|
4321
|
-
* An array with the default MIDI controller values. Note that these are 14-bit, not 7-bit.
|
|
4322
|
-
*/
|
|
4323
|
-
declare const defaultMIDIControllerValues: Int16Array<ArrayBuffer>;
|
|
4324
|
-
declare const setResetValue: (i: MIDIController, v: number) => number;
|
|
4325
|
-
declare const CUSTOM_CONTROLLER_TABLE_SIZE: number;
|
|
4326
|
-
declare const customResetArray: Float32Array<ArrayBuffer>;
|
|
4327
|
-
|
|
4328
|
-
declare const DEFAULT_MASTER_PARAMETERS: MasterParameterType;
|
|
4329
|
-
|
|
4330
|
-
/**
|
|
4331
|
-
* Default MIDI drum channel.
|
|
4332
|
-
*/
|
|
4333
|
-
declare const DEFAULT_PERCUSSION = 9;
|
|
4334
|
-
declare const ALL_CHANNELS_OR_DIFFERENT_ACTION = -1;
|
|
4335
|
-
|
|
4336
5024
|
declare class SoundBankLoader {
|
|
4337
5025
|
/**
|
|
4338
5026
|
* Loads a sound bank from a file buffer.
|
|
@@ -4343,4 +5031,4 @@ declare class SoundBankLoader {
|
|
|
4343
5031
|
private static loadDLS;
|
|
4344
5032
|
}
|
|
4345
5033
|
|
|
4346
|
-
export { ALL_CHANNELS_OR_DIFFERENT_ACTION, BasicGlobalZone, BasicInstrument, BasicInstrumentZone, BasicMIDI, BasicPreset, BasicPresetZone, BasicSample, BasicSoundBank, BasicZone, CONTROLLER_TABLE_SIZE, CUSTOM_CONTROLLER_TABLE_SIZE, type CachedVoiceList, type ChannelPressureCallback, type ChannelProperty, type ChannelPropertyChangeCallback, ChannelSnapshot, type ControllerChangeCallback, type CustomController, DEFAULT_MASTER_PARAMETERS, DEFAULT_PERCUSSION, DEFAULT_WAV_WRITE_OPTIONS, type DLSChunkFourCC, type DLSDestination, type DLSInfoFourCC, type DLSLoop, type DLSLoopType, DLSLoopTypes, type DLSSource, type DLSTransform, type DLSWriteOptions, type DataEntryState, type DesiredChannelTranspose, type DesiredControllerChange, type DesiredProgramChange, type DrumChangeCallback, EmptySample, type FourCC, GENERATORS_AMOUNT, Generator, type GeneratorType, type GenericBankInfoFourCC, type GenericRIFFFourCC, type GenericRange, IndexedByteArray, type InterpolationType, KeyModifier, MAX_GENERATOR, MIDIBuilder, type MIDIController, type MIDIFormat, type MIDILoop, type MIDILoopType, MIDIMessage, type MIDIMessageType, type MIDIPatch, type MIDIPatchNamed, MIDIPatchTools, MIDITrack, type MasterParameterChangeCallback, type MasterParameterType, Modulator, type ModulatorCurveType, ModulatorSource, type ModulatorSourceEnum, type ModulatorSourceIndex, type ModulatorTransformType, type MuteChannelCallback, NON_CC_INDEX_OFFSET, type NoteOffCallback, type NoteOnCallback, type NoteTime, type PitchWheelCallback, type PolyPressureCallback, type PresetList, type PresetListEntry, type ProgramChangeCallback, type ProgressFunction, type RMIDIWriteOptions, type RMIDInfoData, type RMIDInfoFourCC, type SF2ChunkFourCC, type SF2InfoFourCC, type SF2VersionTag, type SampleEncodingFunction, type SampleLoopingMode, type SampleType, type SequencerEvent, type SequencerEventData, type SoundBankErrorCallback, type SoundBankInfoData, type SoundBankInfoFourCC, SoundBankLoader, type SoundBankManagerListEntry, type SoundFont2WriteOptions, SpessaSynthCoreUtils, SpessaSynthLogging, SpessaSynthProcessor, SpessaSynthSequencer, type StopAllCallback, type SynthMethodOptions, type SynthProcessorEvent, type SynthProcessorEventData, type SynthProcessorOptions, type SynthSystem, SynthesizerSnapshot, type TempoChange, type VoiceParameters, type WaveMetadata, type WaveWriteOptions, audioToWav, customControllers, customResetArray, dataEntryStates, defaultGeneratorValues, defaultMIDIControllerValues, dlsDestinations, dlsSources, generatorLimits, generatorTypes, interpolationTypes, midiControllers, midiMessageTypes, modulatorCurveTypes, modulatorSources, modulatorTransformTypes, sampleTypes, setResetValue };
|
|
5034
|
+
export { ALL_CHANNELS_OR_DIFFERENT_ACTION, BasicGlobalZone, BasicInstrument, BasicInstrumentZone, BasicMIDI, BasicPreset, BasicPresetZone, BasicSample, BasicSoundBank, BasicZone, CONTROLLER_TABLE_SIZE, CUSTOM_CONTROLLER_TABLE_SIZE, type CachedVoiceList, type ChannelPressureCallback, type ChannelProperty, type ChannelPropertyChangeCallback, ChannelSnapshot, type ChorusProcessor, type ChorusProcessorSnapshot, type ControllerChangeCallback, type CustomController, DEFAULT_MASTER_PARAMETERS, DEFAULT_PERCUSSION, DEFAULT_WAV_WRITE_OPTIONS, type DLSChunkFourCC, type DLSDestination, type DLSInfoFourCC, type DLSLoop, type DLSLoopType, DLSLoopTypes, type DLSSource, type DLSTransform, type DLSWriteOptions, type DataEntryState, type DelayProcessor, type DelayProcessorSnapshot, type DesiredChannelTranspose, type DesiredControllerChange, type DesiredProgramChange, type DrumChangeCallback, type EffectChangeCallback, EmptySample, type FourCC, GENERATORS_AMOUNT, Generator, type GeneratorType, type GenericBankInfoFourCC, type GenericRIFFFourCC, type GenericRange, IndexedByteArray, type InsertionProcessor, type InsertionProcessorConstructor, type InsertionProcessorSnapshot, type InterpolationType, KeyModifier, MAX_GENERATOR, MIDIBuilder, type MIDIController, type MIDIFormat, type MIDILoop, type MIDILoopType, MIDIMessage, type MIDIMessageType, type MIDIPatch, type MIDIPatchNamed, MIDIPatchTools, MIDITrack, type MasterParameterChangeCallback, type MasterParameterType, Modulator, type ModulatorCurveType, ModulatorSource, type ModulatorSourceEnum, type ModulatorSourceIndex, type ModulatorTransformType, type MuteChannelCallback, NON_CC_INDEX_OFFSET, type NoteOffCallback, type NoteOnCallback, type NoteTime, type PitchWheelCallback, type PolyPressureCallback, type PresetList, type PresetListEntry, type ProgramChangeCallback, type ProgressFunction, type RMIDIWriteOptions, type RMIDInfoData, type RMIDInfoFourCC, type ReverbProcessor, type ReverbProcessorSnapshot, type SF2ChunkFourCC, type SF2InfoFourCC, type SF2VersionTag, type SampleEncodingFunction, type SampleLoopingMode, type SampleType, type SequencerEvent, type SequencerEventData, type SoundBankErrorCallback, type SoundBankInfoData, type SoundBankInfoFourCC, SoundBankLoader, type SoundBankManagerListEntry, type SoundFont2WriteOptions, SpessaSynthCoreUtils, SpessaSynthLogging, SpessaSynthProcessor, SpessaSynthSequencer, type StopAllCallback, type SynthMethodOptions, type SynthProcessorEvent, type SynthProcessorEventData, type SynthProcessorOptions, type SynthSystem, SynthesizerSnapshot, type TempoChange, type VoiceParameters, type WaveMetadata, type WaveWriteOptions, audioToWav, customControllers, customResetArray, dataEntryStates, defaultGeneratorValues, defaultMIDIControllerValues, dlsDestinations, dlsSources, drumReverbResetArray, generatorLimits, generatorTypes, interpolationTypes, midiControllers, midiMessageTypes, modulatorCurveTypes, modulatorSources, modulatorTransformTypes, sampleTypes, setResetValue };
|