spessasynth_core 4.4.9 → 4.4.11
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 +5 -3
- package/dist/index.d.ts +1134 -878
- package/dist/index.js +7484 -2438
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -330,34 +330,35 @@ export declare const GeneratorTypes: Readonly<{
|
|
|
330
330
|
readonly exclusiveClass: 57;
|
|
331
331
|
readonly overridingRootKey: 58;
|
|
332
332
|
readonly endOper: 60;
|
|
333
|
-
readonly
|
|
334
|
-
readonly
|
|
335
|
-
readonly
|
|
333
|
+
readonly filterType: 61;
|
|
334
|
+
readonly maxFilterFc: 62;
|
|
335
|
+
readonly filterQOffset: 63;
|
|
336
336
|
readonly vibLfoToFilterFc: 64;
|
|
337
337
|
readonly vibLfoToVolume: 65;
|
|
338
|
-
readonly
|
|
339
|
-
readonly
|
|
340
|
-
readonly
|
|
341
|
-
readonly
|
|
342
|
-
readonly
|
|
343
|
-
readonly
|
|
344
|
-
readonly
|
|
345
|
-
readonly
|
|
346
|
-
readonly
|
|
347
|
-
readonly
|
|
348
|
-
readonly
|
|
349
|
-
readonly
|
|
350
|
-
readonly
|
|
351
|
-
readonly
|
|
352
|
-
readonly
|
|
353
|
-
readonly
|
|
354
|
-
readonly
|
|
355
|
-
readonly
|
|
356
|
-
readonly
|
|
357
|
-
readonly
|
|
358
|
-
readonly
|
|
359
|
-
readonly
|
|
360
|
-
readonly
|
|
338
|
+
readonly modLfoToAmplitude: 66;
|
|
339
|
+
readonly vibLfoToAmplitude: 67;
|
|
340
|
+
readonly fadeModLFO: 68;
|
|
341
|
+
readonly fadeVibLFO: 69;
|
|
342
|
+
readonly modLfoWaveform: 70;
|
|
343
|
+
readonly vibLfoWaveform: 71;
|
|
344
|
+
readonly modLfoStartPhase: 72;
|
|
345
|
+
readonly vibLfoStartPhase: 73;
|
|
346
|
+
readonly modEnv2ToPitch: 74;
|
|
347
|
+
readonly modEnv2ToFilterFc: 75;
|
|
348
|
+
readonly delayModEnv2: 76;
|
|
349
|
+
readonly attackModEnv2: 77;
|
|
350
|
+
readonly holdModEnv2: 78;
|
|
351
|
+
readonly decayModEnv2: 79;
|
|
352
|
+
readonly sustainModEnv2: 80;
|
|
353
|
+
readonly releaseModEnv2: 81;
|
|
354
|
+
readonly keyNumToModEnv2Hold: 82;
|
|
355
|
+
readonly keyNumToModEnv2Decay: 83;
|
|
356
|
+
readonly decay2VolEnv: 84;
|
|
357
|
+
readonly sustain2VolEnv: 85;
|
|
358
|
+
readonly gain: 86;
|
|
359
|
+
readonly delayVoice: 87;
|
|
360
|
+
readonly ignoreNoteOff: 88;
|
|
361
|
+
readonly variationEffectsSend: 89;
|
|
361
362
|
}>;
|
|
362
363
|
/**
|
|
363
364
|
* @inheritDoc GeneratorTypes
|
|
@@ -465,6 +466,11 @@ export declare const ModulatorControllerSources: {
|
|
|
465
466
|
* The current pitch wheel range (where 1 means 128 semitones) on the channel.
|
|
466
467
|
*/
|
|
467
468
|
readonly pitchWheelRange: 16;
|
|
469
|
+
/**
|
|
470
|
+
* The current modulation depth range (RPN 5) on the channel, where 16 semitones is full.
|
|
471
|
+
* The default modulation wheel to vibrato modulator uses it as its amount source.
|
|
472
|
+
*/
|
|
473
|
+
readonly modulationDepthRange: 17;
|
|
468
474
|
/**
|
|
469
475
|
* Unsupported and discarded if encountered.
|
|
470
476
|
*/
|
|
@@ -498,6 +504,10 @@ export declare const ModulatorCurveTypes: {
|
|
|
498
504
|
* First half is 0, second half is 1.
|
|
499
505
|
*/
|
|
500
506
|
readonly switch: 3;
|
|
507
|
+
/**
|
|
508
|
+
* A curve stored in the bank (SFe only), see {@link CustomCurve}.
|
|
509
|
+
*/
|
|
510
|
+
readonly custom: 4;
|
|
501
511
|
};
|
|
502
512
|
/**
|
|
503
513
|
* @inheritDoc ModulatorCurveTypes
|
|
@@ -527,93 +537,500 @@ export declare const ModulatorTransformTypes: {
|
|
|
527
537
|
*/
|
|
528
538
|
export type ModulatorTransformType = (typeof ModulatorTransformTypes)[keyof typeof ModulatorTransformTypes];
|
|
529
539
|
/**
|
|
530
|
-
*
|
|
540
|
+
* A modulator source curve: how the source's minimum value approaches its maximum value.
|
|
541
|
+
* The four SF2 curves are built in, {@link CustomCurve} is a curve stored in an SFe bank.
|
|
531
542
|
*
|
|
532
543
|
* @group Sound Banks.Modulators
|
|
533
544
|
*/
|
|
534
|
-
export declare class
|
|
535
|
-
/**
|
|
536
|
-
* If this field is set to false, the controller should be mapped with a minimum value of 0 and a maximum value of 1. This is also
|
|
537
|
-
* called Unipolar. Thus, it behaves similar to the Modulation Wheel controller of the MIDI specification.
|
|
538
|
-
*
|
|
539
|
-
* If this field is set to true, the controller should be mapped with a minimum value of -1 and a maximum value of 1. This is also
|
|
540
|
-
* called Bipolar. Thus, it behaves similar to the Pitch Wheel controller of the MIDI specification.
|
|
541
|
-
*/
|
|
542
|
-
isBipolar: boolean;
|
|
543
|
-
/**
|
|
544
|
-
* If this field is set true, the direction of the controller should be from the maximum value to the minimum value. So, for
|
|
545
|
-
* example, if the controller source is Key Number, then a Key Number value of 0 corresponds to the maximum possible
|
|
546
|
-
* controller output, and the Key Number value of 127 corresponds to the minimum possible controller output.
|
|
547
|
-
*/
|
|
548
|
-
isNegative: boolean;
|
|
545
|
+
export declare abstract class ModulatorCurve {
|
|
549
546
|
/**
|
|
550
|
-
* The
|
|
551
|
-
* It can point to one of the MIDI controllers or one of the predefined sources, depending on the 'isCC' flag.
|
|
547
|
+
* The curve type, as written in the source enum.
|
|
552
548
|
*/
|
|
553
|
-
|
|
549
|
+
readonly type: ModulatorCurveType;
|
|
550
|
+
protected constructor(type: ModulatorCurveType);
|
|
554
551
|
/**
|
|
555
|
-
*
|
|
556
|
-
*
|
|
552
|
+
* Checks if two curves give the same output.
|
|
553
|
+
* @param other The curve to compare against.
|
|
557
554
|
*/
|
|
558
|
-
|
|
555
|
+
isIdentical(other: ModulatorCurve): boolean;
|
|
556
|
+
toString(): string;
|
|
559
557
|
/**
|
|
560
|
-
*
|
|
558
|
+
* Computes the tables. The built-in curves call this at the end of their constructor,
|
|
559
|
+
* so it never runs while rendering. Custom curves have no tables.
|
|
561
560
|
*/
|
|
562
|
-
|
|
561
|
+
protected buildTables(): void;
|
|
563
562
|
/**
|
|
564
|
-
*
|
|
565
|
-
* @param
|
|
566
|
-
* @param
|
|
567
|
-
* @
|
|
568
|
-
* @param isBipolar If the source is bipolar (-1 to 1) instead of unipolar (0 to 1).
|
|
569
|
-
* @param isNegative If the direction of the source is flipped.
|
|
563
|
+
* Computes the output of the curve.
|
|
564
|
+
* @param value the source value, 0 to 1, already reversed for the negative direction
|
|
565
|
+
* @param isBipolar if the output is bipolar
|
|
566
|
+
* @returns the output, 0 to 1, or -1 to 1 when bipolar
|
|
570
567
|
*/
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
568
|
+
protected abstract evaluate(value: number, isBipolar: boolean): number;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* All MIDI 1.0 defined status bytes
|
|
572
|
+
*
|
|
573
|
+
* > **Tip**
|
|
574
|
+
* >
|
|
575
|
+
* > Consider reading the [supported MIDI messages](../../docs/extra/midi-implementation.md#supported-midi-messages) for more information.
|
|
576
|
+
*
|
|
577
|
+
* @group MIDI.Protocol
|
|
578
|
+
*/
|
|
579
|
+
export declare const MIDIMessageTypes: {
|
|
580
|
+
readonly noteOff: 128;
|
|
581
|
+
readonly noteOn: 144;
|
|
582
|
+
readonly polyPressure: 160;
|
|
583
|
+
readonly controllerChange: 176;
|
|
584
|
+
readonly programChange: 192;
|
|
585
|
+
readonly channelPressure: 208;
|
|
586
|
+
readonly pitchWheel: 224;
|
|
587
|
+
readonly systemExclusive: 240;
|
|
588
|
+
readonly timecode: 241;
|
|
589
|
+
readonly songPosition: 242;
|
|
590
|
+
readonly songSelect: 243;
|
|
591
|
+
readonly tuneRequest: 246;
|
|
575
592
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
593
|
+
* SMF SysEx escape or continuation event.
|
|
594
|
+
* The data holds the raw bytes that follow the length.
|
|
595
|
+
* https://foldoc.org/pub/misc/midi_file_spec
|
|
578
596
|
*/
|
|
579
|
-
|
|
580
|
-
|
|
597
|
+
readonly systemExclusiveEscape: 247;
|
|
598
|
+
readonly clock: 248;
|
|
599
|
+
readonly start: 250;
|
|
600
|
+
readonly continue: 251;
|
|
601
|
+
readonly stop: 252;
|
|
602
|
+
readonly activeSensing: 254;
|
|
603
|
+
readonly reset: 255;
|
|
604
|
+
readonly sequenceNumber: 0;
|
|
605
|
+
readonly text: 1;
|
|
606
|
+
readonly copyright: 2;
|
|
607
|
+
readonly trackName: 3;
|
|
608
|
+
readonly instrumentName: 4;
|
|
609
|
+
readonly lyric: 5;
|
|
610
|
+
readonly marker: 6;
|
|
611
|
+
readonly cuePoint: 7;
|
|
612
|
+
readonly programName: 8;
|
|
613
|
+
readonly midiChannelPrefix: 32;
|
|
614
|
+
readonly midiPort: 33;
|
|
615
|
+
readonly endOfTrack: 47;
|
|
616
|
+
readonly setTempo: 81;
|
|
617
|
+
readonly smpteOffset: 84;
|
|
618
|
+
readonly timeSignature: 88;
|
|
619
|
+
readonly keySignature: 89;
|
|
620
|
+
readonly sequenceSpecific: 127;
|
|
621
|
+
};
|
|
581
622
|
/**
|
|
582
|
-
*
|
|
623
|
+
* @inheritDoc MIDIMessageTypes
|
|
624
|
+
*
|
|
625
|
+
* @group MIDI.Protocol
|
|
626
|
+
*/
|
|
627
|
+
type MIDIMessageType = (typeof MIDIMessageTypes)[keyof typeof MIDIMessageTypes];
|
|
628
|
+
/**
|
|
629
|
+
* All MIDI 1.0 controller numbers.
|
|
583
630
|
*
|
|
584
631
|
* > **Tip**
|
|
585
632
|
* >
|
|
586
|
-
* > Consider reading [
|
|
633
|
+
* > Consider reading the [default supported controllers](../../docs/extra/midi-implementation.md#default-supported-controllers) for more information.
|
|
587
634
|
*
|
|
588
|
-
* @group
|
|
635
|
+
* @group MIDI.Protocol
|
|
589
636
|
*/
|
|
590
|
-
export declare
|
|
637
|
+
export declare const MIDIControllers: {
|
|
638
|
+
readonly bankSelect: 0;
|
|
639
|
+
readonly modulationWheel: 1;
|
|
640
|
+
readonly breathController: 2;
|
|
641
|
+
readonly undefinedCC3: 3;
|
|
642
|
+
readonly footController: 4;
|
|
643
|
+
readonly portamentoTime: 5;
|
|
644
|
+
readonly dataEntryMSB: 6;
|
|
645
|
+
readonly mainVolume: 7;
|
|
646
|
+
readonly balance: 8;
|
|
647
|
+
readonly undefinedCC9: 9;
|
|
648
|
+
readonly pan: 10;
|
|
649
|
+
readonly expression: 11;
|
|
650
|
+
readonly effectControl1: 12;
|
|
651
|
+
readonly effectControl2: 13;
|
|
652
|
+
readonly undefinedCC14: 14;
|
|
653
|
+
readonly undefinedCC15: 15;
|
|
654
|
+
readonly generalPurposeController1: 16;
|
|
655
|
+
readonly generalPurposeController2: 17;
|
|
656
|
+
readonly generalPurposeController3: 18;
|
|
657
|
+
readonly generalPurposeController4: 19;
|
|
658
|
+
readonly undefinedCC20: 20;
|
|
659
|
+
readonly undefinedCC21: 21;
|
|
660
|
+
readonly undefinedCC22: 22;
|
|
661
|
+
readonly undefinedCC23: 23;
|
|
662
|
+
readonly undefinedCC24: 24;
|
|
663
|
+
readonly undefinedCC25: 25;
|
|
664
|
+
readonly undefinedCC26: 26;
|
|
665
|
+
readonly undefinedCC27: 27;
|
|
666
|
+
readonly undefinedCC28: 28;
|
|
667
|
+
readonly undefinedCC29: 29;
|
|
668
|
+
readonly undefinedCC30: 30;
|
|
669
|
+
readonly undefinedCC31: 31;
|
|
670
|
+
readonly bankSelectLSB: 32;
|
|
671
|
+
readonly modulationWheelLSB: 33;
|
|
672
|
+
readonly breathControllerLSB: 34;
|
|
673
|
+
readonly undefinedCC3LSB: 35;
|
|
674
|
+
readonly footControllerLSB: 36;
|
|
675
|
+
readonly portamentoTimeLSB: 37;
|
|
676
|
+
readonly dataEntryLSB: 38;
|
|
677
|
+
readonly mainVolumeLSB: 39;
|
|
678
|
+
readonly balanceLSB: 40;
|
|
679
|
+
readonly undefinedCC9LSB: 41;
|
|
680
|
+
readonly panLSB: 42;
|
|
681
|
+
readonly expressionLSB: 43;
|
|
682
|
+
readonly effectControl1LSB: 44;
|
|
683
|
+
readonly effectControl2LSB: 45;
|
|
684
|
+
readonly undefinedCC14LSB: 46;
|
|
685
|
+
readonly undefinedCC15LSB: 47;
|
|
686
|
+
readonly generalPurposeController1LSB: 48;
|
|
687
|
+
readonly generalPurposeController2LSB: 49;
|
|
688
|
+
readonly generalPurposeController3LSB: 50;
|
|
689
|
+
readonly generalPurposeController4LSB: 51;
|
|
690
|
+
readonly undefinedCC20LSB: 52;
|
|
691
|
+
readonly undefinedCC21LSB: 53;
|
|
692
|
+
readonly undefinedCC22LSB: 54;
|
|
693
|
+
readonly undefinedCC23LSB: 55;
|
|
694
|
+
readonly undefinedCC24LSB: 56;
|
|
695
|
+
readonly undefinedCC25LSB: 57;
|
|
696
|
+
readonly undefinedCC26LSB: 58;
|
|
697
|
+
readonly undefinedCC27LSB: 59;
|
|
698
|
+
readonly undefinedCC28LSB: 60;
|
|
699
|
+
readonly undefinedCC29LSB: 61;
|
|
700
|
+
readonly undefinedCC30LSB: 62;
|
|
701
|
+
readonly undefinedCC31LSB: 63;
|
|
702
|
+
readonly sustainPedal: 64;
|
|
703
|
+
readonly portamentoOnOff: 65;
|
|
704
|
+
readonly sostenutoPedal: 66;
|
|
705
|
+
readonly softPedal: 67;
|
|
706
|
+
readonly legatoFootswitch: 68;
|
|
707
|
+
readonly hold2Pedal: 69;
|
|
708
|
+
readonly soundVariation: 70;
|
|
709
|
+
readonly filterResonance: 71;
|
|
710
|
+
readonly releaseTime: 72;
|
|
711
|
+
readonly attackTime: 73;
|
|
712
|
+
readonly brightness: 74;
|
|
713
|
+
readonly decayTime: 75;
|
|
714
|
+
readonly vibratoRate: 76;
|
|
715
|
+
readonly vibratoDepth: 77;
|
|
716
|
+
readonly vibratoDelay: 78;
|
|
717
|
+
readonly soundController10: 79;
|
|
718
|
+
readonly generalPurposeController5: 80;
|
|
719
|
+
readonly generalPurposeController6: 81;
|
|
720
|
+
readonly generalPurposeController7: 82;
|
|
721
|
+
readonly generalPurposeController8: 83;
|
|
722
|
+
readonly portamentoControl: 84;
|
|
723
|
+
readonly undefinedCC85: 85;
|
|
724
|
+
readonly undefinedCC86: 86;
|
|
725
|
+
readonly undefinedCC87: 87;
|
|
726
|
+
readonly undefinedCC88: 88;
|
|
727
|
+
readonly undefinedCC89: 89;
|
|
728
|
+
readonly undefinedCC90: 90;
|
|
729
|
+
readonly reverbDepth: 91;
|
|
730
|
+
readonly tremoloDepth: 92;
|
|
731
|
+
readonly chorusDepth: 93;
|
|
732
|
+
readonly variationDepth: 94;
|
|
733
|
+
readonly phaserDepth: 95;
|
|
734
|
+
readonly dataIncrement: 96;
|
|
735
|
+
readonly dataDecrement: 97;
|
|
736
|
+
readonly nonRegisteredParameterLSB: 98;
|
|
737
|
+
readonly nonRegisteredParameterMSB: 99;
|
|
738
|
+
readonly registeredParameterLSB: 100;
|
|
739
|
+
readonly registeredParameterMSB: 101;
|
|
740
|
+
readonly undefinedCC102: 102;
|
|
741
|
+
readonly undefinedCC103: 103;
|
|
742
|
+
readonly undefinedCC104: 104;
|
|
743
|
+
readonly undefinedCC105: 105;
|
|
744
|
+
readonly undefinedCC106: 106;
|
|
745
|
+
readonly undefinedCC107: 107;
|
|
746
|
+
readonly undefinedCC108: 108;
|
|
747
|
+
readonly undefinedCC109: 109;
|
|
748
|
+
readonly undefinedCC110: 110;
|
|
749
|
+
readonly undefinedCC111: 111;
|
|
750
|
+
readonly undefinedCC112: 112;
|
|
751
|
+
readonly undefinedCC113: 113;
|
|
752
|
+
readonly undefinedCC114: 114;
|
|
753
|
+
readonly undefinedCC115: 115;
|
|
754
|
+
readonly undefinedCC116: 116;
|
|
755
|
+
readonly undefinedCC117: 117;
|
|
756
|
+
readonly undefinedCC118: 118;
|
|
757
|
+
readonly undefinedCC119: 119;
|
|
758
|
+
readonly allSoundOff: 120;
|
|
759
|
+
readonly resetAllControllers: 121;
|
|
760
|
+
readonly localControlOnOff: 122;
|
|
761
|
+
readonly allNotesOff: 123;
|
|
762
|
+
readonly omniModeOff: 124;
|
|
763
|
+
readonly omniModeOn: 125;
|
|
764
|
+
readonly monoModeOn: 126;
|
|
765
|
+
readonly polyModeOn: 127;
|
|
591
766
|
/**
|
|
592
|
-
*
|
|
593
|
-
* This is the target parameter that will be changed.
|
|
767
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController1LSB} instead.
|
|
594
768
|
*/
|
|
595
|
-
|
|
769
|
+
readonly undefinedCC16LSB: 48;
|
|
596
770
|
/**
|
|
597
|
-
*
|
|
598
|
-
* This is the multiplier of the transformation.
|
|
771
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController2LSB} instead.
|
|
599
772
|
*/
|
|
600
|
-
|
|
773
|
+
readonly undefinedCC17LSB: 49;
|
|
601
774
|
/**
|
|
602
|
-
*
|
|
603
|
-
* Usually no operation is performed.
|
|
775
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController3LSB} instead.
|
|
604
776
|
*/
|
|
605
|
-
|
|
777
|
+
readonly undefinedCC18LSB: 50;
|
|
606
778
|
/**
|
|
607
|
-
*
|
|
779
|
+
* @deprecated Use {@link MIDIControllers.generalPurposeController4LSB} instead.
|
|
608
780
|
*/
|
|
609
|
-
readonly
|
|
781
|
+
readonly undefinedCC19LSB: 51;
|
|
610
782
|
/**
|
|
611
|
-
*
|
|
783
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC102} instead.
|
|
612
784
|
*/
|
|
613
|
-
readonly
|
|
785
|
+
readonly undefinedCC102LSB: 102;
|
|
614
786
|
/**
|
|
615
|
-
*
|
|
616
|
-
|
|
787
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC103} instead.
|
|
788
|
+
*/
|
|
789
|
+
readonly undefinedCC103LSB: 103;
|
|
790
|
+
/**
|
|
791
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC104} instead.
|
|
792
|
+
*/
|
|
793
|
+
readonly undefinedCC104LSB: 104;
|
|
794
|
+
/**
|
|
795
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC105} instead.
|
|
796
|
+
*/
|
|
797
|
+
readonly undefinedCC105LSB: 105;
|
|
798
|
+
/**
|
|
799
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC106} instead.
|
|
800
|
+
*/
|
|
801
|
+
readonly undefinedCC106LSB: 106;
|
|
802
|
+
/**
|
|
803
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC107} instead.
|
|
804
|
+
*/
|
|
805
|
+
readonly undefinedCC107LSB: 107;
|
|
806
|
+
/**
|
|
807
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC108} instead.
|
|
808
|
+
*/
|
|
809
|
+
readonly undefinedCC108LSB: 108;
|
|
810
|
+
/**
|
|
811
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC109} instead.
|
|
812
|
+
*/
|
|
813
|
+
readonly undefinedCC109LSB: 109;
|
|
814
|
+
/**
|
|
815
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC110} instead.
|
|
816
|
+
*/
|
|
817
|
+
readonly undefinedCC110LSB: 110;
|
|
818
|
+
/**
|
|
819
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC111} instead.
|
|
820
|
+
*/
|
|
821
|
+
readonly undefinedCC111LSB: 111;
|
|
822
|
+
/**
|
|
823
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC112} instead.
|
|
824
|
+
*/
|
|
825
|
+
readonly undefinedCC112LSB: 112;
|
|
826
|
+
/**
|
|
827
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC113} instead.
|
|
828
|
+
*/
|
|
829
|
+
readonly undefinedCC113LSB: 113;
|
|
830
|
+
/**
|
|
831
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC114} instead.
|
|
832
|
+
*/
|
|
833
|
+
readonly undefinedCC114LSB: 114;
|
|
834
|
+
/**
|
|
835
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC115} instead.
|
|
836
|
+
*/
|
|
837
|
+
readonly undefinedCC115LSB: 115;
|
|
838
|
+
/**
|
|
839
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC116} instead.
|
|
840
|
+
*/
|
|
841
|
+
readonly undefinedCC116LSB: 116;
|
|
842
|
+
/**
|
|
843
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC117} instead.
|
|
844
|
+
*/
|
|
845
|
+
readonly undefinedCC117LSB: 117;
|
|
846
|
+
/**
|
|
847
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC118} instead.
|
|
848
|
+
*/
|
|
849
|
+
readonly undefinedCC118LSB: 118;
|
|
850
|
+
/**
|
|
851
|
+
* @deprecated Use {@link MIDIControllers.undefinedCC119} instead.
|
|
852
|
+
*/
|
|
853
|
+
readonly undefinedCC119LSB: 119;
|
|
854
|
+
};
|
|
855
|
+
/**
|
|
856
|
+
* @inheritDoc MIDIControllers
|
|
857
|
+
*
|
|
858
|
+
* @group MIDI.Protocol
|
|
859
|
+
*/
|
|
860
|
+
type MIDIController = (typeof MIDIControllers)[keyof typeof MIDIControllers];
|
|
861
|
+
/**
|
|
862
|
+
* General MIDI Registered Parameter Numbers.
|
|
863
|
+
*
|
|
864
|
+
* @group MIDI.Protocol
|
|
865
|
+
*/
|
|
866
|
+
export declare const RegisteredParameterTypes: {
|
|
867
|
+
readonly pitchWheelRange: 0;
|
|
868
|
+
readonly fineTuning: 1;
|
|
869
|
+
readonly coarseTuning: 2;
|
|
870
|
+
readonly modulationDepth: 5;
|
|
871
|
+
readonly resetParameters: 16383;
|
|
872
|
+
};
|
|
873
|
+
/**
|
|
874
|
+
* Roland GS/ Yamaha XG Non-Registered Parameter Numbers (MSB).
|
|
875
|
+
*
|
|
876
|
+
* Sources:
|
|
877
|
+
* - https://cdn.roland.com/assets/media/pdf/SC-8850_OM.pdf
|
|
878
|
+
* - http://hummer.stanford.edu/sig/doc/classes/MidiOutput/rpn.html
|
|
879
|
+
*
|
|
880
|
+
* @group MIDI.Protocol
|
|
881
|
+
*/
|
|
882
|
+
export declare const NonRegisteredParameterTypesMSB: {
|
|
883
|
+
readonly partParameter: 1;
|
|
884
|
+
readonly drumPitch: 24;
|
|
885
|
+
readonly drumPitchFine: 25;
|
|
886
|
+
readonly drumLevel: 26;
|
|
887
|
+
readonly drumPan: 28;
|
|
888
|
+
readonly drumReverb: 29;
|
|
889
|
+
readonly drumChorus: 30;
|
|
890
|
+
readonly drumVariation: 31;
|
|
891
|
+
readonly awe32: 127;
|
|
892
|
+
readonly SF2: 120;
|
|
893
|
+
};
|
|
894
|
+
/**
|
|
895
|
+
* Roland GS/ Yamaha XG Non-Registered Parameter Numbers (LSB).
|
|
896
|
+
*
|
|
897
|
+
* Sources:
|
|
898
|
+
* - https://cdn.roland.com/assets/media/pdf/SC-8850_OM.pdf
|
|
899
|
+
* - http://hummer.stanford.edu/sig/doc/classes/MidiOutput/rpn.html
|
|
900
|
+
*
|
|
901
|
+
* @group MIDI.Protocol
|
|
902
|
+
*/
|
|
903
|
+
export declare const NonRegisteredParameterTypesLSB: {
|
|
904
|
+
readonly vibratoRate: 8;
|
|
905
|
+
readonly vibratoDepth: 9;
|
|
906
|
+
readonly vibratoDelay: 10;
|
|
907
|
+
readonly tvfCutoffFrequency: 32;
|
|
908
|
+
readonly tvfResonance: 33;
|
|
909
|
+
readonly envelopeAttackTime: 99;
|
|
910
|
+
readonly envelopeDecayTime: 100;
|
|
911
|
+
readonly envelopeReleaseTime: 102;
|
|
912
|
+
};
|
|
913
|
+
/**
|
|
914
|
+
* Represents a single {@link Modulator} source.
|
|
915
|
+
*
|
|
916
|
+
* @group Sound Banks.Modulators
|
|
917
|
+
*/
|
|
918
|
+
export declare class ModulatorSource {
|
|
919
|
+
/**
|
|
920
|
+
* If this field is set to false, the controller should be mapped with a minimum value of 0 and a maximum value of 1. This is also
|
|
921
|
+
* called Unipolar. Thus, it behaves similar to the Modulation Wheel controller of the MIDI specification.
|
|
922
|
+
*
|
|
923
|
+
* If this field is set to true, the controller should be mapped with a minimum value of -1 and a maximum value of 1. This is also
|
|
924
|
+
* called Bipolar. Thus, it behaves similar to the Pitch Wheel controller of the MIDI specification.
|
|
925
|
+
*/
|
|
926
|
+
isBipolar: boolean;
|
|
927
|
+
/**
|
|
928
|
+
* If this field is set true, the direction of the controller should be from the maximum value to the minimum value. So, for
|
|
929
|
+
* example, if the controller source is Key Number, then a Key Number value of 0 corresponds to the maximum possible
|
|
930
|
+
* controller output, and the Key Number value of 127 corresponds to the minimum possible controller output.
|
|
931
|
+
*/
|
|
932
|
+
isNegative: boolean;
|
|
933
|
+
/**
|
|
934
|
+
* The index of the source.
|
|
935
|
+
* It can point to one of the MIDI controllers or one of the predefined sources, depending on the 'isCC' flag.
|
|
936
|
+
*/
|
|
937
|
+
index: ModulatorSourceIndex;
|
|
938
|
+
/**
|
|
939
|
+
* If this field is set to true, the MIDI Controller Palette is selected. The ‘index’ field value corresponds to one of the 128
|
|
940
|
+
* MIDI Continuous Controller messages as defined in the MIDI specification.
|
|
941
|
+
*/
|
|
942
|
+
isCC: boolean;
|
|
943
|
+
private storedCurve;
|
|
944
|
+
/**
|
|
945
|
+
* Creates a new modulator source.
|
|
946
|
+
* @param index The controller or MIDI CC number, see `isCC`.
|
|
947
|
+
* @param curve How the minimum value approaches the maximum value: a curve type or a curve, such as a {@link CustomCurve}.
|
|
948
|
+
* @param isCC If the index is a MIDI CC instead of a general controller.
|
|
949
|
+
* @param isBipolar If the source is bipolar (-1 to 1) instead of unipolar (0 to 1).
|
|
950
|
+
* @param isNegative If the direction of the source is flipped.
|
|
951
|
+
*/
|
|
952
|
+
constructor(index?: ModulatorSourceIndex, curve?: ModulatorCurveType | ModulatorCurve, isCC?: boolean, isBipolar?: boolean, isNegative?: boolean);
|
|
953
|
+
/**
|
|
954
|
+
* The curve, which specifies how the minimum value approaches the maximum value.
|
|
955
|
+
* A {@link CustomCurve} is SFe only. The direction reverses the source value (16384 - x) before the curve.
|
|
956
|
+
*
|
|
957
|
+
* > **Note**
|
|
958
|
+
* >
|
|
959
|
+
* > When the modulator belongs to a zone or the default modulators, setting a {@link CustomCurve} links it
|
|
960
|
+
* > to that element, like a zone's sample. The curve should be in the sound bank's
|
|
961
|
+
* > {@link BasicSoundBank.customCurves}.
|
|
962
|
+
*/
|
|
963
|
+
get curve(): ModulatorCurve;
|
|
964
|
+
set curve(curve: ModulatorCurve);
|
|
965
|
+
/**
|
|
966
|
+
* The curve type. Setting it selects that built-in curve.
|
|
967
|
+
* A custom type without a {@link CustomCurve} outputs 0.
|
|
968
|
+
*/
|
|
969
|
+
get curveType(): ModulatorCurveType;
|
|
970
|
+
set curveType(type: ModulatorCurveType);
|
|
971
|
+
private get sourceName();
|
|
972
|
+
/**
|
|
973
|
+
* Copies a modulator source, with the same curve.
|
|
974
|
+
* A source belongs to one modulator, so use a copy to build another modulator from an existing one's source.
|
|
975
|
+
*
|
|
976
|
+
* > **Note**
|
|
977
|
+
* >
|
|
978
|
+
* > The custom curves of {@link SPESSASYNTH_DEFAULT_MODULATORS} are shared by every bank and can't be linked,
|
|
979
|
+
* > so a copy of such a source gets a new copy of the curve. Add it to the sound bank's
|
|
980
|
+
* > {@link BasicSoundBank.customCurves} like any other curve.
|
|
981
|
+
*
|
|
982
|
+
* @param source The source to copy from.
|
|
983
|
+
* @returns the copied source.
|
|
984
|
+
*/
|
|
985
|
+
static copyFrom(source: ModulatorSource): ModulatorSource;
|
|
986
|
+
toString(): string;
|
|
987
|
+
/**
|
|
988
|
+
* Checks if the source is identical to another source, per SF2 definition.
|
|
989
|
+
* @param source The source to compare against.
|
|
990
|
+
*/
|
|
991
|
+
isIdentical(source: ModulatorSource): boolean;
|
|
992
|
+
/**
|
|
993
|
+
* Checks if the source is a given MIDI Controller.
|
|
994
|
+
* @param controller The controller to check.
|
|
995
|
+
*/
|
|
996
|
+
isController(controller: MIDIController): boolean;
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* This class represents a single modulator (map from a source to a given synthesis parameter).
|
|
1000
|
+
*
|
|
1001
|
+
* > **Tip**
|
|
1002
|
+
* >
|
|
1003
|
+
* > Consider reading [Modulator Information](../../../docs/extra/modulator-information.md).
|
|
1004
|
+
*
|
|
1005
|
+
* @group Sound Banks.Modulators
|
|
1006
|
+
*/
|
|
1007
|
+
export declare class Modulator {
|
|
1008
|
+
/**
|
|
1009
|
+
* The destination generator for this modulator.
|
|
1010
|
+
* This is the target parameter that will be changed.
|
|
1011
|
+
*/
|
|
1012
|
+
destination: GeneratorType;
|
|
1013
|
+
/**
|
|
1014
|
+
* The transform amount for this modulator.
|
|
1015
|
+
* This is the multiplier of the transformation.
|
|
1016
|
+
*/
|
|
1017
|
+
transformAmount: number;
|
|
1018
|
+
/**
|
|
1019
|
+
* The transform type for this modulator.
|
|
1020
|
+
* Usually no operation is performed.
|
|
1021
|
+
*/
|
|
1022
|
+
transformType: ModulatorTransformType;
|
|
1023
|
+
/**
|
|
1024
|
+
* The primary source of this modulator.
|
|
1025
|
+
*/
|
|
1026
|
+
readonly primarySource: ModulatorSource;
|
|
1027
|
+
/**
|
|
1028
|
+
* The secondary source of this modulator.
|
|
1029
|
+
*/
|
|
1030
|
+
readonly secondarySource: ModulatorSource;
|
|
1031
|
+
/**
|
|
1032
|
+
* Creates a new modulator.
|
|
1033
|
+
* @param primarySource An optional primary source.
|
|
617
1034
|
* @param secondarySource An optional secondary source.
|
|
618
1035
|
* @param destination An optional destination can be set here.
|
|
619
1036
|
* @param amount An optional amount.
|
|
@@ -637,6 +1054,19 @@ export declare class Modulator {
|
|
|
637
1054
|
static copyFrom(mod: Modulator): Modulator;
|
|
638
1055
|
toString(): string;
|
|
639
1056
|
}
|
|
1057
|
+
/**
|
|
1058
|
+
* The default modulators of a new sound bank: the SFe default modulators (section 7.3 of the SFe specification).
|
|
1059
|
+
*
|
|
1060
|
+
* > **Warning**
|
|
1061
|
+
* >
|
|
1062
|
+
* > This list is for reading and comparing only. Its modulators are frozen and can't be added to a bank or a zone.
|
|
1063
|
+
* > A new bank already holds its own copies, and {@link BasicSoundBank.resetDefaultModulators} brings them back.
|
|
1064
|
+
* > A copy made with {@link Modulator.copyFrom} has its own copies of the custom curves,
|
|
1065
|
+
* > which have to be added to the sound bank with {@link BasicSoundBank.addCustomCurves}.
|
|
1066
|
+
*
|
|
1067
|
+
* @group Sound Banks.Modulators
|
|
1068
|
+
*/
|
|
1069
|
+
export declare const SPESSASYNTH_DEFAULT_MODULATORS: readonly Modulator[];
|
|
640
1070
|
/**
|
|
641
1071
|
* Generator represents a single sound bank parameter.
|
|
642
1072
|
*
|
|
@@ -680,10 +1110,29 @@ export declare class BasicZone {
|
|
|
680
1110
|
* The zone's generators.
|
|
681
1111
|
*/
|
|
682
1112
|
generators: Generator[];
|
|
1113
|
+
private storedModulators;
|
|
683
1114
|
/**
|
|
684
|
-
* The zone's modulators.
|
|
1115
|
+
* The element the custom curves of this zone's modulators are linked to.
|
|
1116
|
+
* Unset for zones created without linking.
|
|
685
1117
|
*/
|
|
686
|
-
|
|
1118
|
+
private curveUser?;
|
|
1119
|
+
/**
|
|
1120
|
+
* The zone's modulators. Use {@link addModulators}, {@link deleteModulator} and {@link setModulators}
|
|
1121
|
+
* to change them, so the custom curves they use stay linked.
|
|
1122
|
+
*
|
|
1123
|
+
* > **Note**
|
|
1124
|
+
* >
|
|
1125
|
+
* > A modulator object belongs to one zone (or to the default modulators) only.
|
|
1126
|
+
* > Adding it to another one throws, add a copy ({@link Modulator.copyFrom}) instead.
|
|
1127
|
+
*
|
|
1128
|
+
* > **Note**
|
|
1129
|
+
* >
|
|
1130
|
+
* > A bank loaded from SF2 or DLS has modulators that are not in the file:
|
|
1131
|
+
* > every CC 71 to resonance modulator gets a CC 71 to gain twin, and SF2 reverb and chorus send amounts
|
|
1132
|
+
* > are scaled. Writing SF2 or DLS undoes both. The written file may differ from the loaded one by a rounded value,
|
|
1133
|
+
* > see the SF2 round trip in the [SFe specification](https://spessasus.github.io/spessasynth_sfe/spec.html#91-conversion-to-soundfont-2).
|
|
1134
|
+
*/
|
|
1135
|
+
get modulators(): readonly Modulator[];
|
|
687
1136
|
/**
|
|
688
1137
|
* True if this zone has a key range explicitly set.
|
|
689
1138
|
*/
|
|
@@ -716,6 +1165,22 @@ export declare class BasicZone {
|
|
|
716
1165
|
* @param validate If the value should be clamped to allowed limits.
|
|
717
1166
|
*/
|
|
718
1167
|
setGenerator(type: GeneratorType, value: number | null, validate?: boolean): void;
|
|
1168
|
+
/**
|
|
1169
|
+
* Adds modulators to the zone and links the custom curves they use.
|
|
1170
|
+
* @param modulators The modulators to add. A modulator can only be in one zone, add a copy to use it again.
|
|
1171
|
+
*/
|
|
1172
|
+
addModulators(...modulators: Modulator[]): void;
|
|
1173
|
+
/**
|
|
1174
|
+
* Deletes a modulator from the zone and unlinks the custom curves it uses.
|
|
1175
|
+
* @param modulator The modulator to delete.
|
|
1176
|
+
* @returns True if the modulator was in this zone.
|
|
1177
|
+
*/
|
|
1178
|
+
deleteModulator(modulator: Modulator): boolean;
|
|
1179
|
+
/**
|
|
1180
|
+
* Replaces all modulators of the zone.
|
|
1181
|
+
* @param modulators The new modulators.
|
|
1182
|
+
*/
|
|
1183
|
+
setModulators(modulators: readonly Modulator[]): void;
|
|
719
1184
|
/**
|
|
720
1185
|
* Gets a generator value.
|
|
721
1186
|
* @param generatorType The generator type.
|
|
@@ -880,10 +1345,13 @@ export declare class MIDIPatchTools {
|
|
|
880
1345
|
* @param patches The {@link MIDIPatchFull} array to select from.
|
|
881
1346
|
* @param patch The {@link MIDIPatch} to select.
|
|
882
1347
|
* @param system The MIDI system to select for.
|
|
1348
|
+
* @param channel10 If the request comes from channel 10 (of any group of 16 channels).
|
|
1349
|
+
* In XG, such a request with the bank MSB 126 that has no exact match falls back to drums instead of melodic presets,
|
|
1350
|
+
* as channel 10 cannot become melodic there.
|
|
883
1351
|
* @returns The selected patch.
|
|
884
1352
|
* @throws Error An error if the array is empty.
|
|
885
1353
|
*/
|
|
886
|
-
static selectPatch<T extends MIDIPatchFull>(patches: T[], patch: MIDIPatch, system: MIDISystem): T;
|
|
1354
|
+
static selectPatch<T extends MIDIPatchFull>(patches: T[], patch: MIDIPatch, system: MIDISystem, channel10?: boolean): T;
|
|
887
1355
|
private static getAnyDrums;
|
|
888
1356
|
}
|
|
889
1357
|
/**
|
|
@@ -948,7 +1416,7 @@ export declare class BasicPreset implements MIDIPatchFull {
|
|
|
948
1416
|
*/
|
|
949
1417
|
delete(): void;
|
|
950
1418
|
/**
|
|
951
|
-
* Links the instruments back to this preset, the inverse of {@link delete}.
|
|
1419
|
+
* Links the instruments and custom curves back to this preset, the inverse of {@link delete}.
|
|
952
1420
|
* Use it to restore a deleted preset, for example when undoing the deletion.
|
|
953
1421
|
* Add the preset back to the sound bank as well.
|
|
954
1422
|
*/
|
|
@@ -987,8 +1455,8 @@ export declare class BasicPreset implements MIDIPatchFull {
|
|
|
987
1455
|
*
|
|
988
1456
|
* > **Note**
|
|
989
1457
|
* >
|
|
990
|
-
* > The `
|
|
991
|
-
* >
|
|
1458
|
+
* > The `initialAttenuation` generator is in true centibels, the same unit as `gain`.
|
|
1459
|
+
* > The `E-mu` attenuation factor of `0.4` is applied when a SoundFont2 file is read and undone when one is written.
|
|
992
1460
|
*
|
|
993
1461
|
* @param midiNote The MIDI note number.
|
|
994
1462
|
* @param velocity The MIDI velocity.
|
|
@@ -1016,16 +1484,100 @@ export declare class BasicPreset implements MIDIPatchFull {
|
|
|
1016
1484
|
toFlattenedInstrument(): BasicInstrument;
|
|
1017
1485
|
}
|
|
1018
1486
|
/**
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1487
|
+
* An element whose modulators can use a {@link CustomCurve}: an instrument, a preset,
|
|
1488
|
+
* or a sound bank (its default modulators).
|
|
1021
1489
|
*
|
|
1022
|
-
*
|
|
1490
|
+
* @group Sound Banks.Modulators
|
|
1491
|
+
*/
|
|
1492
|
+
type CustomCurveUser = BasicInstrument | BasicPreset | BasicSoundBank;
|
|
1493
|
+
/**
|
|
1494
|
+
* A single point of a {@link CustomCurve}.
|
|
1023
1495
|
*
|
|
1024
|
-
*
|
|
1496
|
+
* @group Sound Banks.Modulators
|
|
1497
|
+
*/
|
|
1498
|
+
interface CustomCurvePoint {
|
|
1499
|
+
/**
|
|
1500
|
+
* The source value, 0 to 16,384. A 14-bit source value is 0 to 16,383, and a 7-bit source value `v` is at `v << 7`.
|
|
1501
|
+
* The value 16,384 is the end of the range, so a curve can be defined up to exactly 1.
|
|
1502
|
+
*/
|
|
1503
|
+
x: number;
|
|
1504
|
+
/**
|
|
1505
|
+
* The output, 0 to 16,384. A unipolar source outputs `y / 16384`, a bipolar source `(y - 8192) / 8192`.
|
|
1506
|
+
*/
|
|
1507
|
+
y: number;
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* A modulator source curve stored in an SFe bank (curve type 4).
|
|
1511
|
+
* The value between two points is linearly interpolated.
|
|
1512
|
+
*
|
|
1513
|
+
* The first point should be at `x = 0` and the last at `x = 16384`. `x` never decreases, and two points at the same `x`
|
|
1514
|
+
* make a vertical step.
|
|
1515
|
+
*
|
|
1516
|
+
* > **Tip**
|
|
1517
|
+
* >
|
|
1518
|
+
* > Consider reading about [the SFe format.](../../../docs/extra/sfe-format.md)
|
|
1519
|
+
*
|
|
1520
|
+
* @group Sound Banks.Modulators
|
|
1521
|
+
*/
|
|
1522
|
+
export declare class CustomCurve extends ModulatorCurve {
|
|
1523
|
+
/**
|
|
1524
|
+
* The name of the curve, up to 40 characters are written.
|
|
1525
|
+
*/
|
|
1526
|
+
name: string;
|
|
1527
|
+
/**
|
|
1528
|
+
* The elements that use this curve, one entry for each modulator source using it.
|
|
1529
|
+
* The default modulators of a sound bank are listed as the bank.
|
|
1530
|
+
*
|
|
1531
|
+
* > **Note**
|
|
1532
|
+
* >
|
|
1533
|
+
* > Duplicate entries are allowed since one element can use the same curve multiple times.
|
|
1534
|
+
*/
|
|
1535
|
+
readonly linkedTo: CustomCurveUser[];
|
|
1536
|
+
private storedPoints;
|
|
1537
|
+
private px;
|
|
1538
|
+
private py;
|
|
1539
|
+
private readonly start;
|
|
1540
|
+
private readonly gridUnipolar;
|
|
1541
|
+
private readonly gridBipolar;
|
|
1542
|
+
/**
|
|
1543
|
+
* Creates a new custom curve.
|
|
1544
|
+
* @param points The points, ordered by `x`. At least two are needed.
|
|
1545
|
+
* @param name The name of the curve.
|
|
1546
|
+
*/
|
|
1547
|
+
constructor(points: readonly CustomCurvePoint[], name?: string);
|
|
1548
|
+
/**
|
|
1549
|
+
* The number of modulator sources using this curve.
|
|
1550
|
+
*/
|
|
1551
|
+
get useCount(): number;
|
|
1552
|
+
/**
|
|
1553
|
+
* The curve points, ordered by `x`. They are frozen, use {@link setPoints} to change them.
|
|
1554
|
+
*/
|
|
1555
|
+
get points(): readonly Readonly<CustomCurvePoint>[];
|
|
1556
|
+
private static checkPoints;
|
|
1557
|
+
/**
|
|
1558
|
+
* Replaces the points of the curve. Every modulator using this curve follows the change.
|
|
1559
|
+
* @param points The new points, ordered by `x`. At least two are needed.
|
|
1560
|
+
* @throws Error if the points are invalid. The curve is left unchanged then.
|
|
1561
|
+
*/
|
|
1562
|
+
setPoints(points: readonly CustomCurvePoint[]): void;
|
|
1563
|
+
/**
|
|
1564
|
+
* Checks if two curves have the same points.
|
|
1565
|
+
* @param other The curve to compare against.
|
|
1566
|
+
*/
|
|
1567
|
+
isIdentical(other: ModulatorCurve): boolean;
|
|
1568
|
+
toString(): string;
|
|
1569
|
+
protected evaluate(value: number, isBipolar: boolean): number;
|
|
1570
|
+
private precompute;
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* This module represents a single sound bank as a [SpessaSynth SFe](../../../docs/extra/sfe-format.md) bank.
|
|
1574
|
+
*
|
|
1575
|
+
* **Specifications:**
|
|
1025
1576
|
*
|
|
1026
1577
|
* - [SoundFont2 Specification](http://www.synthfont.com/sfspec24.pdf)
|
|
1027
1578
|
* - [SoundFont3 Description](https://www.fluidsynth.org/wiki/SoundFont3Format)
|
|
1028
1579
|
* - [DLS Level 2 Specification](https://midi.org/dls)
|
|
1580
|
+
* - [SpessaSynth SFe](../../../docs/extra/sfe-format.md)
|
|
1029
1581
|
*
|
|
1030
1582
|
* > **Important**
|
|
1031
1583
|
* >
|
|
@@ -1041,15 +1593,11 @@ export declare class BasicSoundBank {
|
|
|
1041
1593
|
*/
|
|
1042
1594
|
static ready: Promise<void>;
|
|
1043
1595
|
/**
|
|
1044
|
-
* The
|
|
1045
|
-
*
|
|
1046
|
-
*
|
|
1047
|
-
* > **Note**
|
|
1048
|
-
* >
|
|
1049
|
-
* > SF3 or SFOGG files are parsed as `sf2` files, but with compressed samples.
|
|
1050
|
-
* > The type is still `sf2`.
|
|
1596
|
+
* The custom modulator curves of the bank (SFe only), in the order they are written.
|
|
1597
|
+
* Like {@link samples}, every curve a modulator of this bank uses must be in this list.
|
|
1598
|
+
* A new bank holds the curves of its default modulators.
|
|
1051
1599
|
*/
|
|
1052
|
-
|
|
1600
|
+
customCurves: CustomCurve[];
|
|
1053
1601
|
/**
|
|
1054
1602
|
* The metadata of this sound bank.
|
|
1055
1603
|
*/
|
|
@@ -1067,26 +1615,54 @@ export declare class BasicSoundBank {
|
|
|
1067
1615
|
*/
|
|
1068
1616
|
instruments: BasicInstrument[];
|
|
1069
1617
|
/**
|
|
1070
|
-
*
|
|
1618
|
+
* See {@link type}. A reader sets it once it knows how the file is read.
|
|
1619
|
+
*/
|
|
1620
|
+
protected bankType: "sf2" | "dls" | "sfe";
|
|
1621
|
+
private storedDefaultModulators;
|
|
1622
|
+
/**
|
|
1623
|
+
* Creates an empty sound bank instance.
|
|
1624
|
+
* @param type The value to initialize the {@link BasicSoundBank.type} property with.
|
|
1625
|
+
* A new bank is an SFe bank unless told otherwise.
|
|
1626
|
+
* @param defaultModulators If the bank starts with its own copy of {@link SPESSASYNTH_DEFAULT_MODULATORS}
|
|
1627
|
+
* and their custom curves. A bank without them has no default modulators until some are assigned.
|
|
1628
|
+
*/
|
|
1629
|
+
constructor(type?: "sf2" | "sfe" | "dls", defaultModulators?: boolean);
|
|
1630
|
+
/**
|
|
1631
|
+
* The type of the sound bank that was loaded.
|
|
1632
|
+
* Either `sf2` for SoundFont2/SoundFont3 or `dls` for DownLoadable Sounds or `sfe` for SF-Enhanced.
|
|
1071
1633
|
*
|
|
1072
|
-
* > **
|
|
1634
|
+
* > **Note**
|
|
1073
1635
|
* >
|
|
1074
|
-
* >
|
|
1636
|
+
* > SF3 or SFOGG files are parsed as `sf2` files, but with compressed samples.
|
|
1637
|
+
* > The type is still `sf2`.
|
|
1638
|
+
* > An SFe file from before version 4 is read as SF2, and its type is `sf2` too.
|
|
1075
1639
|
*/
|
|
1076
|
-
|
|
1640
|
+
get type(): "sf2" | "dls" | "sfe";
|
|
1077
1641
|
/**
|
|
1078
|
-
*
|
|
1642
|
+
* Sound bank's default modulators.
|
|
1079
1643
|
*
|
|
1080
1644
|
* > **Tip**
|
|
1081
1645
|
* >
|
|
1082
|
-
* > Consider reading
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
*
|
|
1087
|
-
*
|
|
1646
|
+
* > Consider reading [default modulators](../../../docs/extra/modulator-information.md#default-modulators).
|
|
1647
|
+
*
|
|
1648
|
+
* > **Warning**
|
|
1649
|
+
* >
|
|
1650
|
+
* > The envelope time modulators (CC 72, 73 and 75) use custom curves, which only SFe can store.
|
|
1651
|
+
* > If this list is changed and the bank is written as plain SF2, they are left out of the written list,
|
|
1652
|
+
* > and added back when it is loaded unless the list has another CC 72, 73 or 75 modulator.
|
|
1653
|
+
*
|
|
1654
|
+
* > **Note**
|
|
1655
|
+
* >
|
|
1656
|
+
* > Assign a new list to change it, so the custom curves it uses stay linked.
|
|
1657
|
+
* > A modulator can only be in one list or zone, assign copies to reuse them.
|
|
1658
|
+
*
|
|
1659
|
+
* > **Note**
|
|
1660
|
+
* >
|
|
1661
|
+
* > A bank loaded from SF2 or DLS has modulators here that are not in the file,
|
|
1662
|
+
* > see {@link BasicZone.modulators}.
|
|
1088
1663
|
*/
|
|
1089
|
-
|
|
1664
|
+
get defaultModulators(): readonly Modulator[];
|
|
1665
|
+
set defaultModulators(modulators: readonly Modulator[]);
|
|
1090
1666
|
private _isXGBank;
|
|
1091
1667
|
/**
|
|
1092
1668
|
* Checks for XG drum sets and considers if this sound bank is XG.
|
|
@@ -1105,6 +1681,13 @@ export declare class BasicSoundBank {
|
|
|
1105
1681
|
* added on top.
|
|
1106
1682
|
*/
|
|
1107
1683
|
static mergeSoundBanks(...soundBanks: BasicSoundBank[]): BasicSoundBank;
|
|
1684
|
+
/**
|
|
1685
|
+
* Copies a given sound bank, cloning all presets, instruments and samples.
|
|
1686
|
+
* The sample data is shared with the original, not copied.
|
|
1687
|
+
* Elements sharing a name are all copied, the repeats get a free name like `Piano-1`.
|
|
1688
|
+
* @param bank The sound bank to copy.
|
|
1689
|
+
*/
|
|
1690
|
+
static copyFrom(bank: BasicSoundBank): BasicSoundBank;
|
|
1108
1691
|
/**
|
|
1109
1692
|
* Creates a simple SF2 file with a single saw wave preset.
|
|
1110
1693
|
* Useful for testing synthesizer's functionality without providing a file.
|
|
@@ -1112,17 +1695,26 @@ export declare class BasicSoundBank {
|
|
|
1112
1695
|
*/
|
|
1113
1696
|
static getSampleSoundBankFile(): ArrayBuffer;
|
|
1114
1697
|
/**
|
|
1115
|
-
*
|
|
1116
|
-
*
|
|
1117
|
-
* Elements sharing a name are all copied, the repeats get a free name like `Piano-1`.
|
|
1118
|
-
* @param bank The sound bank to copy.
|
|
1698
|
+
* Replaces the default modulators with new copies of {@link SPESSASYNTH_DEFAULT_MODULATORS}
|
|
1699
|
+
* and adds the custom curves they use. The curves that only the old list used are removed.
|
|
1119
1700
|
*/
|
|
1120
|
-
|
|
1701
|
+
resetDefaultModulators(): void;
|
|
1121
1702
|
/**
|
|
1122
1703
|
* Adds complete presets along with their associated instruments and samples into this sound bank.
|
|
1123
1704
|
* @param presets The presets to add.
|
|
1124
1705
|
*/
|
|
1125
1706
|
addCompletePresets(presets: BasicPreset[]): void;
|
|
1707
|
+
/**
|
|
1708
|
+
* Adds {@link CustomCurve}s to this sound bank. Curves already in the bank are skipped.
|
|
1709
|
+
* @param curves The curves to add.
|
|
1710
|
+
*/
|
|
1711
|
+
addCustomCurves(...curves: CustomCurve[]): void;
|
|
1712
|
+
/**
|
|
1713
|
+
* Deletes a given custom curve from the sound bank.
|
|
1714
|
+
* @param curve The curve to delete.
|
|
1715
|
+
* @throws Error if a modulator still uses the curve.
|
|
1716
|
+
*/
|
|
1717
|
+
deleteCustomCurve(curve: CustomCurve): void;
|
|
1126
1718
|
/**
|
|
1127
1719
|
* Sets the sound bank's sample format _in place_.
|
|
1128
1720
|
*
|
|
@@ -1167,13 +1759,22 @@ export declare class BasicSoundBank {
|
|
|
1167
1759
|
*/
|
|
1168
1760
|
writeSF2(writeOptions?: Partial<SoundFont2WriteOptions>): ArrayBuffer;
|
|
1169
1761
|
/**
|
|
1170
|
-
*
|
|
1762
|
+
* Counts what the sound bank would lose if written as a plain SF2 file and read back:
|
|
1763
|
+
* the SFe generators, modulators, custom curves, alternating loops and bank LSBs.
|
|
1764
|
+
* What the SF2 reader recreates on its own is not counted, so an unchanged SF2 bank has no losses.
|
|
1765
|
+
* The one exception is an SF2 file that already has a `sampleModes` of 4: it plays as an alternating loop,
|
|
1766
|
+
* and it is counted since {@link writeSF2} leaves it out.
|
|
1767
|
+
* @returns The losses. All zeros means {@link writeSF2} keeps everything.
|
|
1768
|
+
*/
|
|
1769
|
+
getSF2Losses(): SF2Losses;
|
|
1770
|
+
/**
|
|
1771
|
+
* Writes the sound bank as an [SpessaSynth SFe](../../../docs/extra/sfe-format.md) file.
|
|
1171
1772
|
* This enables features such as bank LSB and RIFF64.
|
|
1172
1773
|
* Note that spessasynth is currently the only software that can read these files.
|
|
1173
1774
|
* @param writeOptions Options for writing the file.
|
|
1174
1775
|
* @returns The binary representation of the file.
|
|
1175
1776
|
*/
|
|
1176
|
-
|
|
1777
|
+
writeSFe(writeOptions?: Partial<SFeWriteOptions>): ArrayBuffer;
|
|
1177
1778
|
/**
|
|
1178
1779
|
* Adds {@link BasicPreset}s to this sound bank.
|
|
1179
1780
|
* @param presets The presets to add.
|
|
@@ -1254,7 +1855,8 @@ export declare class BasicSoundBank {
|
|
|
1254
1855
|
*/
|
|
1255
1856
|
trim<T extends MIDIPatchFull>(presetData: PresetsWithKeyCombinations<T>): void;
|
|
1256
1857
|
/**
|
|
1257
|
-
* Removes all {@link BasicSample}s and {@link BasicInstrument}s not used by any {@link BasicPreset}
|
|
1858
|
+
* Removes all {@link BasicSample}s and {@link BasicInstrument}s not used by any {@link BasicPreset},
|
|
1859
|
+
* and all {@link customCurves} no modulator uses.
|
|
1258
1860
|
*/
|
|
1259
1861
|
removeUnusedElements(): void;
|
|
1260
1862
|
/**
|
|
@@ -1410,6 +2012,10 @@ export declare class BasicInstrument {
|
|
|
1410
2012
|
* > Duplicate entries are allowed since one preset can use the same instrument multiple times.
|
|
1411
2013
|
*/
|
|
1412
2014
|
readonly linkedTo: BasicPreset[];
|
|
2015
|
+
/**
|
|
2016
|
+
* Creates a new empty instrument.
|
|
2017
|
+
*/
|
|
2018
|
+
constructor();
|
|
1413
2019
|
/**
|
|
1414
2020
|
* How many presets is this instrument used by.
|
|
1415
2021
|
*/
|
|
@@ -1434,7 +2040,7 @@ export declare class BasicInstrument {
|
|
|
1434
2040
|
*/
|
|
1435
2041
|
delete(): void;
|
|
1436
2042
|
/**
|
|
1437
|
-
* Links the samples back to this instrument, the inverse of {@link delete}.
|
|
2043
|
+
* Links the samples and custom curves back to this instrument, the inverse of {@link delete}.
|
|
1438
2044
|
* Use it to restore a deleted instrument, for example when undoing the deletion.
|
|
1439
2045
|
* Add the instrument back to the sound bank as well.
|
|
1440
2046
|
*/
|
|
@@ -1529,516 +2135,173 @@ export declare class BasicSample {
|
|
|
1529
2135
|
/**
|
|
1530
2136
|
* The sample's audio data.
|
|
1531
2137
|
*/
|
|
1532
|
-
protected audioData?: Float32Array;
|
|
1533
|
-
/**
|
|
1534
|
-
* The signed 16-bit little endian PCM data, as read from the file.
|
|
1535
|
-
*/
|
|
1536
|
-
protected s16leData?: Uint8Array;
|
|
1537
|
-
/**
|
|
1538
|
-
* The length in sample points when it is not known from the data,
|
|
1539
|
-
* either a sample without data or a vorbis stream's length that was read once.
|
|
1540
|
-
*/
|
|
1541
|
-
protected cachedLength?: number;
|
|
1542
|
-
/**
|
|
1543
|
-
* The form the data had before it was released or when it was loaded without data.
|
|
1544
|
-
*/
|
|
1545
|
-
protected releasedForm?: SampleStoredData["form"];
|
|
1546
|
-
/**
|
|
1547
|
-
* Creates a new `BasicSample`.
|
|
1548
|
-
*
|
|
1549
|
-
* > **Tip**
|
|
1550
|
-
* >
|
|
1551
|
-
* > For an easier to use constructor, consider using {@link EmptySample} instead.
|
|
1552
|
-
*
|
|
1553
|
-
* @param sampleName The sample's name.
|
|
1554
|
-
* @param sampleRate The sample's rate in Hz.
|
|
1555
|
-
* @param originalKey The sample's pitch as a MIDI note number.
|
|
1556
|
-
* @param pitchCorrection The sample's pitch correction in cents.
|
|
1557
|
-
* @param sampleType The sample's type, one of the {@link SampleTypes}.
|
|
1558
|
-
* @param loopStart The sample's loop start relative to the sample start in sample points.
|
|
1559
|
-
* @param loopEnd The sample's loop end relative to the sample start in sample points. Exclusive.
|
|
1560
|
-
*/
|
|
1561
|
-
constructor(sampleName: string, sampleRate: number, originalKey: number, pitchCorrection: number, sampleType: SampleType, loopStart: number, loopEnd: number);
|
|
1562
|
-
/**
|
|
1563
|
-
* Indicates if the sample contains compressed audio.
|
|
1564
|
-
*/
|
|
1565
|
-
get isCompressed(): boolean;
|
|
1566
|
-
/**
|
|
1567
|
-
* The form the sample stores its data in, see {@link BasicSample.getStoredData}.
|
|
1568
|
-
* A sample without data reports the form it had, or undefined if it never had data.
|
|
1569
|
-
*/
|
|
1570
|
-
get storedForm(): SampleStoredData["form"] | undefined;
|
|
1571
|
-
/**
|
|
1572
|
-
* Indicates if the sample holds any audio data.
|
|
1573
|
-
* A sample loaded with `sampleData: false` or released with {@link BasicSample.releaseData} does not.
|
|
1574
|
-
*/
|
|
1575
|
-
get hasData(): boolean;
|
|
1576
|
-
/**
|
|
1577
|
-
* The sample's length in sample points, known without decoding the data.
|
|
1578
|
-
* Samples without data keep the length they had.
|
|
1579
|
-
*
|
|
1580
|
-
* > **Note**
|
|
1581
|
-
* >
|
|
1582
|
-
* > For compressed samples, it is read from the Ogg page headers, which is exact for well-formed streams.
|
|
1583
|
-
* > A stream with gaps in its granule positions decodes shorter. Once it is decoded,
|
|
1584
|
-
* > the length is the decoded one.
|
|
1585
|
-
*/
|
|
1586
|
-
get sampleLength(): number;
|
|
1587
|
-
/**
|
|
1588
|
-
* If the sample is linked to another sample.
|
|
1589
|
-
*/
|
|
1590
|
-
get isLinked(): boolean;
|
|
1591
|
-
/**
|
|
1592
|
-
* How many instruments is this sample used by.
|
|
1593
|
-
*/
|
|
1594
|
-
get useCount(): number;
|
|
1595
|
-
/**
|
|
1596
|
-
* If the decoded float data is currently held in memory.
|
|
1597
|
-
* Check it before {@link getAudioData} to know if the call has to decode,
|
|
1598
|
-
* then use {@link releaseDecoded} to drop the copy again.
|
|
1599
|
-
*/
|
|
1600
|
-
get isDecoded(): boolean;
|
|
1601
|
-
/**
|
|
1602
|
-
* Get raw data for writing the file, either a compressed bit stream or signed 16-bit little endian PCM data.
|
|
1603
|
-
* @param allowVorbis if vorbis file data is allowed.
|
|
1604
|
-
* @return either s16le or vorbis data.
|
|
1605
|
-
*/
|
|
1606
|
-
getRawData(allowVorbis: boolean): Uint8Array;
|
|
1607
|
-
/**
|
|
1608
|
-
* Gets the sample's data in the form it is stored, without decoding, encoding or copying it.
|
|
1609
|
-
* Use {@link BasicSample.setStoredData} to give it to another sample, for example in another thread.
|
|
1610
|
-
* @returns The stored form and its data.
|
|
1611
|
-
*/
|
|
1612
|
-
getStoredData(): SampleStoredData;
|
|
1613
|
-
/**
|
|
1614
|
-
* Replaces the sample's data with data in a given stored form, without decoding or encoding it.
|
|
1615
|
-
* The sample rate and loop points are not changed.
|
|
1616
|
-
*
|
|
1617
|
-
* > **Note**
|
|
1618
|
-
* >
|
|
1619
|
-
* > s16le and vorbis data is written back unchanged when saving, float32 data is encoded.
|
|
1620
|
-
*
|
|
1621
|
-
* @param stored The stored form and its data, as returned by {@link BasicSample.getStoredData}.
|
|
1622
|
-
*/
|
|
1623
|
-
setStoredData(stored: SampleStoredData): void;
|
|
1624
|
-
/**
|
|
1625
|
-
* Drops all the sample's data. The parameters and {@link BasicSample.sampleLength} stay.
|
|
1626
|
-
* Reading the audio data afterward throws an error until {@link BasicSample.setStoredData} gives it new data.
|
|
1627
|
-
*/
|
|
1628
|
-
releaseData(): void;
|
|
1629
|
-
/**
|
|
1630
|
-
* Drops the decoded float data if the sample can decode it again from its stored s16le or vorbis data.
|
|
1631
|
-
* Replaced data (set with {@link BasicSample.setAudioData}) is kept.
|
|
1632
|
-
* @returns True if the decoded data was dropped.
|
|
1633
|
-
*/
|
|
1634
|
-
releaseDecoded(): boolean;
|
|
1635
|
-
/**
|
|
1636
|
-
* Resamples the audio data _in-place_ to a given sample rate.
|
|
1637
|
-
* @param newSampleRate The new sample rate, in hertz.
|
|
1638
|
-
*/
|
|
1639
|
-
resampleData(newSampleRate: number): void;
|
|
1640
|
-
/**
|
|
1641
|
-
* Sets the sample type and unlinks if needed.
|
|
1642
|
-
* @param type The type to set it to.
|
|
1643
|
-
*/
|
|
1644
|
-
setSampleType(type: SampleType): void;
|
|
1645
|
-
/**
|
|
1646
|
-
* Unlinks the sample from its stereo link if it has any.
|
|
1647
|
-
*/
|
|
1648
|
-
unlinkSample(): void;
|
|
1649
|
-
/**
|
|
1650
|
-
* Links a stereo sample.
|
|
1651
|
-
* @param sample The sample to link to.
|
|
1652
|
-
* @param type Either left, right or linked. The linked sample will be set appropriately as well.
|
|
1653
|
-
*/
|
|
1654
|
-
setLinkedSample(sample: BasicSample, type: SampleType): void;
|
|
1655
|
-
/**
|
|
1656
|
-
* Get the PCM Float32 audio data of this sample.
|
|
1657
|
-
* This either decodes the compressed data or passes the ready sampleData.
|
|
1658
|
-
* @returns The raw audio data.
|
|
1659
|
-
*/
|
|
1660
|
-
getAudioData(): Float32Array;
|
|
1661
|
-
/**
|
|
1662
|
-
* Replaces the audio data *in-place*.
|
|
1663
|
-
* @param audioData The new audio data as Float32.
|
|
1664
|
-
* @param sampleRate The new sample rate, in Hertz.
|
|
1665
|
-
*/
|
|
1666
|
-
setAudioData(audioData: Float32Array, sampleRate: number): void;
|
|
1667
|
-
/**
|
|
1668
|
-
* Replaces the audio with a compressed data sample and flags the sample as compressed.
|
|
1669
|
-
* @param data The new compressed data.
|
|
1670
|
-
*/
|
|
1671
|
-
setCompressedData(data: Uint8Array): void;
|
|
1672
|
-
/**
|
|
1673
|
-
* The error for reading the data of a sample that has none.
|
|
1674
|
-
*/
|
|
1675
|
-
protected noDataError(): Error;
|
|
1676
|
-
/**
|
|
1677
|
-
* Decodes signed 16-bit little endian PCM into float.
|
|
1678
|
-
* @param data The s16le data. It may be a view at any offset.
|
|
1679
|
-
*/
|
|
1680
|
-
protected decodeS16LE(data: Uint8Array): Float32Array<ArrayBuffer>;
|
|
1681
|
-
/**
|
|
1682
|
-
* Encodes s16le sample
|
|
1683
|
-
* @return the encoded data
|
|
1684
|
-
*/
|
|
1685
|
-
protected encodeS16LE(): IndexedByteArray;
|
|
1686
|
-
/**
|
|
1687
|
-
* Decode binary vorbis into a float32 pcm
|
|
1688
|
-
*/
|
|
1689
|
-
protected decodeVorbis(): Float32Array;
|
|
1690
|
-
}
|
|
1691
|
-
/**
|
|
1692
|
-
* A simplified class for creating {@link BasicSample}.
|
|
1693
|
-
*
|
|
1694
|
-
* @group Sound Banks.Samples
|
|
1695
|
-
*/
|
|
1696
|
-
export declare class EmptySample extends BasicSample {
|
|
1697
|
-
constructor();
|
|
1698
|
-
}
|
|
1699
|
-
/**
|
|
1700
|
-
* All MIDI 1.0 defined status bytes
|
|
1701
|
-
*
|
|
1702
|
-
* > **Tip**
|
|
1703
|
-
* >
|
|
1704
|
-
* > Consider reading the [supported MIDI messages](../../docs/extra/midi-implementation.md#supported-midi-messages) for more information.
|
|
1705
|
-
*
|
|
1706
|
-
* @group MIDI.Protocol
|
|
1707
|
-
*/
|
|
1708
|
-
export declare const MIDIMessageTypes: {
|
|
1709
|
-
readonly noteOff: 128;
|
|
1710
|
-
readonly noteOn: 144;
|
|
1711
|
-
readonly polyPressure: 160;
|
|
1712
|
-
readonly controllerChange: 176;
|
|
1713
|
-
readonly programChange: 192;
|
|
1714
|
-
readonly channelPressure: 208;
|
|
1715
|
-
readonly pitchWheel: 224;
|
|
1716
|
-
readonly systemExclusive: 240;
|
|
1717
|
-
readonly timecode: 241;
|
|
1718
|
-
readonly songPosition: 242;
|
|
1719
|
-
readonly songSelect: 243;
|
|
1720
|
-
readonly tuneRequest: 246;
|
|
1721
|
-
/**
|
|
1722
|
-
* SMF SysEx escape or continuation event.
|
|
1723
|
-
* The data holds the raw bytes that follow the length.
|
|
1724
|
-
* https://foldoc.org/pub/misc/midi_file_spec
|
|
1725
|
-
*/
|
|
1726
|
-
readonly systemExclusiveEscape: 247;
|
|
1727
|
-
readonly clock: 248;
|
|
1728
|
-
readonly start: 250;
|
|
1729
|
-
readonly continue: 251;
|
|
1730
|
-
readonly stop: 252;
|
|
1731
|
-
readonly activeSensing: 254;
|
|
1732
|
-
readonly reset: 255;
|
|
1733
|
-
readonly sequenceNumber: 0;
|
|
1734
|
-
readonly text: 1;
|
|
1735
|
-
readonly copyright: 2;
|
|
1736
|
-
readonly trackName: 3;
|
|
1737
|
-
readonly instrumentName: 4;
|
|
1738
|
-
readonly lyric: 5;
|
|
1739
|
-
readonly marker: 6;
|
|
1740
|
-
readonly cuePoint: 7;
|
|
1741
|
-
readonly programName: 8;
|
|
1742
|
-
readonly midiChannelPrefix: 32;
|
|
1743
|
-
readonly midiPort: 33;
|
|
1744
|
-
readonly endOfTrack: 47;
|
|
1745
|
-
readonly setTempo: 81;
|
|
1746
|
-
readonly smpteOffset: 84;
|
|
1747
|
-
readonly timeSignature: 88;
|
|
1748
|
-
readonly keySignature: 89;
|
|
1749
|
-
readonly sequenceSpecific: 127;
|
|
1750
|
-
};
|
|
1751
|
-
/**
|
|
1752
|
-
* @inheritDoc MIDIMessageTypes
|
|
1753
|
-
*
|
|
1754
|
-
* @group MIDI.Protocol
|
|
1755
|
-
*/
|
|
1756
|
-
type MIDIMessageType = (typeof MIDIMessageTypes)[keyof typeof MIDIMessageTypes];
|
|
1757
|
-
/**
|
|
1758
|
-
* All MIDI 1.0 controller numbers.
|
|
1759
|
-
*
|
|
1760
|
-
* > **Tip**
|
|
1761
|
-
* >
|
|
1762
|
-
* > Consider reading the [default supported controllers](../../docs/extra/midi-implementation.md#default-supported-controllers) for more information.
|
|
1763
|
-
*
|
|
1764
|
-
* @group MIDI.Protocol
|
|
1765
|
-
*/
|
|
1766
|
-
export declare const MIDIControllers: {
|
|
1767
|
-
readonly bankSelect: 0;
|
|
1768
|
-
readonly modulationWheel: 1;
|
|
1769
|
-
readonly breathController: 2;
|
|
1770
|
-
readonly undefinedCC3: 3;
|
|
1771
|
-
readonly footController: 4;
|
|
1772
|
-
readonly portamentoTime: 5;
|
|
1773
|
-
readonly dataEntryMSB: 6;
|
|
1774
|
-
readonly mainVolume: 7;
|
|
1775
|
-
readonly balance: 8;
|
|
1776
|
-
readonly undefinedCC9: 9;
|
|
1777
|
-
readonly pan: 10;
|
|
1778
|
-
readonly expression: 11;
|
|
1779
|
-
readonly effectControl1: 12;
|
|
1780
|
-
readonly effectControl2: 13;
|
|
1781
|
-
readonly undefinedCC14: 14;
|
|
1782
|
-
readonly undefinedCC15: 15;
|
|
1783
|
-
readonly generalPurposeController1: 16;
|
|
1784
|
-
readonly generalPurposeController2: 17;
|
|
1785
|
-
readonly generalPurposeController3: 18;
|
|
1786
|
-
readonly generalPurposeController4: 19;
|
|
1787
|
-
readonly undefinedCC20: 20;
|
|
1788
|
-
readonly undefinedCC21: 21;
|
|
1789
|
-
readonly undefinedCC22: 22;
|
|
1790
|
-
readonly undefinedCC23: 23;
|
|
1791
|
-
readonly undefinedCC24: 24;
|
|
1792
|
-
readonly undefinedCC25: 25;
|
|
1793
|
-
readonly undefinedCC26: 26;
|
|
1794
|
-
readonly undefinedCC27: 27;
|
|
1795
|
-
readonly undefinedCC28: 28;
|
|
1796
|
-
readonly undefinedCC29: 29;
|
|
1797
|
-
readonly undefinedCC30: 30;
|
|
1798
|
-
readonly undefinedCC31: 31;
|
|
1799
|
-
readonly bankSelectLSB: 32;
|
|
1800
|
-
readonly modulationWheelLSB: 33;
|
|
1801
|
-
readonly breathControllerLSB: 34;
|
|
1802
|
-
readonly undefinedCC3LSB: 35;
|
|
1803
|
-
readonly footControllerLSB: 36;
|
|
1804
|
-
readonly portamentoTimeLSB: 37;
|
|
1805
|
-
readonly dataEntryLSB: 38;
|
|
1806
|
-
readonly mainVolumeLSB: 39;
|
|
1807
|
-
readonly balanceLSB: 40;
|
|
1808
|
-
readonly undefinedCC9LSB: 41;
|
|
1809
|
-
readonly panLSB: 42;
|
|
1810
|
-
readonly expressionLSB: 43;
|
|
1811
|
-
readonly effectControl1LSB: 44;
|
|
1812
|
-
readonly effectControl2LSB: 45;
|
|
1813
|
-
readonly undefinedCC14LSB: 46;
|
|
1814
|
-
readonly undefinedCC15LSB: 47;
|
|
1815
|
-
readonly generalPurposeController1LSB: 48;
|
|
1816
|
-
readonly generalPurposeController2LSB: 49;
|
|
1817
|
-
readonly generalPurposeController3LSB: 50;
|
|
1818
|
-
readonly generalPurposeController4LSB: 51;
|
|
1819
|
-
readonly undefinedCC20LSB: 52;
|
|
1820
|
-
readonly undefinedCC21LSB: 53;
|
|
1821
|
-
readonly undefinedCC22LSB: 54;
|
|
1822
|
-
readonly undefinedCC23LSB: 55;
|
|
1823
|
-
readonly undefinedCC24LSB: 56;
|
|
1824
|
-
readonly undefinedCC25LSB: 57;
|
|
1825
|
-
readonly undefinedCC26LSB: 58;
|
|
1826
|
-
readonly undefinedCC27LSB: 59;
|
|
1827
|
-
readonly undefinedCC28LSB: 60;
|
|
1828
|
-
readonly undefinedCC29LSB: 61;
|
|
1829
|
-
readonly undefinedCC30LSB: 62;
|
|
1830
|
-
readonly undefinedCC31LSB: 63;
|
|
1831
|
-
readonly sustainPedal: 64;
|
|
1832
|
-
readonly portamentoOnOff: 65;
|
|
1833
|
-
readonly sostenutoPedal: 66;
|
|
1834
|
-
readonly softPedal: 67;
|
|
1835
|
-
readonly legatoFootswitch: 68;
|
|
1836
|
-
readonly hold2Pedal: 69;
|
|
1837
|
-
readonly soundVariation: 70;
|
|
1838
|
-
readonly filterResonance: 71;
|
|
1839
|
-
readonly releaseTime: 72;
|
|
1840
|
-
readonly attackTime: 73;
|
|
1841
|
-
readonly brightness: 74;
|
|
1842
|
-
readonly decayTime: 75;
|
|
1843
|
-
readonly vibratoRate: 76;
|
|
1844
|
-
readonly vibratoDepth: 77;
|
|
1845
|
-
readonly vibratoDelay: 78;
|
|
1846
|
-
readonly soundController10: 79;
|
|
1847
|
-
readonly generalPurposeController5: 80;
|
|
1848
|
-
readonly generalPurposeController6: 81;
|
|
1849
|
-
readonly generalPurposeController7: 82;
|
|
1850
|
-
readonly generalPurposeController8: 83;
|
|
1851
|
-
readonly portamentoControl: 84;
|
|
1852
|
-
readonly undefinedCC85: 85;
|
|
1853
|
-
readonly undefinedCC86: 86;
|
|
1854
|
-
readonly undefinedCC87: 87;
|
|
1855
|
-
readonly undefinedCC88: 88;
|
|
1856
|
-
readonly undefinedCC89: 89;
|
|
1857
|
-
readonly undefinedCC90: 90;
|
|
1858
|
-
readonly reverbDepth: 91;
|
|
1859
|
-
readonly tremoloDepth: 92;
|
|
1860
|
-
readonly chorusDepth: 93;
|
|
1861
|
-
readonly variationDepth: 94;
|
|
1862
|
-
readonly phaserDepth: 95;
|
|
1863
|
-
readonly dataIncrement: 96;
|
|
1864
|
-
readonly dataDecrement: 97;
|
|
1865
|
-
readonly nonRegisteredParameterLSB: 98;
|
|
1866
|
-
readonly nonRegisteredParameterMSB: 99;
|
|
1867
|
-
readonly registeredParameterLSB: 100;
|
|
1868
|
-
readonly registeredParameterMSB: 101;
|
|
1869
|
-
readonly undefinedCC102: 102;
|
|
1870
|
-
readonly undefinedCC103: 103;
|
|
1871
|
-
readonly undefinedCC104: 104;
|
|
1872
|
-
readonly undefinedCC105: 105;
|
|
1873
|
-
readonly undefinedCC106: 106;
|
|
1874
|
-
readonly undefinedCC107: 107;
|
|
1875
|
-
readonly undefinedCC108: 108;
|
|
1876
|
-
readonly undefinedCC109: 109;
|
|
1877
|
-
readonly undefinedCC110: 110;
|
|
1878
|
-
readonly undefinedCC111: 111;
|
|
1879
|
-
readonly undefinedCC112: 112;
|
|
1880
|
-
readonly undefinedCC113: 113;
|
|
1881
|
-
readonly undefinedCC114: 114;
|
|
1882
|
-
readonly undefinedCC115: 115;
|
|
1883
|
-
readonly undefinedCC116: 116;
|
|
1884
|
-
readonly undefinedCC117: 117;
|
|
1885
|
-
readonly undefinedCC118: 118;
|
|
1886
|
-
readonly undefinedCC119: 119;
|
|
1887
|
-
readonly allSoundOff: 120;
|
|
1888
|
-
readonly resetAllControllers: 121;
|
|
1889
|
-
readonly localControlOnOff: 122;
|
|
1890
|
-
readonly allNotesOff: 123;
|
|
1891
|
-
readonly omniModeOff: 124;
|
|
1892
|
-
readonly omniModeOn: 125;
|
|
1893
|
-
readonly monoModeOn: 126;
|
|
1894
|
-
readonly polyModeOn: 127;
|
|
2138
|
+
protected audioData?: Float32Array;
|
|
1895
2139
|
/**
|
|
1896
|
-
*
|
|
2140
|
+
* The signed 16-bit little endian PCM data, as read from the file.
|
|
1897
2141
|
*/
|
|
1898
|
-
|
|
2142
|
+
protected s16leData?: Uint8Array;
|
|
1899
2143
|
/**
|
|
1900
|
-
*
|
|
2144
|
+
* The length in sample points when it is not known from the data,
|
|
2145
|
+
* either a sample without data or a vorbis stream's length that was read once.
|
|
1901
2146
|
*/
|
|
1902
|
-
|
|
2147
|
+
protected cachedLength?: number;
|
|
1903
2148
|
/**
|
|
1904
|
-
*
|
|
2149
|
+
* The form the data had before it was released or when it was loaded without data.
|
|
1905
2150
|
*/
|
|
1906
|
-
|
|
2151
|
+
protected releasedForm?: SampleStoredData["form"];
|
|
1907
2152
|
/**
|
|
1908
|
-
*
|
|
2153
|
+
* Creates a new `BasicSample`.
|
|
2154
|
+
*
|
|
2155
|
+
* > **Tip**
|
|
2156
|
+
* >
|
|
2157
|
+
* > For an easier to use constructor, consider using {@link EmptySample} instead.
|
|
2158
|
+
*
|
|
2159
|
+
* @param sampleName The sample's name.
|
|
2160
|
+
* @param sampleRate The sample's rate in Hz.
|
|
2161
|
+
* @param originalKey The sample's pitch as a MIDI note number.
|
|
2162
|
+
* @param pitchCorrection The sample's pitch correction in cents.
|
|
2163
|
+
* @param sampleType The sample's type, one of the {@link SampleTypes}.
|
|
2164
|
+
* @param loopStart The sample's loop start relative to the sample start in sample points.
|
|
2165
|
+
* @param loopEnd The sample's loop end relative to the sample start in sample points. Exclusive.
|
|
1909
2166
|
*/
|
|
1910
|
-
|
|
2167
|
+
constructor(sampleName: string, sampleRate: number, originalKey: number, pitchCorrection: number, sampleType: SampleType, loopStart: number, loopEnd: number);
|
|
1911
2168
|
/**
|
|
1912
|
-
*
|
|
2169
|
+
* Indicates if the sample contains compressed audio.
|
|
1913
2170
|
*/
|
|
1914
|
-
|
|
2171
|
+
get isCompressed(): boolean;
|
|
1915
2172
|
/**
|
|
1916
|
-
*
|
|
2173
|
+
* The form the sample stores its data in, see {@link BasicSample.getStoredData}.
|
|
2174
|
+
* A sample without data reports the form it had, or undefined if it never had data.
|
|
1917
2175
|
*/
|
|
1918
|
-
|
|
2176
|
+
get storedForm(): SampleStoredData["form"] | undefined;
|
|
1919
2177
|
/**
|
|
1920
|
-
*
|
|
2178
|
+
* Indicates if the sample holds any audio data.
|
|
2179
|
+
* A sample loaded with `sampleData: false` or released with {@link BasicSample.releaseData} does not.
|
|
1921
2180
|
*/
|
|
1922
|
-
|
|
2181
|
+
get hasData(): boolean;
|
|
1923
2182
|
/**
|
|
1924
|
-
*
|
|
2183
|
+
* The sample's length in sample points, known without decoding the data.
|
|
2184
|
+
* Samples without data keep the length they had.
|
|
2185
|
+
*
|
|
2186
|
+
* > **Note**
|
|
2187
|
+
* >
|
|
2188
|
+
* > For compressed samples, it is read from the Ogg page headers, which is exact for well-formed streams.
|
|
2189
|
+
* > A stream with gaps in its granule positions decodes shorter. Once it is decoded,
|
|
2190
|
+
* > the length is the decoded one.
|
|
1925
2191
|
*/
|
|
1926
|
-
|
|
2192
|
+
get sampleLength(): number;
|
|
1927
2193
|
/**
|
|
1928
|
-
*
|
|
2194
|
+
* If the sample is linked to another sample.
|
|
1929
2195
|
*/
|
|
1930
|
-
|
|
2196
|
+
get isLinked(): boolean;
|
|
1931
2197
|
/**
|
|
1932
|
-
*
|
|
2198
|
+
* How many instruments is this sample used by.
|
|
1933
2199
|
*/
|
|
1934
|
-
|
|
2200
|
+
get useCount(): number;
|
|
1935
2201
|
/**
|
|
1936
|
-
*
|
|
2202
|
+
* If the decoded float data is currently held in memory.
|
|
2203
|
+
* Check it before {@link getAudioData} to know if the call has to decode,
|
|
2204
|
+
* then use {@link releaseDecoded} to drop the copy again.
|
|
1937
2205
|
*/
|
|
1938
|
-
|
|
2206
|
+
get isDecoded(): boolean;
|
|
1939
2207
|
/**
|
|
1940
|
-
*
|
|
2208
|
+
* Get raw data for writing the file, either a compressed bit stream or signed 16-bit little endian PCM data.
|
|
2209
|
+
* @param allowVorbis if vorbis file data is allowed.
|
|
2210
|
+
* @return either s16le or vorbis data.
|
|
1941
2211
|
*/
|
|
1942
|
-
|
|
2212
|
+
getRawData(allowVorbis: boolean): Uint8Array;
|
|
1943
2213
|
/**
|
|
1944
|
-
*
|
|
2214
|
+
* Gets the sample's data in the form it is stored, without decoding, encoding or copying it.
|
|
2215
|
+
* Use {@link BasicSample.setStoredData} to give it to another sample, for example in another thread.
|
|
2216
|
+
* @returns The stored form and its data.
|
|
1945
2217
|
*/
|
|
1946
|
-
|
|
2218
|
+
getStoredData(): SampleStoredData;
|
|
1947
2219
|
/**
|
|
1948
|
-
*
|
|
2220
|
+
* Replaces the sample's data with data in a given stored form, without decoding or encoding it.
|
|
2221
|
+
* The sample rate and loop points are not changed.
|
|
2222
|
+
*
|
|
2223
|
+
* > **Note**
|
|
2224
|
+
* >
|
|
2225
|
+
* > s16le and vorbis data is written back unchanged when saving, float32 data is encoded.
|
|
2226
|
+
*
|
|
2227
|
+
* @param stored The stored form and its data, as returned by {@link BasicSample.getStoredData}.
|
|
1949
2228
|
*/
|
|
1950
|
-
|
|
2229
|
+
setStoredData(stored: SampleStoredData): void;
|
|
1951
2230
|
/**
|
|
1952
|
-
*
|
|
2231
|
+
* Drops all the sample's data. The parameters and {@link BasicSample.sampleLength} stay.
|
|
2232
|
+
* Reading the audio data afterward throws an error until {@link BasicSample.setStoredData} gives it new data.
|
|
1953
2233
|
*/
|
|
1954
|
-
|
|
2234
|
+
releaseData(): void;
|
|
1955
2235
|
/**
|
|
1956
|
-
*
|
|
2236
|
+
* Drops the decoded float data if the sample can decode it again from its stored s16le or vorbis data.
|
|
2237
|
+
* Replaced data (set with {@link BasicSample.setAudioData}) is kept.
|
|
2238
|
+
* @returns True if the decoded data was dropped.
|
|
1957
2239
|
*/
|
|
1958
|
-
|
|
2240
|
+
releaseDecoded(): boolean;
|
|
1959
2241
|
/**
|
|
1960
|
-
*
|
|
2242
|
+
* Resamples the audio data _in-place_ to a given sample rate.
|
|
2243
|
+
* @param newSampleRate The new sample rate, in hertz.
|
|
1961
2244
|
*/
|
|
1962
|
-
|
|
2245
|
+
resampleData(newSampleRate: number): void;
|
|
1963
2246
|
/**
|
|
1964
|
-
*
|
|
2247
|
+
* Sets the sample type and unlinks if needed.
|
|
2248
|
+
* @param type The type to set it to.
|
|
1965
2249
|
*/
|
|
1966
|
-
|
|
2250
|
+
setSampleType(type: SampleType): void;
|
|
1967
2251
|
/**
|
|
1968
|
-
*
|
|
2252
|
+
* Unlinks the sample from its stereo link if it has any.
|
|
1969
2253
|
*/
|
|
1970
|
-
|
|
2254
|
+
unlinkSample(): void;
|
|
1971
2255
|
/**
|
|
1972
|
-
*
|
|
2256
|
+
* Links a stereo sample.
|
|
2257
|
+
* @param sample The sample to link to.
|
|
2258
|
+
* @param type Either left, right or linked. The linked sample will be set appropriately as well.
|
|
1973
2259
|
*/
|
|
1974
|
-
|
|
2260
|
+
setLinkedSample(sample: BasicSample, type: SampleType): void;
|
|
1975
2261
|
/**
|
|
1976
|
-
*
|
|
2262
|
+
* Get the PCM Float32 audio data of this sample.
|
|
2263
|
+
* This either decodes the compressed data or passes the ready sampleData.
|
|
2264
|
+
* @returns The raw audio data.
|
|
1977
2265
|
*/
|
|
1978
|
-
|
|
2266
|
+
getAudioData(): Float32Array;
|
|
1979
2267
|
/**
|
|
1980
|
-
*
|
|
2268
|
+
* Replaces the audio data *in-place*.
|
|
2269
|
+
* @param audioData The new audio data as Float32.
|
|
2270
|
+
* @param sampleRate The new sample rate, in Hertz.
|
|
1981
2271
|
*/
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
/**
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
* - http://hummer.stanford.edu/sig/doc/classes/MidiOutput/rpn.html
|
|
2008
|
-
*
|
|
2009
|
-
* @group MIDI.Protocol
|
|
2010
|
-
*/
|
|
2011
|
-
export declare const NonRegisteredParameterTypesMSB: {
|
|
2012
|
-
readonly partParameter: 1;
|
|
2013
|
-
readonly drumPitch: 24;
|
|
2014
|
-
readonly drumPitchFine: 25;
|
|
2015
|
-
readonly drumLevel: 26;
|
|
2016
|
-
readonly drumPan: 28;
|
|
2017
|
-
readonly drumReverb: 29;
|
|
2018
|
-
readonly drumChorus: 30;
|
|
2019
|
-
readonly drumVariation: 31;
|
|
2020
|
-
readonly awe32: 127;
|
|
2021
|
-
readonly SF2: 120;
|
|
2022
|
-
};
|
|
2272
|
+
setAudioData(audioData: Float32Array, sampleRate: number): void;
|
|
2273
|
+
/**
|
|
2274
|
+
* Replaces the audio with a compressed data sample and flags the sample as compressed.
|
|
2275
|
+
* @param data The new compressed data.
|
|
2276
|
+
*/
|
|
2277
|
+
setCompressedData(data: Uint8Array): void;
|
|
2278
|
+
/**
|
|
2279
|
+
* The error for reading the data of a sample that has none.
|
|
2280
|
+
*/
|
|
2281
|
+
protected noDataError(): Error;
|
|
2282
|
+
/**
|
|
2283
|
+
* Decodes signed 16-bit little endian PCM into float.
|
|
2284
|
+
* @param data The s16le data. It may be a view at any offset.
|
|
2285
|
+
*/
|
|
2286
|
+
protected decodeS16LE(data: Uint8Array): Float32Array<ArrayBuffer>;
|
|
2287
|
+
/**
|
|
2288
|
+
* Encodes s16le sample
|
|
2289
|
+
* @return the encoded data
|
|
2290
|
+
*/
|
|
2291
|
+
protected encodeS16LE(): IndexedByteArray;
|
|
2292
|
+
/**
|
|
2293
|
+
* Decode binary vorbis into a float32 pcm
|
|
2294
|
+
*/
|
|
2295
|
+
protected decodeVorbis(): Float32Array;
|
|
2296
|
+
}
|
|
2023
2297
|
/**
|
|
2024
|
-
*
|
|
2025
|
-
*
|
|
2026
|
-
* Sources:
|
|
2027
|
-
* - https://cdn.roland.com/assets/media/pdf/SC-8850_OM.pdf
|
|
2028
|
-
* - http://hummer.stanford.edu/sig/doc/classes/MidiOutput/rpn.html
|
|
2298
|
+
* A simplified class for creating {@link BasicSample}.
|
|
2029
2299
|
*
|
|
2030
|
-
* @group
|
|
2300
|
+
* @group Sound Banks.Samples
|
|
2031
2301
|
*/
|
|
2032
|
-
export declare
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
readonly vibratoDelay: 10;
|
|
2036
|
-
readonly tvfCutoffFrequency: 32;
|
|
2037
|
-
readonly tvfResonance: 33;
|
|
2038
|
-
readonly envelopeAttackTime: 99;
|
|
2039
|
-
readonly envelopeDecayTime: 100;
|
|
2040
|
-
readonly envelopeReleaseTime: 102;
|
|
2041
|
-
};
|
|
2302
|
+
export declare class EmptySample extends BasicSample {
|
|
2303
|
+
constructor();
|
|
2304
|
+
}
|
|
2042
2305
|
/**
|
|
2043
2306
|
* Represents a channel in an SF2-compatible synthesizer.
|
|
2044
2307
|
* Its data is used for computing {@link Modulator}s.
|
|
@@ -2070,6 +2333,10 @@ export interface SF2Channel {
|
|
|
2070
2333
|
* Semitones, can be a floating point number.
|
|
2071
2334
|
*/
|
|
2072
2335
|
pitchWheelRange: number;
|
|
2336
|
+
/**
|
|
2337
|
+
* The modulation depth range (RPN 5) in cents.
|
|
2338
|
+
*/
|
|
2339
|
+
modulationDepth: number;
|
|
2073
2340
|
};
|
|
2074
2341
|
}
|
|
2075
2342
|
/**
|
|
@@ -2098,7 +2365,7 @@ export type GenericBankInfoFourCC = "INAM" | "ICRD" | "IENG" | "IPRD" | "ICOP" |
|
|
|
2098
2365
|
*
|
|
2099
2366
|
* @group Utilities.FourCC
|
|
2100
2367
|
*/
|
|
2101
|
-
export type SF2InfoFourCC = GenericBankInfoFourCC | "ifil" | "isng" | "irom" | "iver" | "DMOD" | "LIST";
|
|
2368
|
+
export type SF2InfoFourCC = GenericBankInfoFourCC | "ifil" | "isng" | "irom" | "iver" | "DMOD" | "LIST" | "CURV" | "XMOD";
|
|
2102
2369
|
/**
|
|
2103
2370
|
* RIFF Four Character Codes found in the SF2 structure.
|
|
2104
2371
|
*
|
|
@@ -2128,7 +2395,7 @@ export interface SoundBankInfoData {
|
|
|
2128
2395
|
*/
|
|
2129
2396
|
name: string;
|
|
2130
2397
|
/**
|
|
2131
|
-
* The sound bank
|
|
2398
|
+
* The version of the file the sound bank was loaded from.
|
|
2132
2399
|
*/
|
|
2133
2400
|
version: SF2VersionTag;
|
|
2134
2401
|
/**
|
|
@@ -2240,8 +2507,8 @@ export type SetSampleFormatOptions = {
|
|
|
2240
2507
|
} & ({
|
|
2241
2508
|
/**
|
|
2242
2509
|
* The sample format to use.
|
|
2243
|
-
* - `pcm` - decompresses the sound bank
|
|
2244
|
-
* - `compressed` - compresses the sound bank with a given function
|
|
2510
|
+
* - `pcm` - decompresses the sound bank
|
|
2511
|
+
* - `compressed` - compresses the sound bank with a given function
|
|
2245
2512
|
*
|
|
2246
2513
|
* Note that compressing usually results in permanent sample quality loss! Decompressing does not restore it.
|
|
2247
2514
|
*/
|
|
@@ -2249,8 +2516,8 @@ export type SetSampleFormatOptions = {
|
|
|
2249
2516
|
} | {
|
|
2250
2517
|
/**
|
|
2251
2518
|
* The sample format to use.
|
|
2252
|
-
* - `pcm` - decompresses the sound bank
|
|
2253
|
-
* - `compressed` - compresses the sound bank with a given function
|
|
2519
|
+
* - `pcm` - decompresses the sound bank
|
|
2520
|
+
* - `compressed` - compresses the sound bank with a given function
|
|
2254
2521
|
*
|
|
2255
2522
|
* Note that compressing usually results in permanent sample quality loss! Decompressing does not restore it.
|
|
2256
2523
|
*/
|
|
@@ -2262,9 +2529,8 @@ export type SetSampleFormatOptions = {
|
|
|
2262
2529
|
compressionFunction: SampleEncodingFunction;
|
|
2263
2530
|
/**
|
|
2264
2531
|
* If the returned promise should reject when a sample fails to compress.
|
|
2265
|
-
* By default, such a sample is left uncompressed (and a warning is logged)
|
|
2266
|
-
*
|
|
2267
|
-
* With this on, the method throws after trying every sample and the bank's version stays the same.
|
|
2532
|
+
* By default, such a sample is left uncompressed (and a warning is logged).
|
|
2533
|
+
* With this on, the method throws after trying every sample.
|
|
2268
2534
|
*/
|
|
2269
2535
|
rejectOnFailure?: boolean;
|
|
2270
2536
|
});
|
|
@@ -2291,31 +2557,84 @@ export interface SoundBankWriteOptions {
|
|
|
2291
2557
|
*/
|
|
2292
2558
|
export interface SoundFont2WriteOptions extends SoundBankWriteOptions {
|
|
2293
2559
|
/**
|
|
2294
|
-
* If the DMOD chunk should be written. Recommended.
|
|
2295
|
-
* > **Note**
|
|
2296
|
-
* >
|
|
2297
|
-
* > The chunk will only be written if the modulators differ from the SpessaSynth defaults.
|
|
2560
|
+
* If the DMOD chunk should be written. Recommended.
|
|
2561
|
+
* > **Note**
|
|
2562
|
+
* >
|
|
2563
|
+
* > The chunk will only be written if the modulators differ from the SpessaSynth defaults.
|
|
2564
|
+
*
|
|
2565
|
+
* > **Warning**
|
|
2566
|
+
* >
|
|
2567
|
+
* > A plain SF2 file can't store custom curves, so default modulators that use one are left out of the chunk.
|
|
2568
|
+
* > The SpessaSynth envelope time modulators (CC 72, 73 and 75) use custom curves. They are added back on load
|
|
2569
|
+
* > when the chunk has no CC 72, 73 or 75 modulator, so a bank that removed them should keep one with amount 0.
|
|
2570
|
+
* > Other custom curve modulators are lost. Write the bank as SFe to keep them.
|
|
2571
|
+
*/
|
|
2572
|
+
writeDefaultModulators: boolean;
|
|
2573
|
+
/**
|
|
2574
|
+
* If the XDTA chunk should be written to allow virtually infinite parameters. Recommended.
|
|
2575
|
+
*
|
|
2576
|
+
* > **Note**
|
|
2577
|
+
* >
|
|
2578
|
+
* > The chunk will only be written if needed.
|
|
2579
|
+
*/
|
|
2580
|
+
writeExtendedLimits: boolean;
|
|
2581
|
+
}
|
|
2582
|
+
/**
|
|
2583
|
+
* What changes in a sound bank when it is written as a plain SF2 file and read back.
|
|
2584
|
+
* All zeros mean the bank comes back the same.
|
|
2585
|
+
*
|
|
2586
|
+
* @group Sound Banks.Writing
|
|
2587
|
+
*/
|
|
2588
|
+
export interface SF2Losses {
|
|
2589
|
+
/**
|
|
2590
|
+
* The generators above 60 (SFe only) in the zones.
|
|
2591
|
+
*/
|
|
2592
|
+
generators: number;
|
|
2593
|
+
/**
|
|
2594
|
+
* The zones with an alternating loop (`sampleModes` 4). They fall back to the global zone's loop mode or to no loop.
|
|
2595
|
+
*/
|
|
2596
|
+
alternatingLoops: number;
|
|
2597
|
+
/**
|
|
2598
|
+
* The zone modulators with an SFe destination, a custom curve or an unknown source type, the ones that use the
|
|
2599
|
+
* Modulation Depth Range in a way SF2 cannot store, and the mod wheel vibratos whose amount reads back differently.
|
|
2600
|
+
*/
|
|
2601
|
+
modulators: number;
|
|
2602
|
+
/**
|
|
2603
|
+
* The default modulators with an SFe destination, a custom curve or an unknown source type, the ones that use the
|
|
2604
|
+
* Modulation Depth Range in a way SF2 cannot store, and the mod wheel vibratos whose amount reads back differently.
|
|
2605
|
+
*/
|
|
2606
|
+
defaultModulators: number;
|
|
2607
|
+
/**
|
|
2608
|
+
* The custom curves that would not come back: the ones of lost modulators and the unused ones.
|
|
2609
|
+
* SF2 stores no curves, only the curves of the restored default modulators return.
|
|
2610
|
+
*/
|
|
2611
|
+
customCurves: number;
|
|
2612
|
+
/**
|
|
2613
|
+
* The modulators the SF2 reader would add that the bank does not have:
|
|
2614
|
+
* removed envelope time, variation send or resonance compensation modulators come back on load.
|
|
2615
|
+
*/
|
|
2616
|
+
addedModulators: number;
|
|
2617
|
+
/**
|
|
2618
|
+
* The reverb and chorus send modulators whose amount would read back differently.
|
|
2619
|
+
* SF2 stores a fifth of the amount as a whole number and the reader multiplies it by 5 again, stopping at 1000.
|
|
2620
|
+
* So 502 reads back as 500, and 1500 reads back as 1000.
|
|
2298
2621
|
*/
|
|
2299
|
-
|
|
2622
|
+
sendAmounts: number;
|
|
2300
2623
|
/**
|
|
2301
|
-
*
|
|
2302
|
-
*
|
|
2303
|
-
* > **Note**
|
|
2304
|
-
* >
|
|
2305
|
-
* > The chunk will only be written if needed.
|
|
2624
|
+
* The presets whose bank numbers would read back differently. SF2 stores one bank number per preset.
|
|
2306
2625
|
*/
|
|
2307
|
-
|
|
2626
|
+
bankNumbers: number;
|
|
2308
2627
|
}
|
|
2309
2628
|
/**
|
|
2310
|
-
* Options for writing an
|
|
2629
|
+
* Options for writing an SFe 4 file.
|
|
2311
2630
|
*
|
|
2312
2631
|
* @group Sound Banks.Writing
|
|
2313
2632
|
*/
|
|
2314
|
-
export interface
|
|
2633
|
+
export interface SFeWriteOptions extends SoundBankWriteOptions {
|
|
2315
2634
|
/**
|
|
2316
2635
|
* If the RIFS (64-bit RIFF chunks) should be used.
|
|
2317
2636
|
* Increases maximum size from 4GB to effectively infinite.
|
|
2318
|
-
*
|
|
2637
|
+
* Only needed for banks over 4 GB, defaults to false.
|
|
2319
2638
|
*/
|
|
2320
2639
|
rf64: boolean;
|
|
2321
2640
|
}
|
|
@@ -2412,8 +2731,8 @@ export interface SoundBankCloneOptions {
|
|
|
2412
2731
|
*/
|
|
2413
2732
|
reuseByName: boolean;
|
|
2414
2733
|
/**
|
|
2415
|
-
* How the instruments and
|
|
2416
|
-
* - `name` - reuse the first element in the bank with the same name.
|
|
2734
|
+
* How the instruments, samples and custom curves used by a cloned element are reused instead of copied.
|
|
2735
|
+
* - `name` - reuse the first element in the bank with the same name. A curve also needs the same points.
|
|
2417
2736
|
* - `identity` - reuse the element itself if it is already in the bank.
|
|
2418
2737
|
* Use it to duplicate elements within one bank, as names often repeat in real banks.
|
|
2419
2738
|
* - `none` - always copy them, under a free name if needed.
|
|
@@ -2616,6 +2935,26 @@ export interface GSSystemEffectParameter {
|
|
|
2616
2935
|
*/
|
|
2617
2936
|
preLowpass: number;
|
|
2618
2937
|
}
|
|
2938
|
+
/**
|
|
2939
|
+
* The base of every effect interface of {@link SpessaSynthProcessor}.
|
|
2940
|
+
*
|
|
2941
|
+
* @group Synthesizer
|
|
2942
|
+
*/
|
|
2943
|
+
export interface SynthesizerEffect<Snapshot> {
|
|
2944
|
+
/**
|
|
2945
|
+
* Clears the internal buffers and resets the effect to a default state.
|
|
2946
|
+
*/
|
|
2947
|
+
reset(): void;
|
|
2948
|
+
/**
|
|
2949
|
+
* Gets a snapshot of this effect.
|
|
2950
|
+
*/
|
|
2951
|
+
getSnapshot(): Snapshot;
|
|
2952
|
+
/**
|
|
2953
|
+
* Restores this effect from a snapshot.
|
|
2954
|
+
* @param snapshot The snapshot to restore.
|
|
2955
|
+
*/
|
|
2956
|
+
applySnapshot(snapshot: Snapshot): void;
|
|
2957
|
+
}
|
|
2619
2958
|
/**
|
|
2620
2959
|
* GS-compatible reverb parameters.
|
|
2621
2960
|
*
|
|
@@ -2679,7 +3018,7 @@ export interface GSReverbParameter extends GSSystemEffectParameter {
|
|
|
2679
3018
|
*
|
|
2680
3019
|
* @group Synthesizer.GS Effects
|
|
2681
3020
|
*/
|
|
2682
|
-
export interface GSReverbProcessor extends GSReverbParameter {
|
|
3021
|
+
export interface GSReverbProcessor extends GSReverbParameter, SynthesizerEffect<GSReverbParameter> {
|
|
2683
3022
|
/**
|
|
2684
3023
|
* Process the effect and **adds** it to the output.
|
|
2685
3024
|
* @param input The input buffer to process. It always starts at index 0.
|
|
@@ -2689,15 +3028,6 @@ export interface GSReverbProcessor extends GSReverbParameter {
|
|
|
2689
3028
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
2690
3029
|
*/
|
|
2691
3030
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
2692
|
-
/**
|
|
2693
|
-
* Gets a snapshot of this effect processor instance.
|
|
2694
|
-
*/
|
|
2695
|
-
getSnapshot(): GSReverbParameter;
|
|
2696
|
-
/**
|
|
2697
|
-
* Restores this effect processor instance from a snapshot.
|
|
2698
|
-
* @param snapshot The snapshot to restore.
|
|
2699
|
-
*/
|
|
2700
|
-
applySnapshot(snapshot: GSReverbParameter): void;
|
|
2701
3031
|
}
|
|
2702
3032
|
/**
|
|
2703
3033
|
* GS-compatible chorus parameters.
|
|
@@ -2770,7 +3100,7 @@ export interface GSChorusParameter extends GSSystemEffectParameter {
|
|
|
2770
3100
|
*
|
|
2771
3101
|
* @group Synthesizer.GS Effects
|
|
2772
3102
|
*/
|
|
2773
|
-
export interface GSChorusProcessor extends GSChorusParameter {
|
|
3103
|
+
export interface GSChorusProcessor extends GSChorusParameter, SynthesizerEffect<GSChorusParameter> {
|
|
2774
3104
|
/**
|
|
2775
3105
|
* Process the effect and **adds** it to the output.
|
|
2776
3106
|
* @param input The input buffer to process. It always starts at index 0.
|
|
@@ -2782,15 +3112,6 @@ export interface GSChorusProcessor extends GSChorusParameter {
|
|
|
2782
3112
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
2783
3113
|
*/
|
|
2784
3114
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
2785
|
-
/**
|
|
2786
|
-
* Gets a snapshot of this effect processor instance.
|
|
2787
|
-
*/
|
|
2788
|
-
getSnapshot(): GSChorusParameter;
|
|
2789
|
-
/**
|
|
2790
|
-
* Restores this effect processor instance from a snapshot.
|
|
2791
|
-
* @param snapshot The snapshot to restore.
|
|
2792
|
-
*/
|
|
2793
|
-
applySnapshot(snapshot: GSChorusParameter): void;
|
|
2794
3115
|
}
|
|
2795
3116
|
/**
|
|
2796
3117
|
* GS-compatible delay parameters.
|
|
@@ -2884,7 +3205,7 @@ export interface GSDelayParameter extends GSSystemEffectParameter {
|
|
|
2884
3205
|
*
|
|
2885
3206
|
* @group Synthesizer.GS Effects
|
|
2886
3207
|
*/
|
|
2887
|
-
export interface GSDelayProcessor extends GSDelayParameter {
|
|
3208
|
+
export interface GSDelayProcessor extends GSDelayParameter, SynthesizerEffect<GSDelayParameter> {
|
|
2888
3209
|
/**
|
|
2889
3210
|
* Process the effect and **adds** it to the output.
|
|
2890
3211
|
* @param input The input buffer to process. It always starts at index 0.
|
|
@@ -2895,15 +3216,6 @@ export interface GSDelayProcessor extends GSDelayParameter {
|
|
|
2895
3216
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
2896
3217
|
*/
|
|
2897
3218
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, startIndex: number, sampleCount: number): void;
|
|
2898
|
-
/**
|
|
2899
|
-
* Gets a snapshot of this effect processor instance.
|
|
2900
|
-
*/
|
|
2901
|
-
getSnapshot(): GSDelayParameter;
|
|
2902
|
-
/**
|
|
2903
|
-
* Restores this effect processor instance from a snapshot.
|
|
2904
|
-
* @param snapshot The snapshot to restore.
|
|
2905
|
-
*/
|
|
2906
|
-
applySnapshot(snapshot: GSDelayParameter): void;
|
|
2907
3219
|
}
|
|
2908
3220
|
/**
|
|
2909
3221
|
* GS-compatible insertion effect (EFX) parameters.
|
|
@@ -3011,6 +3323,7 @@ export interface GSInsertionBlockSnapshot extends GSInsertionParameter {
|
|
|
3011
3323
|
*
|
|
3012
3324
|
* {@link SpessaSynthProcessor} allows you to supply a custom insertion block.
|
|
3013
3325
|
* A custom insertion block must implement this interface.
|
|
3326
|
+
* A {@link GSInsertionBlock.reset | reset} also resets the EFX control sources and depths, which a type change keeps.
|
|
3014
3327
|
*
|
|
3015
3328
|
* ### Editing the parameters
|
|
3016
3329
|
*
|
|
@@ -3022,7 +3335,7 @@ export interface GSInsertionBlockSnapshot extends GSInsertionParameter {
|
|
|
3022
3335
|
*
|
|
3023
3336
|
* @group Synthesizer.GS Effects
|
|
3024
3337
|
*/
|
|
3025
|
-
export interface GSInsertionBlock extends GSInsertionParameter {
|
|
3338
|
+
export interface GSInsertionBlock extends GSInsertionParameter, SynthesizerEffect<GSInsertionBlockSnapshot> {
|
|
3026
3339
|
/**
|
|
3027
3340
|
* Sets the EFX type of the block.
|
|
3028
3341
|
*
|
|
@@ -3038,10 +3351,6 @@ export interface GSInsertionBlock extends GSInsertionParameter {
|
|
|
3038
3351
|
* @returns The 16-bit (`MSB << 8 | LSB`) type requested by the last {@link setType} call.
|
|
3039
3352
|
*/
|
|
3040
3353
|
getType(): number;
|
|
3041
|
-
/**
|
|
3042
|
-
* Resets this block to default values, including the EFX type, the send levels and the EFX control.
|
|
3043
|
-
*/
|
|
3044
|
-
reset(): void;
|
|
3045
3354
|
/**
|
|
3046
3355
|
* Sets the given EFX parameter to the given value.
|
|
3047
3356
|
* @param param The parameter number (0-based, 0-19).
|
|
@@ -3069,15 +3378,6 @@ export interface GSInsertionBlock extends GSInsertionParameter {
|
|
|
3069
3378
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3070
3379
|
*/
|
|
3071
3380
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputChorus: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
3072
|
-
/**
|
|
3073
|
-
* Gets a snapshot of this insertion block.
|
|
3074
|
-
*/
|
|
3075
|
-
getSnapshot(): GSInsertionBlockSnapshot;
|
|
3076
|
-
/**
|
|
3077
|
-
* Restores this insertion block from a snapshot.
|
|
3078
|
-
* @param snapshot The snapshot to restore.
|
|
3079
|
-
*/
|
|
3080
|
-
applySnapshot(snapshot: GSInsertionBlockSnapshot): void;
|
|
3081
3381
|
}
|
|
3082
3382
|
/**
|
|
3083
3383
|
* GS-compatible equalizer parameters.
|
|
@@ -3145,7 +3445,7 @@ export interface GSEqualizerParameter {
|
|
|
3145
3445
|
*
|
|
3146
3446
|
* @group Synthesizer.GS Effects
|
|
3147
3447
|
*/
|
|
3148
|
-
export interface GSEqualizerProcessor extends GSEqualizerParameter {
|
|
3448
|
+
export interface GSEqualizerProcessor extends GSEqualizerParameter, SynthesizerEffect<GSEqualizerParameter> {
|
|
3149
3449
|
/**
|
|
3150
3450
|
* Process the effect and **adds** it to the output.
|
|
3151
3451
|
* @param inputLeft The left input buffer to process. It always starts at index 0.
|
|
@@ -3156,15 +3456,6 @@ export interface GSEqualizerProcessor extends GSEqualizerParameter {
|
|
|
3156
3456
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3157
3457
|
*/
|
|
3158
3458
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
3159
|
-
/**
|
|
3160
|
-
* Gets a snapshot of this effect processor instance.
|
|
3161
|
-
*/
|
|
3162
|
-
getSnapshot(): GSEqualizerParameter;
|
|
3163
|
-
/**
|
|
3164
|
-
* Restores this effect processor instance from a snapshot.
|
|
3165
|
-
* @param snapshot The snapshot to restore.
|
|
3166
|
-
*/
|
|
3167
|
-
applySnapshot(snapshot: GSEqualizerParameter): void;
|
|
3168
3459
|
}
|
|
3169
3460
|
/**
|
|
3170
3461
|
* A snapshot of a {@link XGEffectBlock}.
|
|
@@ -3198,7 +3489,7 @@ export interface XGEffectBlockSnapshot {
|
|
|
3198
3489
|
*
|
|
3199
3490
|
* @group Synthesizer.XG Effects
|
|
3200
3491
|
*/
|
|
3201
|
-
export interface XGEffectBlock {
|
|
3492
|
+
export interface XGEffectBlock<Snapshot extends XGEffectBlockSnapshot = XGEffectBlockSnapshot> extends SynthesizerEffect<Snapshot> {
|
|
3202
3493
|
/**
|
|
3203
3494
|
* Sets the type of the processor.
|
|
3204
3495
|
* Per XG spec, BASIC EFFECT (LSB = 0) should be used if the exact match is missing.
|
|
@@ -3214,25 +3505,12 @@ export interface XGEffectBlock {
|
|
|
3214
3505
|
* @returns The 16-bit (`(MSB << 8) | LSB`) type of the processor used.
|
|
3215
3506
|
*/
|
|
3216
3507
|
getType(): number;
|
|
3217
|
-
/**
|
|
3218
|
-
* Resets this block to default values, including the processor type.
|
|
3219
|
-
*/
|
|
3220
|
-
reset(): void;
|
|
3221
3508
|
/**
|
|
3222
3509
|
* Sets the given effect parameter to the given value.
|
|
3223
3510
|
* @param param The parameter number (0-based).
|
|
3224
3511
|
* @param value The value: 14-bit for two-byte params, 7-bit for single-byte params.
|
|
3225
3512
|
*/
|
|
3226
3513
|
setParameter(param: number, value: number): void;
|
|
3227
|
-
/**
|
|
3228
|
-
* Gets a snapshot of this XG effect block.
|
|
3229
|
-
*/
|
|
3230
|
-
getSnapshot(): XGEffectBlockSnapshot;
|
|
3231
|
-
/**
|
|
3232
|
-
* Restores this XG effect block from a snapshot.
|
|
3233
|
-
* @param snapshot The snapshot to restore.
|
|
3234
|
-
*/
|
|
3235
|
-
applySnapshot(snapshot: XGEffectBlockSnapshot): void;
|
|
3236
3514
|
}
|
|
3237
3515
|
/**
|
|
3238
3516
|
* Parameters for an XG system effect.
|
|
@@ -3269,17 +3547,7 @@ export interface XGSystemEffectBlockSnapshot extends XGSystemEffectParameter, XG
|
|
|
3269
3547
|
*
|
|
3270
3548
|
* @group Synthesizer.XG Effects
|
|
3271
3549
|
*/
|
|
3272
|
-
export interface XGSystemEffectBlock extends XGEffectBlock
|
|
3273
|
-
/**
|
|
3274
|
-
* Gets a snapshot of this XG effect block.
|
|
3275
|
-
*/
|
|
3276
|
-
getSnapshot(): XGSystemEffectBlockSnapshot;
|
|
3277
|
-
/**
|
|
3278
|
-
* Restores this XG effect block from a snapshot.
|
|
3279
|
-
* @param snapshot The snapshot to restore.
|
|
3280
|
-
*/
|
|
3281
|
-
applySnapshot(snapshot: XGSystemEffectBlockSnapshot): void;
|
|
3282
|
-
}
|
|
3550
|
+
export interface XGSystemEffectBlock<Snapshot extends XGSystemEffectBlockSnapshot = XGSystemEffectBlockSnapshot> extends XGEffectBlock<Snapshot>, XGSystemEffectParameter {}
|
|
3283
3551
|
/**
|
|
3284
3552
|
* Reverb is an effect that adds reverberation to a sound, as you would hear in a concert
|
|
3285
3553
|
* hall.
|
|
@@ -3352,7 +3620,7 @@ export interface XGChorusBlockSnapshot extends XGChorusParameter, XGSystemEffect
|
|
|
3352
3620
|
*
|
|
3353
3621
|
* @group Synthesizer.XG Effects
|
|
3354
3622
|
*/
|
|
3355
|
-
export interface XGChorusBlock extends XGSystemEffectBlock
|
|
3623
|
+
export interface XGChorusBlock extends XGSystemEffectBlock<XGChorusBlockSnapshot>, XGChorusParameter {
|
|
3356
3624
|
/**
|
|
3357
3625
|
* Process the effect and **adds** it to the output.
|
|
3358
3626
|
* @param inputLeft The input buffer to process. It always starts at index 0.
|
|
@@ -3365,15 +3633,6 @@ export interface XGChorusBlock extends XGSystemEffectBlock, XGChorusParameter {
|
|
|
3365
3633
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3366
3634
|
*/
|
|
3367
3635
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
3368
|
-
/**
|
|
3369
|
-
* Gets a snapshot of this XG effect block.
|
|
3370
|
-
*/
|
|
3371
|
-
getSnapshot(): XGChorusBlockSnapshot;
|
|
3372
|
-
/**
|
|
3373
|
-
* Restores this XG effect block from a snapshot.
|
|
3374
|
-
* @param snapshot The snapshot to restore.
|
|
3375
|
-
*/
|
|
3376
|
-
applySnapshot(snapshot: XGChorusBlockSnapshot): void;
|
|
3377
3636
|
}
|
|
3378
3637
|
/**
|
|
3379
3638
|
* Parameters for the XG insertion effect.
|
|
@@ -3419,7 +3678,7 @@ export interface XGInsertionBlockSnapshot extends XGInsertionParameter, XGEffect
|
|
|
3419
3678
|
*
|
|
3420
3679
|
* @group Synthesizer.XG Effects
|
|
3421
3680
|
*/
|
|
3422
|
-
export interface XGInsertionBlock extends XGInsertionParameter, XGEffectBlock {
|
|
3681
|
+
export interface XGInsertionBlock<Snapshot extends XGInsertionBlockSnapshot = XGInsertionBlockSnapshot> extends XGInsertionParameter, XGEffectBlock<Snapshot> {
|
|
3423
3682
|
/**
|
|
3424
3683
|
* Process the effect in insertion mode and **overwrites** it to the input.
|
|
3425
3684
|
* The DSP honors Dry/Wet in this case.
|
|
@@ -3429,15 +3688,6 @@ export interface XGInsertionBlock extends XGInsertionParameter, XGEffectBlock {
|
|
|
3429
3688
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3430
3689
|
*/
|
|
3431
3690
|
processInsertion(inputLeft: Float32Array, inputRight: Float32Array, sampleCount: number): void;
|
|
3432
|
-
/**
|
|
3433
|
-
* Gets a snapshot of this XG effect block.
|
|
3434
|
-
*/
|
|
3435
|
-
getSnapshot(): XGInsertionBlockSnapshot;
|
|
3436
|
-
/**
|
|
3437
|
-
* Restores this XG effect block from a snapshot.
|
|
3438
|
-
* @param snapshot The snapshot to restore.
|
|
3439
|
-
*/
|
|
3440
|
-
applySnapshot(snapshot: XGInsertionBlockSnapshot): void;
|
|
3441
3691
|
}
|
|
3442
3692
|
/**
|
|
3443
3693
|
* Parameters for the XG variation effect.
|
|
@@ -3507,7 +3757,7 @@ export interface XGVariationBlockSnapshot extends XGVariationParameter, XGSystem
|
|
|
3507
3757
|
*
|
|
3508
3758
|
* @group Synthesizer.XG Effects
|
|
3509
3759
|
*/
|
|
3510
|
-
export interface XGVariationBlock extends XGVariationParameter, XGSystemEffectBlock
|
|
3760
|
+
export interface XGVariationBlock extends XGVariationParameter, XGSystemEffectBlock<XGVariationBlockSnapshot>, XGInsertionBlock<XGVariationBlockSnapshot> {
|
|
3511
3761
|
/**
|
|
3512
3762
|
* Process the effect in _system_ mode and **adds** it to the output.
|
|
3513
3763
|
* Feeds the chorus and reverb buffers according to the send amounts.
|
|
@@ -3525,15 +3775,6 @@ export interface XGVariationBlock extends XGVariationParameter, XGSystemEffectBl
|
|
|
3525
3775
|
* @param sampleCount The amount of samples to mix. This will never be larger than {@link SynthProcessorOptions.maxBufferSize} of the parent {@link SpessaSynthProcessor} instance.
|
|
3526
3776
|
*/
|
|
3527
3777
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, chorusLeft: Float32Array, chorusRight: Float32Array, reverbLeft: Float32Array, reverbRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
3528
|
-
/**
|
|
3529
|
-
* Gets a snapshot of this XG effect block.
|
|
3530
|
-
*/
|
|
3531
|
-
getSnapshot(): XGVariationBlockSnapshot;
|
|
3532
|
-
/**
|
|
3533
|
-
* Restores this XG effect block from a snapshot.
|
|
3534
|
-
* @param snapshot The snapshot to restore.
|
|
3535
|
-
*/
|
|
3536
|
-
applySnapshot(snapshot: XGVariationBlockSnapshot): void;
|
|
3537
3778
|
}
|
|
3538
3779
|
/**
|
|
3539
3780
|
* Global System Parameters are API-only parameters
|
|
@@ -3827,6 +4068,7 @@ export declare class SoundBankManager {
|
|
|
3827
4068
|
* @param id The unique ID to assign to the sound bank.
|
|
3828
4069
|
* If a sound bank with this ID already exists, it will be replaced.
|
|
3829
4070
|
* @param bankOffset The bank offset of the sound bank. Offsets the bank MSB value of all presets in this sound bank.
|
|
4071
|
+
* Presets that would end up above bank 127 are left out.
|
|
3830
4072
|
* @param reset If the synthesizer should reset (put every channel's controllers back to defaults) after the change.
|
|
3831
4073
|
* Set it to `false` to keep a song playing, the channels then only update to the new presets.
|
|
3832
4074
|
*/
|
|
@@ -3977,6 +4219,21 @@ export interface CustomChannelVibrato {
|
|
|
3977
4219
|
*/
|
|
3978
4220
|
rate: number;
|
|
3979
4221
|
}
|
|
4222
|
+
/**
|
|
4223
|
+
* The state of a channel's GS and XG controller matrix, as stored in a channel snapshot.
|
|
4224
|
+
*
|
|
4225
|
+
* @group Synthesizer.Snapshots
|
|
4226
|
+
*/
|
|
4227
|
+
interface ControllerMatrixSnapshot {
|
|
4228
|
+
/**
|
|
4229
|
+
* The system of the last written cell. GS applies amplitude linearly, XG in decibels.
|
|
4230
|
+
*/
|
|
4231
|
+
system: "gs" | "xg";
|
|
4232
|
+
/**
|
|
4233
|
+
* The raw depth bytes, source * destination.
|
|
4234
|
+
*/
|
|
4235
|
+
depths: Uint8Array;
|
|
4236
|
+
}
|
|
3980
4237
|
/**
|
|
3981
4238
|
* This interface is a snapshot of a {@link MIDIChannel},
|
|
3982
4239
|
* capturing its current state, which can be saved and restored.
|
|
@@ -4054,6 +4311,10 @@ interface ChannelSnapshot {
|
|
|
4054
4311
|
* Parameters for each drum instrument.
|
|
4055
4312
|
*/
|
|
4056
4313
|
drumParams: DrumParameter[];
|
|
4314
|
+
/**
|
|
4315
|
+
* The GS / XG controller matrix.
|
|
4316
|
+
*/
|
|
4317
|
+
controllerMatrix?: ControllerMatrixSnapshot;
|
|
4057
4318
|
/**
|
|
4058
4319
|
* Indicates whether this channel is a drum channel.
|
|
4059
4320
|
*/
|
|
@@ -5306,7 +5567,7 @@ export type GlobalMIDIParameterChangeEvent = { [P in keyof GlobalMIDIParameter]:
|
|
|
5306
5567
|
*
|
|
5307
5568
|
* @group Synthesizer.Events
|
|
5308
5569
|
*/
|
|
5309
|
-
export type FXType<K> = Exclude<keyof K, "process" | "getSnapshot" | "applySnapshot"> | "macro";
|
|
5570
|
+
export type FXType<K> = Exclude<keyof K, "process" | "getSnapshot" | "applySnapshot" | "clear" | "reset"> | "macro";
|
|
5310
5571
|
/**
|
|
5311
5572
|
* This event is triggered when an effect processor has one of its parameters changed.
|
|
5312
5573
|
*
|
|
@@ -6248,15 +6509,9 @@ interface ChannelMIDIParameter {
|
|
|
6248
6509
|
*/
|
|
6249
6510
|
pitchWheelRange: number;
|
|
6250
6511
|
/**
|
|
6251
|
-
* The modulation depth in cents.
|
|
6252
|
-
*
|
|
6253
|
-
*
|
|
6254
|
-
* The MIDI specification assumes the default modulation depth is 50 cents,
|
|
6255
|
-
* but it may vary for different sound banks.
|
|
6256
|
-
* For example, if a MIDI requests a modulation depth of 100 cents,
|
|
6257
|
-
* the multiplier will be 2,
|
|
6258
|
-
* which, for a preset with a depth of 50,
|
|
6259
|
-
* will create a total modulation depth of 100 cents.
|
|
6512
|
+
* The modulation depth range (RPN 5) in cents.
|
|
6513
|
+
* Banks read it through the Modulation Depth Range modulator source,
|
|
6514
|
+
* where the default modulation wheel to vibrato modulator is 50 cents at the default.
|
|
6260
6515
|
*/
|
|
6261
6516
|
modulationDepth: number;
|
|
6262
6517
|
/**
|
|
@@ -6284,6 +6539,10 @@ interface ChannelMIDIParameter {
|
|
|
6284
6539
|
/**
|
|
6285
6540
|
* The key shift of the channel (in semitones).
|
|
6286
6541
|
* Drum channels ignore this value.
|
|
6542
|
+
*
|
|
6543
|
+
* > **Note**
|
|
6544
|
+
* >
|
|
6545
|
+
* > For `xg` drum channels this instead changes the pitch in semitones.
|
|
6287
6546
|
*/
|
|
6288
6547
|
keyShift: number;
|
|
6289
6548
|
/**
|
|
@@ -6789,7 +7048,7 @@ export interface NoteTime {
|
|
|
6789
7048
|
*/
|
|
6790
7049
|
export interface RMIDIWriteOptions {
|
|
6791
7050
|
/**
|
|
6792
|
-
* The bank offset to apply to the file. Defaults to `0`.
|
|
7051
|
+
* The bank offset to apply to the file, an integer from 0 to 127. Defaults to `0`.
|
|
6793
7052
|
* [See this for more info](https://github.com/spessasus/sf2-rmidi-specification#dbnk-chunk)
|
|
6794
7053
|
*/
|
|
6795
7054
|
bankOffset: number;
|
|
@@ -7168,6 +7427,21 @@ export declare class BasicMIDI {
|
|
|
7168
7427
|
* > See [SF2 RMIDI Extension Specification](https://github.com/spessasus/sf2-rmidi-specification#readme) for more info.
|
|
7169
7428
|
*/
|
|
7170
7429
|
rmidiInfo: Partial<Record<keyof RMIDInfoData, Uint8Array<ArrayBuffer>>>;
|
|
7430
|
+
/**
|
|
7431
|
+
* RMIDI chunks that SpessaSynth does not recognize, kept so {@link BasicMIDI.writeRMIDI} can write them back.
|
|
7432
|
+
* Each entry is a complete RIFF chunk (FourCC, size, data and the pad byte).
|
|
7433
|
+
*
|
|
7434
|
+
* - `info` holds unknown chunks from the `INFO` list.
|
|
7435
|
+
* - `file` holds unknown chunks from the main `RIFF` chunk. They get written after the sound bank.
|
|
7436
|
+
*
|
|
7437
|
+
* > **Tip**
|
|
7438
|
+
* >
|
|
7439
|
+
* > See [SF2 RMIDI Extension Specification](https://github.com/spessasus/sf2-rmidi-specification#handling-differences) for more info.
|
|
7440
|
+
*/
|
|
7441
|
+
rmidiExtraChunks: {
|
|
7442
|
+
info: Uint8Array<ArrayBufferLike>[];
|
|
7443
|
+
file: Uint8Array<ArrayBufferLike>[];
|
|
7444
|
+
};
|
|
7171
7445
|
/**
|
|
7172
7446
|
* The bank offset used for RMID files.
|
|
7173
7447
|
* Only applies to RMID, for normal MIDIs it's set to 0.
|
|
@@ -7212,7 +7486,7 @@ export declare class BasicMIDI {
|
|
|
7212
7486
|
*/
|
|
7213
7487
|
get infoEncoding(): string | undefined;
|
|
7214
7488
|
/**
|
|
7215
|
-
* Loads a MIDI file (SMF, RMIDI, XMF,
|
|
7489
|
+
* Loads a MIDI file (SMF, RMIDI, XMF, Tracker Modules) from a given ArrayBuffer.
|
|
7216
7490
|
* @param arrayBuffer The ArrayBuffer containing the binary file data.
|
|
7217
7491
|
* @param fileName The _optional_ name of the file, will be used if the MIDI file does not have a name.
|
|
7218
7492
|
*
|
|
@@ -7221,12 +7495,11 @@ export declare class BasicMIDI {
|
|
|
7221
7495
|
* and populates the BasicMIDI instance with the parsed data.
|
|
7222
7496
|
* It supports Standard MIDI Files (SMF), RIFF MIDI (RMIDI), and Extensible Music Format (XMF).
|
|
7223
7497
|
* It also handles embedded soundbanks in RMIDI and XMF files.
|
|
7224
|
-
* Tracker modules
|
|
7225
|
-
* into MIDI with an embedded sound bank.
|
|
7498
|
+
* Tracker modules are converted into MIDI with an embedded sound bank.
|
|
7226
7499
|
*/
|
|
7227
7500
|
static fromArrayBuffer(arrayBuffer: ArrayBuffer, fileName?: string): BasicMIDI;
|
|
7228
7501
|
/**
|
|
7229
|
-
* Loads a MIDI file (SMF, RMIDI, XMF,
|
|
7502
|
+
* Loads a MIDI file (SMF, RMIDI, XMF, Tracker Modules) from a given file.
|
|
7230
7503
|
* @param file The file to load.
|
|
7231
7504
|
*/
|
|
7232
7505
|
static fromFile(file: File): Promise<BasicMIDI>;
|
|
@@ -7511,7 +7784,7 @@ export declare class BasicMIDI {
|
|
|
7511
7784
|
* > Do not call in audioWorkletGlobalScope as it uses TextDecoder.
|
|
7512
7785
|
*
|
|
7513
7786
|
* @param infoType The metadata type.
|
|
7514
|
-
* @returns `string`, `Date`, `ArrayBuffer` or undefined if the info is not set.
|
|
7787
|
+
* @returns `string`, `Date`, `ArrayBuffer` or undefined if the info is not set (or the creation date cannot be parsed).
|
|
7515
7788
|
*/
|
|
7516
7789
|
getRMIDInfo<K extends keyof RMIDInfoData>(infoType: K): RMIDInfoData[K] | undefined;
|
|
7517
7790
|
/**
|
|
@@ -8295,89 +8568,55 @@ export declare class SpessaSynthSequencer {
|
|
|
8295
8568
|
/**
|
|
8296
8569
|
* The default GS Reverb implementation for {@link SpessaSynthProcessor}.
|
|
8297
8570
|
*
|
|
8571
|
+
* It is modeled on the reverb of the Sound Canvas (as Sound Canvas VA runs it): a mono input through a DC blocker
|
|
8572
|
+
* and the PRE-LPF into a pre delay, a diffuser of four Schroeder allpasses, then two independent tanks
|
|
8573
|
+
* (allpass, delay, allpass, delay, a damping low pass and the time gain back to the start).
|
|
8574
|
+
* The stereo image comes from the output taps alone, four per side.
|
|
8575
|
+
* The characters differ in the delays, the taps and the damping.
|
|
8576
|
+
* The two delay characters are a single delay line with a feedback. The DLL's 1/4 input gain and four equal 1/4
|
|
8577
|
+
* taps cancel there, so neither appears.
|
|
8578
|
+
*
|
|
8579
|
+
* The delays are the 32 kHz sample counts of the Sound Canvas, rounded to whole samples at the host rate.
|
|
8580
|
+
*
|
|
8298
8581
|
* @group Synthesizer.GS Effects
|
|
8299
8582
|
*/
|
|
8300
8583
|
export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
8301
|
-
/**
|
|
8302
|
-
* Dattorro reverb processor.
|
|
8303
|
-
* @private
|
|
8304
|
-
*/
|
|
8305
|
-
private readonly dattorro;
|
|
8306
|
-
/**
|
|
8307
|
-
* Left delay line, also used for the mono delay. (character 6)
|
|
8308
|
-
* @private
|
|
8309
|
-
*/
|
|
8310
|
-
private readonly delayLeft;
|
|
8311
|
-
/**
|
|
8312
|
-
* Right delay line.
|
|
8313
|
-
* @private
|
|
8314
|
-
*/
|
|
8315
|
-
private readonly delayRight;
|
|
8316
|
-
/**
|
|
8317
|
-
* Output of the left (and mono) delay.
|
|
8318
|
-
* @private
|
|
8319
|
-
*/
|
|
8320
|
-
private readonly delayLeftOutput;
|
|
8321
|
-
/**
|
|
8322
|
-
* Output of the right delay.
|
|
8323
|
-
* @private
|
|
8324
|
-
*/
|
|
8325
|
-
private readonly delayRightOutput;
|
|
8326
|
-
/**
|
|
8327
|
-
* Input into the left delay. Mixed dry input and right output.
|
|
8328
|
-
* @private
|
|
8329
|
-
*/
|
|
8330
|
-
private readonly delayLeftInput;
|
|
8331
|
-
/**
|
|
8332
|
-
* Pre LPF buffer for the delay characters.
|
|
8333
|
-
* @private
|
|
8334
|
-
*/
|
|
8335
|
-
private readonly delayPreLPF;
|
|
8336
|
-
/**
|
|
8337
|
-
* Sample rate of the processor.
|
|
8338
|
-
* @private
|
|
8339
|
-
*/
|
|
8340
8584
|
private readonly sampleRate;
|
|
8341
8585
|
/**
|
|
8342
|
-
*
|
|
8343
|
-
* @private
|
|
8344
|
-
*/
|
|
8345
|
-
private preLPFfc;
|
|
8346
|
-
/**
|
|
8347
|
-
* Alpha
|
|
8586
|
+
* One 32 kHz sample in host samples.
|
|
8348
8587
|
* @private
|
|
8349
8588
|
*/
|
|
8350
|
-
private
|
|
8589
|
+
private readonly step;
|
|
8590
|
+
private readonly input;
|
|
8591
|
+
private readonly preDelayLine;
|
|
8592
|
+
private readonly diffuser;
|
|
8593
|
+
private readonly left;
|
|
8594
|
+
private readonly right;
|
|
8351
8595
|
/**
|
|
8352
|
-
*
|
|
8596
|
+
* Every line, in `LINES` order, for the taps to read.
|
|
8353
8597
|
* @private
|
|
8354
8598
|
*/
|
|
8355
|
-
private
|
|
8599
|
+
private readonly lines;
|
|
8600
|
+
private readonly taps;
|
|
8601
|
+
private readonly tapDelays;
|
|
8356
8602
|
/**
|
|
8357
|
-
*
|
|
8603
|
+
* The line of the delay characters.
|
|
8358
8604
|
* @private
|
|
8359
8605
|
*/
|
|
8360
|
-
private
|
|
8606
|
+
private readonly delayLine;
|
|
8607
|
+
private inputGain;
|
|
8361
8608
|
/**
|
|
8362
|
-
*
|
|
8609
|
+
* The gain per pass through a tank, before the damping.
|
|
8363
8610
|
* @private
|
|
8364
8611
|
*/
|
|
8365
|
-
private
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
private
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
* @private
|
|
8374
|
-
*/
|
|
8375
|
-
private delayGain;
|
|
8376
|
-
/**
|
|
8377
|
-
* Panning delay feedback gain (from the right to the left delay).
|
|
8378
|
-
* @private
|
|
8379
|
-
*/
|
|
8380
|
-
private panDelayFeedback;
|
|
8612
|
+
private timeGain;
|
|
8613
|
+
private outputGain;
|
|
8614
|
+
private preDelaySamples;
|
|
8615
|
+
private delayCharacter;
|
|
8616
|
+
private panning;
|
|
8617
|
+
private delaySamples;
|
|
8618
|
+
private delayHalfSamples;
|
|
8619
|
+
private delayFeedbackGain;
|
|
8381
8620
|
/**
|
|
8382
8621
|
* Constructs a new default GS reverb processor.
|
|
8383
8622
|
* @param sampleRate The sample rate, in Hertz.
|
|
@@ -8385,6 +8624,9 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
8385
8624
|
* Processing more samples than this is not supported and produces undefined output.
|
|
8386
8625
|
*/
|
|
8387
8626
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
8627
|
+
private _level;
|
|
8628
|
+
get level(): number;
|
|
8629
|
+
set level(value: number);
|
|
8388
8630
|
private _delayFeedback;
|
|
8389
8631
|
get delayFeedback(): number;
|
|
8390
8632
|
set delayFeedback(value: number);
|
|
@@ -8397,9 +8639,6 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
8397
8639
|
private _preDelayTime;
|
|
8398
8640
|
get preDelayTime(): number;
|
|
8399
8641
|
set preDelayTime(value: number);
|
|
8400
|
-
private _level;
|
|
8401
|
-
get level(): number;
|
|
8402
|
-
set level(value: number);
|
|
8403
8642
|
private _preLowpass;
|
|
8404
8643
|
get preLowpass(): number;
|
|
8405
8644
|
set preLowpass(value: number);
|
|
@@ -8412,46 +8651,46 @@ export declare class DefaultGSReverb implements GSReverbProcessor {
|
|
|
8412
8651
|
* @param sampleCount The amount of samples to mix.
|
|
8413
8652
|
*/
|
|
8414
8653
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
8654
|
+
reset(): void;
|
|
8415
8655
|
getSnapshot(): GSReverbParameter;
|
|
8416
8656
|
applySnapshot(snapshot: GSReverbParameter): void;
|
|
8417
|
-
private
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8657
|
+
private clear;
|
|
8658
|
+
/**
|
|
8659
|
+
* The delay characters: one delay line that feeds back.
|
|
8660
|
+
* The panning delay takes its left output from the middle of the line, so the repeats alternate.
|
|
8661
|
+
*/
|
|
8662
|
+
private processDelay;
|
|
8421
8663
|
}
|
|
8422
8664
|
/**
|
|
8423
8665
|
* The default GS Chorus implementation for {@link SpessaSynthProcessor}.
|
|
8424
8666
|
*
|
|
8667
|
+
* It is modeled on the chorus of the Sound Canvas (as Sound Canvas VA runs it): a mono input through a DC blocker
|
|
8668
|
+
* and the PRE-LPF into one delay line, read at two places that a triangle LFO moves in opposite directions.
|
|
8669
|
+
* The first read is the left output and the feedback, the second one the right output.
|
|
8670
|
+
* The reads interpolate linearly between samples, like the Sound Canvas does at 32 kHz.
|
|
8671
|
+
*
|
|
8425
8672
|
* @group Synthesizer.GS Effects
|
|
8426
8673
|
*/
|
|
8427
8674
|
export declare class DefaultGSChorus implements GSChorusProcessor {
|
|
8428
8675
|
/**
|
|
8429
|
-
*
|
|
8430
|
-
* @private
|
|
8431
|
-
*/
|
|
8432
|
-
private preLPFfc;
|
|
8433
|
-
/**
|
|
8434
|
-
* Alpha
|
|
8676
|
+
* One 32 kHz sample in host samples.
|
|
8435
8677
|
* @private
|
|
8436
8678
|
*/
|
|
8437
|
-
private
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
*/
|
|
8442
|
-
private preLPFz;
|
|
8443
|
-
private readonly leftDelayBuffer;
|
|
8444
|
-
private readonly rightDelayBuffer;
|
|
8445
|
-
private readonly sampleRate;
|
|
8446
|
-
private phase;
|
|
8447
|
-
private write;
|
|
8679
|
+
private readonly step;
|
|
8680
|
+
private readonly input;
|
|
8681
|
+
private readonly lfo;
|
|
8682
|
+
private readonly delayLine;
|
|
8448
8683
|
private gain;
|
|
8449
8684
|
private reverbGain;
|
|
8450
8685
|
private delayGain;
|
|
8451
|
-
private depthSamples;
|
|
8452
|
-
private delaySamples;
|
|
8453
|
-
private rateInc;
|
|
8454
8686
|
private feedbackGain;
|
|
8687
|
+
private delaySamples;
|
|
8688
|
+
private depthSamples;
|
|
8689
|
+
/**
|
|
8690
|
+
* The first read of the previous sample, which is what feeds back.
|
|
8691
|
+
* @private
|
|
8692
|
+
*/
|
|
8693
|
+
private feedbackSample;
|
|
8455
8694
|
/**
|
|
8456
8695
|
* Constructs a new default GS chorus processor.
|
|
8457
8696
|
* @param sampleRate The sample rate, in Hertz.
|
|
@@ -8459,6 +8698,9 @@ export declare class DefaultGSChorus implements GSChorusProcessor {
|
|
|
8459
8698
|
* Processing more samples than this is not supported and produces undefined output.
|
|
8460
8699
|
*/
|
|
8461
8700
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
8701
|
+
private _level;
|
|
8702
|
+
get level(): number;
|
|
8703
|
+
set level(value: number);
|
|
8462
8704
|
private _sendLevelToReverb;
|
|
8463
8705
|
get sendLevelToReverb(): number;
|
|
8464
8706
|
set sendLevelToReverb(value: number);
|
|
@@ -8480,58 +8722,47 @@ export declare class DefaultGSChorus implements GSChorusProcessor {
|
|
|
8480
8722
|
private _rate;
|
|
8481
8723
|
get rate(): number;
|
|
8482
8724
|
set rate(value: number);
|
|
8483
|
-
private _level;
|
|
8484
|
-
get level(): number;
|
|
8485
|
-
set level(value: number);
|
|
8486
8725
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, outputDelay: Float32Array, startIndex: number, sampleCount: number): void;
|
|
8726
|
+
reset(): void;
|
|
8487
8727
|
getSnapshot(): GSChorusParameter;
|
|
8488
8728
|
applySnapshot(snapshot: GSChorusParameter): void;
|
|
8489
8729
|
}
|
|
8490
8730
|
/**
|
|
8491
8731
|
* The default GS Delay implementation for {@link SpessaSynthProcessor}.
|
|
8492
8732
|
*
|
|
8733
|
+
* It is modeled on the delay of the Sound Canvas (as Sound Canvas VA runs it): a mono input through a DC blocker
|
|
8734
|
+
* and the PRE-LPF into one delay line with three taps.
|
|
8735
|
+
* ```
|
|
8736
|
+
* input --> (+) --> delay line --+-- center --> L and R
|
|
8737
|
+
* ^ +-- left ----> L
|
|
8738
|
+
* | +-- right ---> R
|
|
8739
|
+
* +---- x feedback <-- center (previous sample)
|
|
8740
|
+
* ```
|
|
8741
|
+
* The center always feeds back, at the center time, even with LEVEL CENTER at 0 (hardware and SC-VA agree).
|
|
8742
|
+
* The left and right taps follow the center time through their ratios.
|
|
8743
|
+
* The send to reverb takes the three taps (the center once) before LEVEL, so it works even at LEVEL 0.
|
|
8744
|
+
*
|
|
8493
8745
|
* @group Synthesizer.GS Effects
|
|
8494
8746
|
*/
|
|
8495
8747
|
export declare class DefaultGSDelay implements GSDelayProcessor {
|
|
8496
|
-
/**
|
|
8497
|
-
* Cutoff frequency
|
|
8498
|
-
* @private
|
|
8499
|
-
*/
|
|
8500
|
-
private preLPFfc;
|
|
8501
|
-
/**
|
|
8502
|
-
* Alpha
|
|
8503
|
-
* @private
|
|
8504
|
-
*/
|
|
8505
|
-
private preLPFa;
|
|
8506
|
-
/**
|
|
8507
|
-
* Previous value
|
|
8508
|
-
* @private
|
|
8509
|
-
*/
|
|
8510
|
-
private preLPFz;
|
|
8511
|
-
private readonly buffer;
|
|
8512
8748
|
private readonly sampleRate;
|
|
8513
|
-
private readonly
|
|
8514
|
-
private
|
|
8515
|
-
private delayRightMultiplier;
|
|
8749
|
+
private readonly input;
|
|
8750
|
+
private readonly delayLine;
|
|
8516
8751
|
private gain;
|
|
8517
8752
|
private reverbGain;
|
|
8518
8753
|
private feedbackGain;
|
|
8519
|
-
|
|
8520
|
-
* Samples
|
|
8521
|
-
*/
|
|
8754
|
+
private delayCenterMs;
|
|
8522
8755
|
private delayCenter;
|
|
8523
|
-
/**
|
|
8524
|
-
* Samples
|
|
8525
|
-
*/
|
|
8526
8756
|
private delayLeft;
|
|
8527
|
-
/**
|
|
8528
|
-
* Samples
|
|
8529
|
-
*/
|
|
8530
8757
|
private delayRight;
|
|
8531
8758
|
private gainCenter;
|
|
8532
8759
|
private gainLeft;
|
|
8533
8760
|
private gainRight;
|
|
8534
|
-
|
|
8761
|
+
/**
|
|
8762
|
+
* The center tap of the previous sample, which is what feeds back.
|
|
8763
|
+
* @private
|
|
8764
|
+
*/
|
|
8765
|
+
private feedbackSample;
|
|
8535
8766
|
/**
|
|
8536
8767
|
* Constructs a new default GS delay processor.
|
|
8537
8768
|
* @param sampleRate The sample rate, in Hertz.
|
|
@@ -8539,36 +8770,36 @@ export declare class DefaultGSDelay implements GSDelayProcessor {
|
|
|
8539
8770
|
* Processing more samples than this is not supported and produces undefined output.
|
|
8540
8771
|
*/
|
|
8541
8772
|
constructor(sampleRate: number, maxBufferSize: number);
|
|
8773
|
+
private _level;
|
|
8774
|
+
get level(): number;
|
|
8775
|
+
set level(value: number);
|
|
8542
8776
|
private _sendLevelToReverb;
|
|
8543
8777
|
get sendLevelToReverb(): number;
|
|
8544
8778
|
set sendLevelToReverb(value: number);
|
|
8779
|
+
private _levelCenter;
|
|
8780
|
+
get levelCenter(): number;
|
|
8781
|
+
set levelCenter(value: number);
|
|
8545
8782
|
private _preLowpass;
|
|
8546
8783
|
get preLowpass(): number;
|
|
8547
8784
|
set preLowpass(value: number);
|
|
8785
|
+
private _feedback;
|
|
8786
|
+
get feedback(): number;
|
|
8787
|
+
set feedback(value: number);
|
|
8548
8788
|
private _levelRight;
|
|
8549
8789
|
get levelRight(): number;
|
|
8550
8790
|
set levelRight(value: number);
|
|
8551
|
-
private
|
|
8552
|
-
get
|
|
8553
|
-
set
|
|
8554
|
-
private _levelCenter;
|
|
8555
|
-
get levelCenter(): number;
|
|
8556
|
-
set levelCenter(value: number);
|
|
8791
|
+
private _timeCenter;
|
|
8792
|
+
get timeCenter(): number;
|
|
8793
|
+
set timeCenter(value: number);
|
|
8557
8794
|
private _levelLeft;
|
|
8558
8795
|
get levelLeft(): number;
|
|
8559
8796
|
set levelLeft(value: number);
|
|
8560
|
-
private _feedback;
|
|
8561
|
-
get feedback(): number;
|
|
8562
|
-
set feedback(value: number);
|
|
8563
8797
|
private _timeRatioRight;
|
|
8564
8798
|
get timeRatioRight(): number;
|
|
8565
8799
|
set timeRatioRight(value: number);
|
|
8566
8800
|
private _timeRatioLeft;
|
|
8567
8801
|
get timeRatioLeft(): number;
|
|
8568
8802
|
set timeRatioLeft(value: number);
|
|
8569
|
-
private _timeCenter;
|
|
8570
|
-
get timeCenter(): number;
|
|
8571
|
-
set timeCenter(value: number);
|
|
8572
8803
|
/**
|
|
8573
8804
|
* Process the effect and ADDS it to the output.
|
|
8574
8805
|
* @param input The input buffer to process. It always starts at index 0.
|
|
@@ -8579,10 +8810,11 @@ export declare class DefaultGSDelay implements GSDelayProcessor {
|
|
|
8579
8810
|
* @param sampleCount The amount of samples to mix.
|
|
8580
8811
|
*/
|
|
8581
8812
|
process(input: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, outputReverb: Float32Array, startIndex: number, sampleCount: number): void;
|
|
8813
|
+
reset(): void;
|
|
8582
8814
|
getSnapshot(): GSDelayParameter;
|
|
8583
8815
|
applySnapshot(snapshot: GSDelayParameter): void;
|
|
8816
|
+
private clear;
|
|
8584
8817
|
private updateDelayTimes;
|
|
8585
|
-
private updateGain;
|
|
8586
8818
|
}
|
|
8587
8819
|
/**
|
|
8588
8820
|
* The default GS Equalizer implementation for {@link SpessaSynthProcessor}.
|
|
@@ -8619,6 +8851,7 @@ export declare class DefaultGSEqualizer implements GSEqualizerProcessor {
|
|
|
8619
8851
|
get highGain(): number;
|
|
8620
8852
|
set highGain(value: number);
|
|
8621
8853
|
process(inputLeft: Float32Array, inputRight: Float32Array, outputLeft: Float32Array, outputRight: Float32Array, startIndex: number, sampleCount: number): void;
|
|
8854
|
+
reset(): void;
|
|
8622
8855
|
getSnapshot(): GSEqualizerParameter;
|
|
8623
8856
|
applySnapshot(snapshot: GSEqualizerParameter): void;
|
|
8624
8857
|
private getBand;
|
|
@@ -8746,15 +8979,15 @@ export declare const DEFAULT_DRUM_REVERB: Int8Array<ArrayBuffer>;
|
|
|
8746
8979
|
*/
|
|
8747
8980
|
export declare const DEFAULT_SOUND_BANK_CLONE_OPTIONS: SoundBankCloneOptions;
|
|
8748
8981
|
/**
|
|
8749
|
-
* Clones presets, instruments and
|
|
8982
|
+
* Clones presets, instruments, samples and custom curves into a sound bank, as one session.
|
|
8750
8983
|
* Elements copied once in a session are reused when something else in the session uses them again,
|
|
8751
8984
|
* so an instrument used by two cloned presets is only copied once.
|
|
8752
|
-
* Stereo pairs are always cloned together.
|
|
8985
|
+
* Stereo pairs are always cloned together. Custom curves used by modulators are cloned like samples.
|
|
8753
8986
|
*
|
|
8754
8987
|
* > **Tip**
|
|
8755
8988
|
* >
|
|
8756
8989
|
* > With `addToBank: false`, nothing is added to the bank. The new elements are listed in {@link created},
|
|
8757
|
-
* > in an order they can be added in (samples first, then instruments, then presets).
|
|
8990
|
+
* > in an order they can be added in (curves and samples first, then instruments, then presets).
|
|
8758
8991
|
* > Their zones still link to the children they use, like {@link BasicInstrument.createZone} does,
|
|
8759
8992
|
* > so a reused child in the bank counts them as users.
|
|
8760
8993
|
*
|
|
@@ -8765,6 +8998,7 @@ export declare class SoundBankCloner {
|
|
|
8765
8998
|
* The new elements this session made, in the order they were made. Reused elements are not listed.
|
|
8766
8999
|
*/
|
|
8767
9000
|
readonly created: {
|
|
9001
|
+
customCurves: CustomCurve[];
|
|
8768
9002
|
samples: BasicSample[];
|
|
8769
9003
|
instruments: BasicInstrument[];
|
|
8770
9004
|
presets: BasicPreset[];
|
|
@@ -8778,6 +9012,7 @@ export declare class SoundBankCloner {
|
|
|
8778
9012
|
*/
|
|
8779
9013
|
readonly options: SoundBankCloneOptions;
|
|
8780
9014
|
private readonly sampleClones;
|
|
9015
|
+
private readonly curveClones;
|
|
8781
9016
|
private readonly instrumentClones;
|
|
8782
9017
|
/**
|
|
8783
9018
|
* Creates a new clone session.
|
|
@@ -8798,6 +9033,18 @@ export declare class SoundBankCloner {
|
|
|
8798
9033
|
* @returns The clone, or undefined if the session has not cloned the element.
|
|
8799
9034
|
*/
|
|
8800
9035
|
getClone(source: BasicInstrument): BasicInstrument | undefined;
|
|
9036
|
+
/**
|
|
9037
|
+
* Gets the clone this session made of an element.
|
|
9038
|
+
* @param source The curve that was cloned.
|
|
9039
|
+
* @returns The clone, or undefined if the session has not cloned the element.
|
|
9040
|
+
*/
|
|
9041
|
+
getClone(source: CustomCurve): CustomCurve | undefined;
|
|
9042
|
+
/**
|
|
9043
|
+
* Clones a custom curve.
|
|
9044
|
+
* @param curve The curve to clone.
|
|
9045
|
+
* @returns The clone, or the existing curve with the same name if it is reused.
|
|
9046
|
+
*/
|
|
9047
|
+
cloneCustomCurve(curve: CustomCurve): CustomCurve;
|
|
8801
9048
|
/**
|
|
8802
9049
|
* Clones a sample and its stereo partner.
|
|
8803
9050
|
* The data is shared with the original, not copied.
|
|
@@ -8819,6 +9066,7 @@ export declare class SoundBankCloner {
|
|
|
8819
9066
|
clonePreset(preset: BasicPreset): BasicPreset;
|
|
8820
9067
|
private copyInstrument;
|
|
8821
9068
|
private copySample;
|
|
9069
|
+
private copyCurve;
|
|
8822
9070
|
/**
|
|
8823
9071
|
* Finds the element to use instead of a copy, if the options allow one.
|
|
8824
9072
|
*/
|
|
@@ -8839,11 +9087,19 @@ export declare const DEFAULT_SOUND_BANK_LOAD_OPTIONS: SoundBankLoadOptions;
|
|
|
8839
9087
|
export declare class SoundBankLoader {
|
|
8840
9088
|
/**
|
|
8841
9089
|
* Loads a sound bank from a file buffer.
|
|
9090
|
+
*
|
|
9091
|
+
* Currently supported formats are:
|
|
9092
|
+
*
|
|
9093
|
+
* - SoundFont2 - With optional SpessaSynth extensions.
|
|
9094
|
+
* - SoundFont3 - Like SoundFont2 but also allows Ogg Vorbis-compressed samples.
|
|
9095
|
+
* - DownLoadable Sounds.
|
|
9096
|
+
* - SpessaSynth SFe.
|
|
9097
|
+
*
|
|
8842
9098
|
* @param buffer The binary file buffer to load.
|
|
8843
9099
|
* @param options Options for loading the sample data.
|
|
8844
9100
|
* @returns The loaded sound bank.
|
|
8845
9101
|
*/
|
|
8846
9102
|
static fromArrayBuffer(buffer: ArrayBuffer, options?: Partial<SoundBankLoadOptions>): BasicSoundBank;
|
|
8847
9103
|
}
|
|
8848
|
-
export type { ChannelDrumModification, ChannelGenerators, ChannelMIDIParameter, ChannelModification, ChannelSnapshot, ChannelSystemParameter, ClearableParameter, FourCC, GenericRIFFFourCC, GlobalMIDIParameter, GlobalSystemParameter, LinkableZoneChild, MIDIController, MIDIMessageType, ModifyMIDIOptions, SynthesizerSnapshot, UserDrumModification, WAVFourCC };
|
|
9104
|
+
export type { ChannelDrumModification, ChannelGenerators, ChannelMIDIParameter, ChannelModification, ChannelSnapshot, ChannelSystemParameter, ClearableParameter, ControllerMatrixSnapshot, CustomCurvePoint, CustomCurveUser, FourCC, GenericRIFFFourCC, GlobalMIDIParameter, GlobalSystemParameter, LinkableZoneChild, MIDIController, MIDIMessageType, ModifyMIDIOptions, SynthesizerSnapshot, UserDrumModification, WAVFourCC };
|
|
8849
9105
|
//# sourceMappingURL=index.d.ts.map
|