spessasynth_core 3.26.8 → 3.26.10
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
|
@@ -134,13 +134,19 @@ export class SoundFontManager
|
|
|
134
134
|
{
|
|
135
135
|
if (this.soundfontList.find(s => s.id === id) !== undefined)
|
|
136
136
|
{
|
|
137
|
-
|
|
137
|
+
// replace
|
|
138
|
+
const soundfont = this.soundfontList.find(s => s.id === id);
|
|
139
|
+
soundfont.soundfont = font;
|
|
140
|
+
soundfont.bankOffset = bankOffset;
|
|
141
|
+
}
|
|
142
|
+
else
|
|
143
|
+
{
|
|
144
|
+
this.soundfontList.push({
|
|
145
|
+
id: id,
|
|
146
|
+
soundfont: font,
|
|
147
|
+
bankOffset: bankOffset
|
|
148
|
+
});
|
|
138
149
|
}
|
|
139
|
-
this.soundfontList.push({
|
|
140
|
-
id: id,
|
|
141
|
-
soundfont: font,
|
|
142
|
-
bankOffset: bankOffset
|
|
143
|
-
});
|
|
144
150
|
this.generatePresetList();
|
|
145
151
|
}
|
|
146
152
|
|
|
@@ -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.
|
|
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
|
-
*
|
|
638
|
-
* @param
|
|
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
|
{
|