spessasynth_core 4.3.21 → 4.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2524,6 +2524,73 @@ interface TimelineEvent {
2524
2524
  }
2525
2525
  type SysExAcceptedArray = number[] | Uint8Array | Int8Array | Uint8ClampedArray;
2526
2526
  //#endregion
2527
+ //#region src/midi/midi_message.d.ts
2528
+ declare class MIDIMessage {
2529
+ /**
2530
+ * Absolute number of MIDI ticks from the start of the track.
2531
+ */
2532
+ ticks: number;
2533
+ /**
2534
+ * The MIDI message status byte. Note that for meta events, it is the second byte. (not 0xFF).
2535
+ */
2536
+ statusByte: MIDIMessageType;
2537
+ /**
2538
+ * Message's binary data.
2539
+ */
2540
+ data: Uint8Array<ArrayBuffer>;
2541
+ /**
2542
+ * Creates a new MIDI message.
2543
+ * @param ticks time of this message in absolute MIDI ticks.
2544
+ * @param byte the message status byte.
2545
+ * @param data the message's binary data.
2546
+ */
2547
+ constructor(ticks: number, byte: MIDIMessageType, data: Uint8Array<ArrayBuffer>);
2548
+ /**
2549
+ * Returns a new MIDI Pitch Wheel message.
2550
+ * @param ticks time of this message in absolute MIDI ticks.
2551
+ * @param channel the channel number of this message.
2552
+ * @param value the new value, between 0 and 16383, where 8192 is the center (no pitch change).
2553
+ */
2554
+ static pitchWheel(ticks: number, channel: number, value: number): MIDIMessage;
2555
+ /**
2556
+ * Returns a new MIDI Channel Pressure message.
2557
+ * @param ticks time of this message in absolute MIDI ticks.
2558
+ * @param channel the channel number of this message.
2559
+ * @param value the new value, between 0 and 127.
2560
+ */
2561
+ static channelPressure(ticks: number, channel: number, value: number): MIDIMessage;
2562
+ /**
2563
+ * Returns a new MIDI Program Change message.
2564
+ * @param ticks time of this message in absolute MIDI ticks.
2565
+ * @param channel the channel number of this message.
2566
+ * @param program the new MIDI program number, between 0 and 127.
2567
+ */
2568
+ static programChange(ticks: number, channel: number, program: number): MIDIMessage;
2569
+ /**
2570
+ * Returns a new MIDI Controller Change message.
2571
+ * @param ticks time of this message in absolute MIDI ticks.
2572
+ * @param channel the channel number of this message.
2573
+ * @param controller the MIDI controller.
2574
+ * @param value the new value.
2575
+ */
2576
+ static controllerChange(ticks: number, channel: number, controller: MIDIController, value: number): MIDIMessage;
2577
+ /**
2578
+ * Returns a new MIDI System Exclusive message.
2579
+ * @param ticks time of this message in absolute MIDI ticks.
2580
+ * @param data the data of the system exclusive message,
2581
+ * excluding the starting 0xF0 byte.
2582
+ */
2583
+ static systemExclusive(ticks: number, data: number[]): MIDIMessage;
2584
+ /**
2585
+ * Returns a new MIDI Registered Parameter message. Sends both data MSB and LSB.
2586
+ * @param ticks time of this message in absolute MIDI ticks.
2587
+ * @param channel the channel number of this message.
2588
+ * @param parameter the 14-bit MIDI registered parameter number.
2589
+ * @param value the 14-bit new value.
2590
+ */
2591
+ static registeredParameter(ticks: number, channel: number, parameter: number, value: number): MIDIMessage[];
2592
+ }
2593
+ //#endregion
2527
2594
  //#region src/synthesizer/processor.d.ts
2528
2595
  /**
2529
2596
  * Processor.ts
@@ -2625,7 +2692,14 @@ declare class SpessaSynthProcessor {
2625
2692
  * @param channelOffset The channel offset for the message. It will be added to message's channel number if applicable.
2626
2693
  * @param options Additional options for scheduling the message.
2627
2694
  */
2628
- readonly processMessage: (message: SysExAcceptedArray, channelOffset?: number, options?: SynthMethodOptions) => void;
2695
+ readonly processMessage: (message: SysExAcceptedArray | MIDIMessage, channelOffset?: number, options?: SynthMethodOptions) => void;
2696
+ /**
2697
+ * Processes multiple MIDI messages and allows scheduling them at a specific time.
2698
+ * @param message The MIDI messages to process.
2699
+ * @param channelOffset The channel offset for the messages. It will be added to messages' channel number if applicable.
2700
+ * @param options Additional options for scheduling the message.
2701
+ */
2702
+ readonly processMessages: (message: (SysExAcceptedArray | MIDIMessage)[], channelOffset?: number, options?: SynthMethodOptions) => void;
2629
2703
  /**
2630
2704
  * Core synthesis engine.
2631
2705
  */
@@ -2780,73 +2854,6 @@ declare const CONTROLLER_TABLE_SIZE = 128;
2780
2854
  declare const DEFAULT_MIDI_CONTROLLERS: Readonly<Int16Array>;
2781
2855
  declare const DEFAULT_DRUM_REVERB: Int8Array<ArrayBuffer>;
2782
2856
  //#endregion
2783
- //#region src/midi/midi_message.d.ts
2784
- declare class MIDIMessage {
2785
- /**
2786
- * Absolute number of MIDI ticks from the start of the track.
2787
- */
2788
- ticks: number;
2789
- /**
2790
- * The MIDI message status byte. Note that for meta events, it is the second byte. (not 0xFF).
2791
- */
2792
- statusByte: MIDIMessageType;
2793
- /**
2794
- * Message's binary data.
2795
- */
2796
- data: Uint8Array<ArrayBuffer>;
2797
- /**
2798
- * Creates a new MIDI message.
2799
- * @param ticks time of this message in absolute MIDI ticks.
2800
- * @param byte the message status byte.
2801
- * @param data the message's binary data.
2802
- */
2803
- constructor(ticks: number, byte: MIDIMessageType, data: Uint8Array<ArrayBuffer>);
2804
- /**
2805
- * Returns a new MIDI Pitch Wheel message.
2806
- * @param ticks time of this message in absolute MIDI ticks.
2807
- * @param channel the channel number of this message.
2808
- * @param value the new value, between 0 and 16383, where 8192 is the center (no pitch change).
2809
- */
2810
- static pitchWheel(ticks: number, channel: number, value: number): MIDIMessage;
2811
- /**
2812
- * Returns a new MIDI Channel Pressure message.
2813
- * @param ticks time of this message in absolute MIDI ticks.
2814
- * @param channel the channel number of this message.
2815
- * @param value the new value, between 0 and 127.
2816
- */
2817
- static channelPressure(ticks: number, channel: number, value: number): MIDIMessage;
2818
- /**
2819
- * Returns a new MIDI Program Change message.
2820
- * @param ticks time of this message in absolute MIDI ticks.
2821
- * @param channel the channel number of this message.
2822
- * @param program the new MIDI program number, between 0 and 127.
2823
- */
2824
- static programChange(ticks: number, channel: number, program: number): MIDIMessage;
2825
- /**
2826
- * Returns a new MIDI Controller Change message.
2827
- * @param ticks time of this message in absolute MIDI ticks.
2828
- * @param channel the channel number of this message.
2829
- * @param controller the MIDI controller.
2830
- * @param value the new value.
2831
- */
2832
- static controllerChange(ticks: number, channel: number, controller: MIDIController, value: number): MIDIMessage;
2833
- /**
2834
- * Returns a new MIDI System Exclusive message.
2835
- * @param ticks time of this message in absolute MIDI ticks.
2836
- * @param data the data of the system exclusive message,
2837
- * excluding the starting 0xF0 byte.
2838
- */
2839
- static systemExclusive(ticks: number, data: number[]): MIDIMessage;
2840
- /**
2841
- * Returns a new MIDI Registered Parameter message. Sends both data MSB and LSB.
2842
- * @param ticks time of this message in absolute MIDI ticks.
2843
- * @param channel the channel number of this message.
2844
- * @param parameter the 14-bit MIDI registered parameter number.
2845
- * @param value the 14-bit new value.
2846
- */
2847
- static registeredParameter(ticks: number, channel: number, parameter: number, value: number): MIDIMessage[];
2848
- }
2849
- //#endregion
2850
2857
  //#region src/synthesizer/audio_engine/parameters/midi.d.ts
2851
2858
  interface GlobalMIDIParameter {
2852
2859
  /**
package/dist/index.js CHANGED
@@ -20529,6 +20529,13 @@ var SpessaSynthProcessor = class {
20529
20529
  */
20530
20530
  processMessage;
20531
20531
  /**
20532
+ * Processes multiple MIDI messages and allows scheduling them at a specific time.
20533
+ * @param message The MIDI messages to process.
20534
+ * @param channelOffset The channel offset for the messages. It will be added to messages' channel number if applicable.
20535
+ * @param options Additional options for scheduling the message.
20536
+ */
20537
+ processMessages;
20538
+ /**
20532
20539
  * Core synthesis engine.
20533
20540
  */
20534
20541
  synthCore;
@@ -20558,6 +20565,7 @@ var SpessaSynthProcessor = class {
20558
20565
  this.pitchWheel = c.pitchWheel.bind(c);
20559
20566
  this.programChange = c.programChange.bind(c);
20560
20567
  this.processMessage = c.processMessage.bind(c);
20568
+ this.processMessages = c.processMessages.bind(c);
20561
20569
  for (let i = 0; i < 16; i++) this.synthCore.createMIDIChannel(false);
20562
20570
  this.processorInitialized.then(() => {
20563
20571
  SpessaLog.info("%cSpessaSynth is ready!", ConsoleColors.recognized);