spessasynth_core 4.1.5 → 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/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
- private a0;
270
+ a0: number;
271
271
  /**
272
272
  * Filter coefficient 2.
273
273
  */
274
- private a1;
274
+ a1: number;
275
275
  /**
276
276
  * Filter coefficient 3.
277
277
  */
278
- private a2;
278
+ a2: number;
279
279
  /**
280
280
  * Filter coefficient 4.
281
281
  */
282
- private a3;
282
+ a3: number;
283
283
  /**
284
284
  * Filter coefficient 5.
285
285
  */
286
- private a4;
286
+ a4: number;
287
287
  /**
288
288
  * Input history 1.
289
289
  */
290
- private x1;
290
+ x1: number;
291
291
  /**
292
292
  * Input history 2.
293
293
  */
294
- private x2;
294
+ x2: number;
295
295
  /**
296
296
  * Output history 1.
297
297
  */
298
- private y1;
298
+ y1: number;
299
299
  /**
300
300
  * Output history 2.
301
301
  */
302
- private y2;
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
- private lastTargetCutoff;
307
+ lastTargetCutoff: number;
308
308
  /**
309
309
  * Used for tracking if the filter has been initialized.
310
310
  */
311
- private initialized;
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.
@@ -783,7 +775,7 @@ declare const midiControllers: {
783
775
  readonly reverbDepth: 91;
784
776
  readonly tremoloDepth: 92;
785
777
  readonly chorusDepth: 93;
786
- readonly detuneDepth: 94;
778
+ readonly variationDepth: 94;
787
779
  readonly phaserDepth: 95;
788
780
  readonly dataIncrement: 96;
789
781
  readonly dataDecrement: 97;
@@ -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 dataValue The value to set for the data entry coarse controller (0-127).
2743
+ * @param dataCoarse The value to set for the data entry coarse controller (0-127).
2318
2744
  */
2319
- declare function dataEntryCoarse(this: MIDIChannel, dataValue: number): void;
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: number): void;
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
  */
@@ -2425,7 +2904,28 @@ declare class SynthesizerCore {
2425
2904
  /**
2426
2905
  * The master parameters of the synthesizer.
2427
2906
  */
2428
- masterParameters: MasterParameterType;
2907
+ masterParameters: {
2908
+ masterGain: number;
2909
+ masterPan: number;
2910
+ voiceCap: number;
2911
+ autoAllocateVoices: boolean;
2912
+ interpolationType: InterpolationType;
2913
+ midiSystem: SynthSystem;
2914
+ monophonicRetriggerMode: boolean;
2915
+ reverbGain: number;
2916
+ reverbLock: boolean;
2917
+ chorusGain: number;
2918
+ chorusLock: boolean;
2919
+ delayGain: number;
2920
+ delayLock: boolean;
2921
+ insertionEffectLock: boolean;
2922
+ drumLock: boolean;
2923
+ customVibratoLock: boolean;
2924
+ nprnParamLock: boolean;
2925
+ blackMIDIMode: boolean;
2926
+ transposition: number;
2927
+ deviceID: number;
2928
+ };
2429
2929
  /**
2430
2930
  * The current time of the synthesizer, in seconds.
2431
2931
  */
@@ -2434,11 +2934,6 @@ declare class SynthesizerCore {
2434
2934
  * The volume gain, set by MIDI sysEx
2435
2935
  */
2436
2936
  midiVolume: number;
2437
- /**
2438
- * Set via system exclusive.
2439
- * Note: Remember to reset in system reset!
2440
- */
2441
- reverbSend: number;
2442
2937
  /**
2443
2938
  * Are the chorus and reverb effects enabled?
2444
2939
  */
@@ -2447,11 +2942,6 @@ declare class SynthesizerCore {
2447
2942
  * Is the event system enabled?
2448
2943
  */
2449
2944
  enableEventSystem: boolean;
2450
- /**
2451
- * Set via system exclusive.
2452
- * Note: Remember to reset in system reset!
2453
- */
2454
- chorusSend: number;
2455
2945
  /**
2456
2946
  * The pan of the left channel.
2457
2947
  */
@@ -2510,10 +3000,50 @@ declare class SynthesizerCore {
2510
3000
  * Current total amount of voices that are currently playing.
2511
3001
  */
2512
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;
2513
3037
  /**
2514
3038
  * For F5 system exclusive.
2515
3039
  */
2516
- channelOffset: number;
3040
+ protected portSelectChannelOffset: number;
3041
+ /**
3042
+ * For insertion snapshot tracking
3043
+ * note: 255 means "no change"
3044
+ * @protected
3045
+ */
3046
+ protected insertionParams: Uint8Array<ArrayBuffer>;
2517
3047
  /**
2518
3048
  * Last time the priorities were assigned.
2519
3049
  * Used to prevent assigning priorities multiple times when more than one voice is triggered during a quantum.
@@ -2528,6 +3058,13 @@ declare class SynthesizerCore {
2528
3058
  */
2529
3059
  private readonly sampleTime;
2530
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;
2531
3068
  /**
2532
3069
  * Assigns the first available voice for use.
2533
3070
  * If none available, will assign priorities.
@@ -2545,7 +3082,7 @@ declare class SynthesizerCore {
2545
3082
  * @param force If true, forces the message to be processed.
2546
3083
  * @param options Additional options for scheduling the message.
2547
3084
  */
2548
- processMessage(message: Uint8Array | number[], channelOffset: number, force: boolean, options: SynthMethodOptions): void;
3085
+ processMessage(message: Uint8Array | number[], channelOffset?: number, force?: boolean, options?: SynthMethodOptions): void;
2549
3086
  destroySynthProcessor(): void;
2550
3087
  /**
2551
3088
  * @param channel channel to get voices for
@@ -2561,17 +3098,53 @@ declare class SynthesizerCore {
2561
3098
  * except for the locked controllers.
2562
3099
  */
2563
3100
  resetAllControllers(system?: SynthSystem): void;
2564
- renderAudio(outputs: Float32Array[], reverb: Float32Array[], chorus: Float32Array[], startIndex?: number, sampleCount?: number): void;
2565
- /**
2566
- * Renders the float32 audio data of each channel; buffer size of 128 is recommended.
2567
- * All float arrays must have the same length.
2568
- * @param reverb reverb stereo channels (L, R).
2569
- * @param chorus chorus stereo channels (L, R).
2570
- * @param separate a total of 16 stereo pairs (L, R) for each MIDI channel.
2571
- * @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
2572
- * @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
2573
- */
2574
- renderAudioSplit(reverb: Float32Array[], chorus: Float32Array[], separate: Float32Array[][], startIndex?: number, sampleCount?: number): void;
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;
2575
3148
  /**
2576
3149
  * Gets voices for a preset.
2577
3150
  * @param preset The preset to get voices for.
@@ -2581,10 +3154,12 @@ declare class SynthesizerCore {
2581
3154
  */
2582
3155
  getVoicesForPreset(preset: BasicPreset, midiNote: number, velocity: number): CachedVoiceList;
2583
3156
  clearCache(): void;
3157
+ getInsertionSnapshot(): InsertionProcessorSnapshot;
2584
3158
  /**
2585
3159
  * Copied callback so MIDI channels can call it.
2586
3160
  */
2587
3161
  callEvent<K extends keyof SynthProcessorEventData>(eventName: K, eventData: SynthProcessorEventData[K]): void;
3162
+ protected resetInsertion(): void;
2588
3163
  /**
2589
3164
  * @param volume {number} 0 to 1
2590
3165
  */
@@ -2594,8 +3169,13 @@ declare class SynthesizerCore {
2594
3169
  * @param cents
2595
3170
  */
2596
3171
  protected setMasterTuning(cents: number): void;
3172
+ protected setReverbMacro(macro: number): void;
3173
+ protected setChorusMacro(macro: number): void;
3174
+ protected setDelayMacro(macro: number): void;
2597
3175
  protected getCachedVoice(patch: MIDIPatch, midiNote: number, velocity: number): CachedVoiceList | undefined;
2598
3176
  protected setCachedVoice(patch: MIDIPatch, midiNote: number, velocity: number, voices: CachedVoiceList): void;
3177
+ private registerInsertionProcessor;
3178
+ private processMessageInternal;
2599
3179
  /**
2600
3180
  * Assigns priorities to the voices.
2601
3181
  * Gets the priority of a voice based on its channel and state.
@@ -2607,10 +3187,67 @@ declare class SynthesizerCore {
2607
3187
  private getCachedVoiceIndex;
2608
3188
  }
2609
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
+
2610
3236
  /**
2611
3237
  * This class represents a single MIDI Channel within the synthesizer.
2612
3238
  */
2613
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
+ */
2614
3251
  readonly midiControllers: Int16Array;
2615
3252
  /**
2616
3253
  * An array for the MIDI 2.0 Per-note pitch wheels.
@@ -2627,20 +3264,24 @@ declare class MIDIChannel {
2627
3264
  * Refer to controller_tables.ts for the index definitions.
2628
3265
  */
2629
3266
  readonly customControllers: Float32Array;
2630
- /**
2631
- * The key shift of the channel (in semitones).
2632
- */
2633
- channelTransposeKeyShift: number;
2634
3267
  /**
2635
3268
  * An array of octave tuning values for each note on the channel.
2636
3269
  * Each index corresponds to a note (0 = C, 1 = C#, ..., 11 = B).
2637
3270
  * Note: Repeated every 12 notes.
2638
3271
  */
2639
- channelOctaveTuning: Int8Array;
3272
+ readonly octaveTuning: Int8Array;
3273
+ /**
3274
+ * Parameters for each drum instrument.
3275
+ */
3276
+ readonly drumParams: DrumParameters[];
2640
3277
  /**
2641
3278
  * A system for dynamic modulator assignment for advanced system exclusives.
2642
3279
  */
2643
3280
  sysExModulators: DynamicModulatorSystem;
3281
+ /**
3282
+ * The key shift of the channel (in semitones).
3283
+ */
3284
+ keyShift: number;
2644
3285
  /**
2645
3286
  * Indicates whether this channel is a drum channel.
2646
3287
  */
@@ -2649,6 +3290,26 @@ declare class MIDIChannel {
2649
3290
  * Enables random panning for every note played on this channel.
2650
3291
  */
2651
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;
2652
3313
  /**
2653
3314
  * The current state of the data entry for the channel.
2654
3315
  */
@@ -2672,17 +3333,13 @@ declare class MIDIChannel {
2672
3333
  * Indicates the MIDI system when the preset was locked.
2673
3334
  */
2674
3335
  lockedSystem: SynthSystem;
2675
- /**
2676
- * Indicates whether the GS NRPN parameters are enabled for this channel.
2677
- */
2678
- lockGSNRPNParams: boolean;
2679
3336
  /**
2680
3337
  * The vibrato settings for the channel.
2681
3338
  * @property depth - Depth of the vibrato effect in cents.
2682
3339
  * @property delay - Delay before the vibrato effect starts (in seconds).
2683
3340
  * @property rate - Rate of the vibrato oscillation (in Hz).
2684
3341
  */
2685
- channelVibrato: {
3342
+ readonly channelVibrato: {
2686
3343
  delay: number;
2687
3344
  depth: number;
2688
3345
  rate: number;
@@ -2701,6 +3358,11 @@ declare class MIDIChannel {
2701
3358
  * The channel's number (0-based index)
2702
3359
  */
2703
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;
2704
3366
  /**
2705
3367
  * Core synthesis engine.
2706
3368
  */
@@ -2752,7 +3414,7 @@ declare class MIDIChannel {
2752
3414
  * @param dataValue The value to set for the data entry coarse controller (0-127).
2753
3415
  */
2754
3416
  dataEntryCoarse: typeof dataEntryCoarse;
2755
- readonly renderVoice: (voice: Voice, timeNow: number, outputL: Float32Array<ArrayBufferLike>, outputR: Float32Array<ArrayBufferLike>, reverbL: Float32Array<ArrayBufferLike>, reverbR: Float32Array<ArrayBufferLike>, chorusL: Float32Array<ArrayBufferLike>, chorusR: Float32Array<ArrayBufferLike>, startIndex: number, sampleCount: number) => void;
3417
+ readonly renderVoice: (voice: Voice, timeNow: number, outputL: Float32Array<ArrayBufferLike>, outputR: Float32Array<ArrayBufferLike>, startIndex: number, sampleCount: number) => void;
2756
3418
  /**
2757
3419
  * Per-note pitch wheel mode uses the pitchWheels table as source
2758
3420
  * instead of the regular entry in the midiControllers table.
@@ -2877,17 +3539,6 @@ declare class MIDIChannel {
2877
3539
  * @param drums
2878
3540
  */
2879
3541
  setGSDrums(drums: boolean): void;
2880
- /**
2881
- * Sets a custom vibrato.
2882
- * @param depth In cents.
2883
- * @param rate In Hertz.
2884
- * @param delay seconds.
2885
- */
2886
- setVibrato(depth: number, rate: number, delay: number): void;
2887
- /**
2888
- * Disables and locks all GS NPRN parameters, including the custom vibrato.
2889
- */
2890
- disableAndLockGSNRPN(): void;
2891
3542
  resetGeneratorOverrides(): void;
2892
3543
  setGeneratorOverride(gen: GeneratorType, value: number, realtime?: boolean): void;
2893
3544
  resetGeneratorOffsets(): void;
@@ -2912,6 +3563,8 @@ declare class MIDIChannel {
2912
3563
  * Sends this channel's property
2913
3564
  */
2914
3565
  sendChannelProperty(): void;
3566
+ protected resetDrumParams(): void;
3567
+ protected resetVibratoParams(): void;
2915
3568
  protected computeModulatorsAll(sourceUsesCC: -1 | 0 | 1, sourceIndex: number): void;
2916
3569
  protected setBankMSB(bankMSB: number): void;
2917
3570
  protected setBankLSB(bankLSB: number): void;
@@ -2942,23 +3595,84 @@ declare class SpessaSynthProcessor {
2942
3595
  /**
2943
3596
  * Renders float32 audio data to stereo outputs; buffer size of 128 is recommended.
2944
3597
  * All float arrays must have the same length.
2945
- * @param outputs output stereo channels (L, R).
2946
- * @param reverb reverb stereo channels (L, R).
2947
- * @param chorus chorus stereo channels (L, R).
3598
+ * @param left the left output channel.
3599
+ * @param right the right output channel.
2948
3600
  * @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
2949
3601
  * @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
2950
3602
  */
2951
- readonly renderAudio: (outputs: Float32Array[], reverb: Float32Array[], chorus: Float32Array[], startIndex?: number, sampleCount?: number) => void;
3603
+ readonly process: (left: Float32Array, right: Float32Array, startIndex?: number, sampleCount?: number) => void;
2952
3604
  /**
2953
- * Renders the float32 audio data of each channel; buffer size of 128 is recommended.
3605
+ * Renders float32 audio data to stereo outputs; buffer size of 128 is recommended.
2954
3606
  * All float arrays must have the same length.
2955
- * @param reverbChannels reverb stereo channels (L, R).
2956
- * @param chorusChannels chorus stereo channels (L, R).
2957
- * @param separateChannels a total of 16 stereo pairs (L, R) for each MIDI channel.
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.
2958
3610
  * @param startIndex start offset of the passed arrays, rendering starts at this index, defaults to 0.
2959
3611
  * @param sampleCount the length of the rendered buffer, defaults to float32array length - startOffset.
2960
3612
  */
2961
- readonly renderAudioSplit: (reverb: Float32Array[], chorus: Float32Array[], separate: Float32Array[][], startIndex?: number, sampleCount?: number) => void;
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;
2962
3676
  /**
2963
3677
  * Core synthesis engine.
2964
3678
  */
@@ -3001,6 +3715,18 @@ declare class SpessaSynthProcessor {
3001
3715
  * The current time of the synthesizer, in seconds. You probably should not modify this directly.
3002
3716
  */
3003
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;
3004
3730
  /**
3005
3731
  * The sound bank manager, which manages all sound banks and presets.
3006
3732
  */
@@ -3009,6 +3735,29 @@ declare class SpessaSynthProcessor {
3009
3735
  * Handles the custom key overrides: velocity and preset
3010
3736
  */
3011
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;
3012
3761
  /**
3013
3762
  * A handler for missing presets during program change. By default, it warns to console.
3014
3763
  * @param patch The MIDI patch that was requested.
@@ -3016,12 +3765,6 @@ declare class SpessaSynthProcessor {
3016
3765
  * @returns If a BasicPreset instance is returned, it will be used by the channel.
3017
3766
  */
3018
3767
  onMissingPreset: (patch: MIDIPatch, system: SynthSystem) => BasicPreset | undefined;
3019
- /**
3020
- * Executes a system exclusive message for the synthesizer.
3021
- * @param syx The system exclusive message as an array of bytes.
3022
- * @param channelOffset The channel offset to apply (default is 0).
3023
- */
3024
- systemExclusive(syx: SysExAcceptedArray, channelOffset?: number): void;
3025
3768
  /**
3026
3769
  * Sets a master parameter of the synthesizer.
3027
3770
  * @param type The type of the master parameter to set.
@@ -3053,6 +3796,10 @@ declare class SpessaSynthProcessor {
3053
3796
  * Gets a synthesizer snapshot from this processor instance.
3054
3797
  */
3055
3798
  getSnapshot(): SynthesizerSnapshot;
3799
+ /**
3800
+ * @internal
3801
+ */
3802
+ getInsertionSnapshot(): InsertionProcessorSnapshot;
3056
3803
  /**
3057
3804
  * Sets the embedded sound bank.
3058
3805
  * @param bank The sound bank file to set.
@@ -3071,68 +3818,12 @@ declare class SpessaSynthProcessor {
3071
3818
  * This is irreversible, so use with caution.
3072
3819
  */
3073
3820
  destroySynthProcessor(): void;
3074
- /**
3075
- * Executes a MIDI controller change message on the specified channel.
3076
- * @param channel The MIDI channel to change the controller on.
3077
- * @param controllerNumber The MIDI controller number to change.
3078
- * @param controllerValue The value to set the controller to.
3079
- */
3080
- controllerChange(channel: number, controllerNumber: MIDIController, controllerValue: number): void;
3081
- /**
3082
- * Executes a MIDI Note-on message on the specified channel.
3083
- * @param channel The MIDI channel to send the note on.
3084
- * @param midiNote The MIDI note number to play.
3085
- * @param velocity The velocity of the note, from 0 to 127.
3086
- * @remarks
3087
- * If the velocity is 0, it will be treated as a Note-off message.
3088
- */
3089
- noteOn(channel: number, midiNote: number, velocity: number): void;
3090
- /**
3091
- * Executes a MIDI Note-off message on the specified channel.
3092
- * @param channel The MIDI channel to send the note off.
3093
- * @param midiNote The MIDI note number to stop playing.
3094
- */
3095
- noteOff(channel: number, midiNote: number): void;
3096
- /**
3097
- * Executes a MIDI Poly Pressure (Aftertouch) message on the specified channel.
3098
- * @param channel The MIDI channel to send the poly pressure on.
3099
- * @param midiNote The MIDI note number to apply the pressure to.
3100
- * @param pressure The pressure value, from 0 to 127.
3101
- */
3102
- polyPressure(channel: number, midiNote: number, pressure: number): void;
3103
- /**
3104
- * Executes a MIDI Channel Pressure (Aftertouch) message on the specified channel.
3105
- * @param channel The MIDI channel to send the channel pressure on.
3106
- * @param pressure The pressure value, from 0 to 127.
3107
- */
3108
- channelPressure(channel: number, pressure: number): void;
3109
- /**
3110
- * Executes a MIDI Pitch Wheel message on the specified channel.
3111
- * @param channel The MIDI channel to send the pitch wheel on.
3112
- * @param pitch The new pitch value: 0-16384
3113
- * @param midiNote The MIDI note number, pass -1 for the regular pitch wheel
3114
- */
3115
- pitchWheel(channel: number, pitch: number, midiNote?: number): void;
3116
- /**
3117
- * Executes a MIDI Program Change message on the specified channel.
3118
- * @param channel The MIDI channel to send the program change on.
3119
- * @param programNumber The program number to change to, from 0 to 127.
3120
- */
3121
- programChange(channel: number, programNumber: number): void;
3122
3821
  /**
3123
3822
  * DEPRECATED, does nothing!
3124
3823
  * @param amount
3125
3824
  * @deprecated
3126
3825
  */
3127
3826
  killVoices(amount: number): void;
3128
- /**
3129
- * Processes a raw MIDI message.
3130
- * @param message The message to process.
3131
- * @param channelOffset The channel offset for the message.
3132
- * @param force If true, forces the message to be processed.
3133
- * @param options Additional options for scheduling the message.
3134
- */
3135
- processMessage(message: Uint8Array | number[], channelOffset?: number, force?: boolean, options?: SynthMethodOptions): void;
3136
3827
  /**
3137
3828
  * Clears the synthesizer's voice cache.
3138
3829
  */
@@ -3185,10 +3876,6 @@ declare class ChannelSnapshot {
3185
3876
  * Array of custom (not SF2) control values such as RPN pitch tuning, transpose, modulation depth, etc.
3186
3877
  */
3187
3878
  customControllers: Float32Array;
3188
- /**
3189
- * Indicates whether the channel vibrato is locked.
3190
- */
3191
- lockVibrato: boolean;
3192
3879
  /**
3193
3880
  * The channel's vibrato settings.
3194
3881
  * @property depth Vibrato depth, in gain.
@@ -3203,11 +3890,15 @@ declare class ChannelSnapshot {
3203
3890
  /**
3204
3891
  * Key shift for the channel.
3205
3892
  */
3206
- channelTransposeKeyShift: number;
3893
+ keyShift: number;
3207
3894
  /**
3208
3895
  * The channel's octave tuning in cents.
3209
3896
  */
3210
- channelOctaveTuning: Int8Array;
3897
+ octaveTuning: Int8Array;
3898
+ /**
3899
+ * Parameters for each drum instrument.
3900
+ */
3901
+ drumParams: DrumParameters[];
3211
3902
  /**
3212
3903
  * Indicates whether the channel is muted.
3213
3904
  */
@@ -3220,11 +3911,11 @@ declare class ChannelSnapshot {
3220
3911
  * The channel number this snapshot represents.
3221
3912
  */
3222
3913
  channelNumber: number;
3223
- constructor(patch: MIDIPatchNamed, lockPreset: boolean, lockedSystem: SynthSystem, midiControllers: Int16Array, lockedControllers: boolean[], customControllers: Float32Array, lockVibrato: boolean, channelVibrato: {
3914
+ constructor(patch: MIDIPatchNamed, lockPreset: boolean, lockedSystem: SynthSystem, midiControllers: Int16Array, lockedControllers: boolean[], customControllers: Float32Array, channelVibrato: {
3224
3915
  delay: number;
3225
3916
  depth: number;
3226
3917
  rate: number;
3227
- }, channelTransposeKeyShift: number, channelOctaveTuning: Int8Array, isMuted: boolean, drumChannel: boolean, channelNumber: number);
3918
+ }, channelTransposeKeyShift: number, channelOctaveTuning: Int8Array, drumParams: DrumParameters[], isMuted: boolean, drumChannel: boolean, channelNumber: number);
3228
3919
  /**
3229
3920
  * Creates a copy of existing snapshot.
3230
3921
  * @param snapshot The snapshot to create a copy from.
@@ -3256,7 +3947,11 @@ declare class SynthesizerSnapshot {
3256
3947
  */
3257
3948
  keyMappings: (KeyModifier | undefined)[][];
3258
3949
  masterParameters: MasterParameterType;
3259
- constructor(channelSnapshots: ChannelSnapshot[], masterParameters: MasterParameterType, keyMappings: (KeyModifier | undefined)[][]);
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);
3260
3955
  /**
3261
3956
  * Creates a new synthesizer snapshot from the given SpessaSynthProcessor.
3262
3957
  * @param processor the processor to take a snapshot of.
@@ -3275,6 +3970,18 @@ declare class SynthesizerSnapshot {
3275
3970
  apply(processor: SpessaSynthProcessor): void;
3276
3971
  }
3277
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
+
3278
3985
  declare class MIDITrack {
3279
3986
  /**
3280
3987
  * The name of this track.
@@ -3298,8 +4005,15 @@ declare class MIDITrack {
3298
4005
  * Adds an event to the track.
3299
4006
  * @param event The event to add.
3300
4007
  * @param index The index at which to add this event.
4008
+ * @deprecated Use addEvents instead
3301
4009
  */
3302
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;
3303
4017
  /**
3304
4018
  * Removes an event from the track.
3305
4019
  * @param index The index of the event to remove.
@@ -3484,11 +4198,15 @@ declare class BasicMIDI {
3484
4198
  * Allows easy editing of the file by removing channels, changing programs,
3485
4199
  * changing controllers and transposing channels. Note that this modifies the MIDI *in-place*.
3486
4200
  * @param desiredProgramChanges - The programs to set on given channels.
3487
- * @param desiredControllerChanges - The controllers to set on given channels.
3488
- * @param desiredChannelsToClear - The channels to remove from the sequence.
3489
- * @param desiredChannelsToTranspose - The channels to transpose.
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.
3490
4208
  */
3491
- modify(desiredProgramChanges?: DesiredProgramChange[], desiredControllerChanges?: DesiredControllerChange[], desiredChannelsToClear?: number[], desiredChannelsToTranspose?: DesiredChannelTranspose[]): void;
4209
+ modify({ programChanges, controllerChanges, channelsToClear, channelsToTranspose, clearDrumParams, reverbParams, chorusParams, delayParams, insertionParams }: ModifyMIDIOptions): void;
3492
4210
  /**
3493
4211
  * Modifies the sequence *in-place* according to the locked presets and controllers in the given snapshot.
3494
4212
  * @param snapshot the snapshot to apply.
@@ -4303,24 +5021,6 @@ declare class SpessaSynthSequencer {
4303
5021
  protected sendMIDIPitchWheel(channel: number, pitch: number): void;
4304
5022
  }
4305
5023
 
4306
- declare const NON_CC_INDEX_OFFSET = 128;
4307
- declare const CONTROLLER_TABLE_SIZE = 147;
4308
- /**
4309
- * An array with the default MIDI controller values. Note that these are 14-bit, not 7-bit.
4310
- */
4311
- declare const defaultMIDIControllerValues: Int16Array<ArrayBuffer>;
4312
- declare const setResetValue: (i: MIDIController, v: number) => number;
4313
- declare const CUSTOM_CONTROLLER_TABLE_SIZE: number;
4314
- declare const customResetArray: Float32Array<ArrayBuffer>;
4315
-
4316
- declare const DEFAULT_MASTER_PARAMETERS: MasterParameterType;
4317
-
4318
- /**
4319
- * Default MIDI drum channel.
4320
- */
4321
- declare const DEFAULT_PERCUSSION = 9;
4322
- declare const ALL_CHANNELS_OR_DIFFERENT_ACTION = -1;
4323
-
4324
5024
  declare class SoundBankLoader {
4325
5025
  /**
4326
5026
  * Loads a sound bank from a file buffer.
@@ -4331,4 +5031,4 @@ declare class SoundBankLoader {
4331
5031
  private static loadDLS;
4332
5032
  }
4333
5033
 
4334
- 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 };