spessasynth_lib 3.25.18 → 3.25.19
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/index.js +4 -0
- package/package.json +1 -1
- package/sequencer/worklet_sequencer/play.js +2 -2
- package/sequencer/worklet_sequencer/worklet_sequencer.js +4 -3
- package/soundfont/basic_soundfont/generator.js +1 -1
- package/soundfont/dls/read_region.js +1 -5
- package/synthetizer/synthetizer.js +1 -0
- package/synthetizer/worklet_processor.min.js +11 -11
- package/synthetizer/worklet_system/README.md +14 -1
- package/synthetizer/worklet_system/main_processor.js +94 -96
- package/synthetizer/worklet_system/worklet_methods/controller_control/controller_change.js +1 -1
- package/synthetizer/worklet_system/worklet_methods/note_on.js +1 -2
- package/synthetizer/worklet_system/worklet_methods/render_voice.js +2 -3
- package/synthetizer/worklet_system/worklet_methods/stopping_notes/kill_note.js +1 -1
- package/synthetizer/worklet_system/worklet_methods/stopping_notes/note_off.js +1 -1
- package/synthetizer/worklet_system/worklet_methods/stopping_notes/stop_all_notes.js +2 -2
- package/synthetizer/worklet_system/worklet_processor.js +334 -3
- package/synthetizer/worklet_system/worklet_utilities/lowpass_filter.js +20 -3
- package/synthetizer/worklet_system/worklet_utilities/stereo_panner.js +2 -2
- package/synthetizer/worklet_system/worklet_utilities/worklet_processor_channel.js +1 -1
- package/synthetizer/worklet_system/worklet_utilities/worklet_voice.js +12 -11
- package/synthetizer/worklet_system/message_protocol/handle_message.js +0 -210
- package/synthetizer/worklet_system/snapshot/send_synthesizer_snapshot.js +0 -14
package/index.js
CHANGED
|
@@ -27,6 +27,8 @@ import { DEFAULT_SYNTH_CONFIG } from "./synthetizer/audio_effects/effects_config
|
|
|
27
27
|
import { WORKLET_URL_ABSOLUTE } from './synthetizer/worklet_url.js';
|
|
28
28
|
import { SynthesizerSnapshot} from "./synthetizer/worklet_system/snapshot/synthesizer_snapshot.js";
|
|
29
29
|
import { ChannelSnapshot } from "./synthetizer/worklet_system/snapshot/channel_snapshot.js";
|
|
30
|
+
import { NON_CC_INDEX_OFFSET } from "./synthetizer/worklet_system/worklet_utilities/controller_tables.js";
|
|
31
|
+
import { ALL_CHANNELS_OR_DIFFERENT_ACTION } from "./synthetizer/worklet_system/message_protocol/worklet_message.js";
|
|
30
32
|
|
|
31
33
|
// Export modules
|
|
32
34
|
export {
|
|
@@ -38,6 +40,8 @@ export {
|
|
|
38
40
|
DEFAULT_PERCUSSION,
|
|
39
41
|
VOICE_CAP,
|
|
40
42
|
DEFAULT_SYNTH_CONFIG,
|
|
43
|
+
ALL_CHANNELS_OR_DIFFERENT_ACTION,
|
|
44
|
+
NON_CC_INDEX_OFFSET,
|
|
41
45
|
|
|
42
46
|
// SoundFont
|
|
43
47
|
BasicSoundBank,
|
package/package.json
CHANGED
|
@@ -333,7 +333,7 @@ export function setTimeTicks(ticks)
|
|
|
333
333
|
this.pausedTime = undefined;
|
|
334
334
|
this.post(
|
|
335
335
|
WorkletSequencerReturnMessageType.timeChange,
|
|
336
|
-
|
|
336
|
+
this.synth.currentSynthTime - this.midiData.MIDIticksToSeconds(ticks)
|
|
337
337
|
);
|
|
338
338
|
const isNotFinished = this._playTo(0, ticks);
|
|
339
339
|
this._recalculateStartTime(this.playedTime);
|
|
@@ -351,5 +351,5 @@ export function setTimeTicks(ticks)
|
|
|
351
351
|
*/
|
|
352
352
|
export function _recalculateStartTime(time)
|
|
353
353
|
{
|
|
354
|
-
this.absoluteStartTime =
|
|
354
|
+
this.absoluteStartTime = this.synth.currentSynthTime - time / this._playbackRate;
|
|
355
355
|
}
|
|
@@ -83,7 +83,7 @@ class WorkletSequencer
|
|
|
83
83
|
* Absolute playback startTime, bases on the synth's time
|
|
84
84
|
* @type {number}
|
|
85
85
|
*/
|
|
86
|
-
absoluteStartTime =
|
|
86
|
+
absoluteStartTime = 0;
|
|
87
87
|
/**
|
|
88
88
|
* Currently playing notes (for pausing and resuming)
|
|
89
89
|
* @type {{
|
|
@@ -142,6 +142,7 @@ class WorkletSequencer
|
|
|
142
142
|
constructor(spessasynthProcessor)
|
|
143
143
|
{
|
|
144
144
|
this.synth = spessasynthProcessor;
|
|
145
|
+
this.absoluteStartTime = this.synth.currentSynthTime;
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
/**
|
|
@@ -169,7 +170,7 @@ class WorkletSequencer
|
|
|
169
170
|
return this.pausedTime;
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
return (
|
|
173
|
+
return (this.synth.currentSynthTime - this.absoluteStartTime) * this._playbackRate;
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
set currentTime(time)
|
|
@@ -199,7 +200,7 @@ class WorkletSequencer
|
|
|
199
200
|
this.playingNotes = [];
|
|
200
201
|
const wasPaused = this.paused && this.preservePlaybackState;
|
|
201
202
|
this.pausedTime = undefined;
|
|
202
|
-
this.post(WorkletSequencerReturnMessageType.timeChange,
|
|
203
|
+
this.post(WorkletSequencerReturnMessageType.timeChange, this.synth.currentSynthTime - time);
|
|
203
204
|
if (this.midiData.duration === 0)
|
|
204
205
|
{
|
|
205
206
|
SpessaSynthWarn("No duration!");
|
|
@@ -129,7 +129,7 @@ generatorLimits[generatorTypes.startloopAddrsCoarseOffset] = { min: -32768, max:
|
|
|
129
129
|
generatorLimits[generatorTypes.keyNum] = { min: -1, max: 127, def: -1 };
|
|
130
130
|
generatorLimits[generatorTypes.velocity] = { min: -1, max: 127, def: -1 };
|
|
131
131
|
|
|
132
|
-
generatorLimits[generatorTypes.initialAttenuation] = { min:
|
|
132
|
+
generatorLimits[generatorTypes.initialAttenuation] = { min: 0, max: 1440, def: 0 };
|
|
133
133
|
|
|
134
134
|
generatorLimits[generatorTypes.endloopAddrsCoarseOffset] = { min: -32768, max: 32768, def: 0 };
|
|
135
135
|
|
|
@@ -37,11 +37,7 @@ export function readRegion(chunk)
|
|
|
37
37
|
velMax = 127;
|
|
38
38
|
velMin = 0;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
keyMax = 127;
|
|
43
|
-
keyMin = 0;
|
|
44
|
-
}
|
|
40
|
+
// cannot do the same to key zones sadly
|
|
45
41
|
|
|
46
42
|
const zone = new DLSZone(
|
|
47
43
|
{ min: keyMin, max: keyMax },
|