spessasynth_lib 3.24.8 → 3.24.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # spessasynth_lib
2
2
 
3
- **A powerful soundfont/MIDI JavaScript library for the browsers.**
3
+ **A powerful SF2/DLS/MIDI JavaScript library for the browsers.**
4
4
 
5
5
  ```shell
6
6
  npm install --save spessasynth_lib
@@ -134,5 +134,5 @@ document.getElementById("button").onclick = async () =>
134
134
  - *That's right, saving as WAV is also [just one function!](https://github.com/spessasus/SpessaSynth/wiki/Writing-Wave-Files#audiobuffertowav)*
135
135
 
136
136
  # License
137
-
137
+ Copyright © 2025 Spessasus
138
138
  MIT License, except for the stbvorbis_sync.js in the `externals` folder which is licensed under the Apache-2.0 license.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spessasynth_lib",
3
- "version": "3.24.8",
3
+ "version": "3.24.9",
4
4
  "description": "MIDI and SoundFont2/DLS library with no compromises",
5
5
  "browser": "index.js",
6
6
  "type": "module",
@@ -2,11 +2,14 @@ import { WorkletSequencerReturnMessageType } from "./sequencer_message.js";
2
2
 
3
3
  /**
4
4
  * Processes a single tick
5
- * @private
6
5
  * @this {WorkletSequencer}
7
6
  */
8
- export function _processTick()
7
+ export function processTick()
9
8
  {
9
+ if (!this.isActive)
10
+ {
11
+ return;
12
+ }
10
13
  let current = this.currentTime;
11
14
  while (this.playedTime < current)
12
15
  {
@@ -1,6 +1,6 @@
1
1
  import { WorkletSequencerReturnMessageType } from "./sequencer_message.js";
2
2
  import { _addNewMidiPort, _processEvent } from "./process_event.js";
3
- import { _findFirstEventIndex, _processTick } from "./process_tick.js";
3
+ import { _findFirstEventIndex, processTick } from "./process_tick.js";
4
4
  import { assignMIDIPort, loadNewSequence, loadNewSongList, nextSong, previousSong } from "./song_control.js";
5
5
  import { _playTo, _recalculateStartTime, play, setTimeTicks } from "./play.js";
6
6
  import { messageTypes, midiControllers } from "../../midi_parser/midi_message.js";
@@ -25,6 +25,7 @@ class WorkletSequencer
25
25
  {
26
26
  this.synth = spessasynthProcessor;
27
27
  this.ignoreEvents = false;
28
+ this.isActive = false;
28
29
 
29
30
  /**
30
31
  * If the event should instead be sent back to the main thread instead of synth
@@ -236,12 +237,12 @@ class WorkletSequencer
236
237
 
237
238
  setProcessHandler()
238
239
  {
239
- this.synth.processTickCallback = this._processTick.bind(this);
240
+ this.isActive = true;
240
241
  }
241
242
 
242
243
  clearProcessHandler()
243
244
  {
244
- this.synth.processTickCallback = undefined;
245
+ this.isActive = false;
245
246
  }
246
247
  }
247
248
 
@@ -258,7 +259,7 @@ WorkletSequencer.prototype.processMessage = processMessage;
258
259
 
259
260
  WorkletSequencer.prototype._processEvent = _processEvent;
260
261
  WorkletSequencer.prototype._addNewMidiPort = _addNewMidiPort;
261
- WorkletSequencer.prototype._processTick = _processTick;
262
+ WorkletSequencer.prototype.processTick = processTick;
262
263
  WorkletSequencer.prototype._findFirstEventIndex = _findFirstEventIndex;
263
264
 
264
265
  WorkletSequencer.prototype.loadNewSequence = loadNewSequence;