spessasynth_core 3.26.8 → 3.26.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_core",
3
- "version": "3.26.8",
3
+ "version": "3.26.9",
4
4
  "description": "MIDI and SoundFont2/DLS library with no compromises",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -152,6 +152,13 @@ import { isSystemXG } from "../../utils/xg_hacks.js";
152
152
  * @property {number} time - the audio context time when the event should execute, in seconds.
153
153
  */
154
154
 
155
+ /**
156
+ * @type {SynthMethodOptions}
157
+ */
158
+ const DEFAULT_SYNTH_METHOD_OPTIONS = {
159
+ time: 0
160
+ };
161
+
155
162
  // if the note is released faster than that, it forced to last that long
156
163
  // this is used mostly for drum channels, where a lot of midis like to send instant note off after a note on
157
164
  export const MIN_NOTE_LENGTH = 0.03;
@@ -386,7 +393,7 @@ class SpessaSynthProcessor
386
393
  this.midiOutputsCount = options.midiChannels;
387
394
  this.effectsEnabled = options.effectsEnabled;
388
395
  this.enableEventSystem = options.enableEventSystem;
389
- this.currentSynthTime = options.midiChannels;
396
+ this.currentSynthTime = options.initialTime;
390
397
  this.sampleTime = 1 / sampleRate;
391
398
  this.sampleRate = sampleRate;
392
399
 
@@ -634,12 +641,13 @@ class SpessaSynthProcessor
634
641
 
635
642
  // noinspection JSUnusedGlobalSymbols
636
643
  /**
637
- * @param message {Uint8Array}
638
- * @param channelOffset {number}
644
+ * Processes a MIDI message
645
+ * @param message {Uint8Array} - the message to process
646
+ * @param channelOffset {number} - channel offset for the message
639
647
  * @param force {boolean} cool stuff
640
- * @param options {SynthMethodOptions}
648
+ * @param options {SynthMethodOptions} - additional options for scheduling the message
641
649
  */
642
- processMessage(message, channelOffset, force, options)
650
+ processMessage(message, channelOffset = 0, force = false, options = DEFAULT_SYNTH_METHOD_OPTIONS)
643
651
  {
644
652
  const call = () =>
645
653
  {