spessasynth_core 3.26.2 → 3.26.4
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 +1 -1
- package/src/sequencer/play.js +13 -4
- package/src/soundfont/basic_soundfont/basic_preset.js +5 -0
- package/src/soundfont/basic_soundfont/basic_soundfont.js +9 -0
- package/src/synthetizer/audio_engine/engine_methods/soundfont_management/clear_sound_font.js +1 -1
- package/src/synthetizer/audio_engine/engine_methods/soundfont_management/update_preset_list.js +1 -0
- package/src/synthetizer/audio_engine/main_processor.js +5 -4
package/package.json
CHANGED
package/src/sequencer/play.js
CHANGED
|
@@ -264,11 +264,20 @@ export function _playTo(time, ticks = undefined)
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
// restore programs
|
|
267
|
-
if (programs[channelNumber].
|
|
267
|
+
if (programs[channelNumber].actualBank >= 0)
|
|
268
268
|
{
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
const p = programs[channelNumber];
|
|
270
|
+
if (p.program !== -1)
|
|
271
|
+
{
|
|
272
|
+
// a program change has occurred, apply the actual bank when program change was executed
|
|
273
|
+
this.synth.controllerChange(channelNumber, midiControllers.bankSelect, p.actualBank);
|
|
274
|
+
this.synth.programChange(channelNumber, p.program);
|
|
275
|
+
}
|
|
276
|
+
else
|
|
277
|
+
{
|
|
278
|
+
// no program change, apply the current bank select
|
|
279
|
+
this.synth.controllerChange(channelNumber, midiControllers.bankSelect, p.bank);
|
|
280
|
+
}
|
|
272
281
|
}
|
|
273
282
|
}
|
|
274
283
|
}
|
|
@@ -557,6 +557,15 @@ class BasicSoundBank
|
|
|
557
557
|
delete this.instruments;
|
|
558
558
|
delete this.samples;
|
|
559
559
|
}
|
|
560
|
+
|
|
561
|
+
// noinspection JSUnusedGlobalSymbols
|
|
562
|
+
/**
|
|
563
|
+
* Clears the cache for all the presets
|
|
564
|
+
*/
|
|
565
|
+
clearCache()
|
|
566
|
+
{
|
|
567
|
+
this.presets.forEach(p => p.clearCache());
|
|
568
|
+
}
|
|
560
569
|
}
|
|
561
570
|
|
|
562
571
|
BasicSoundBank.prototype.write = write;
|
|
@@ -468,10 +468,6 @@ class SpessaSynthProcessor
|
|
|
468
468
|
setCachedVoice(bank, program, midiNote, velocity, voices)
|
|
469
469
|
{
|
|
470
470
|
// make sure that it exists
|
|
471
|
-
if (!this.cachedVoices)
|
|
472
|
-
{
|
|
473
|
-
this.cachedVoices = [];
|
|
474
|
-
}
|
|
475
471
|
if (!this.cachedVoices[bank])
|
|
476
472
|
{
|
|
477
473
|
this.cachedVoices[bank] = [];
|
|
@@ -749,6 +745,11 @@ class SpessaSynthProcessor
|
|
|
749
745
|
{
|
|
750
746
|
this?.onEventCall?.(eventName, eventData);
|
|
751
747
|
}
|
|
748
|
+
|
|
749
|
+
clearCache()
|
|
750
|
+
{
|
|
751
|
+
this.cachedVoices = [];
|
|
752
|
+
}
|
|
752
753
|
}
|
|
753
754
|
|
|
754
755
|
// include other methods
|