spessasynth_lib 3.24.4 → 3.24.7
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 +14 -4
- package/midi_parser/midi_loader.js +51 -28
- package/package.json +1 -1
- package/sequencer/sequencer.js +95 -22
- package/sequencer/worklet_sequencer/events.js +11 -2
- package/sequencer/worklet_sequencer/process_event.js +11 -18
- package/sequencer/worklet_sequencer/process_tick.js +21 -6
- package/sequencer/worklet_sequencer/sequencer_message.js +3 -2
- package/sequencer/worklet_sequencer/song_control.js +0 -2
- package/sequencer/worklet_sequencer/worklet_sequencer.js +0 -1
- package/soundfont/dls/dls_soundfont.js +8 -4
- package/soundfont/dls/read_lart.js +2 -2
- package/synthetizer/synthetizer.js +8 -6
- package/synthetizer/worklet_processor.min.js +9 -9
- package/synthetizer/worklet_system/main_processor.js +9 -7
- package/synthetizer/worklet_system/worklet_methods/note_on.js +2 -1
|
@@ -136,13 +136,17 @@ class DLSSoundFont extends BasicSoundFont
|
|
|
136
136
|
* @param chunk {RiffChunk}
|
|
137
137
|
* @param expected {string}
|
|
138
138
|
*/
|
|
139
|
-
verifyHeader(chunk, expected)
|
|
139
|
+
verifyHeader(chunk, ...expected)
|
|
140
140
|
{
|
|
141
|
-
|
|
141
|
+
for (const expect of expected)
|
|
142
142
|
{
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
if (chunk.header.toLowerCase() === expect.toLowerCase())
|
|
144
|
+
{
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
145
147
|
}
|
|
148
|
+
SpessaSynthGroupEnd();
|
|
149
|
+
this.parsingError(`Invalid DLS chunk header! Expected "${expected.toString()}" got "${chunk.header.toLowerCase()}"`);
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
/**
|
|
@@ -14,7 +14,7 @@ export function readLart(lartChunk, lar2Chunk, zone)
|
|
|
14
14
|
while (lartChunk.chunkData.currentIndex < lartChunk.chunkData.length)
|
|
15
15
|
{
|
|
16
16
|
const art1 = readRIFFChunk(lartChunk.chunkData);
|
|
17
|
-
this.verifyHeader(art1, "art1");
|
|
17
|
+
this.verifyHeader(art1, "art1", "art2");
|
|
18
18
|
const modsAndGens = readArticulation(art1, true);
|
|
19
19
|
zone.generators.push(...modsAndGens.generators);
|
|
20
20
|
zone.modulators.push(...modsAndGens.modulators);
|
|
@@ -26,7 +26,7 @@ export function readLart(lartChunk, lar2Chunk, zone)
|
|
|
26
26
|
while (lar2Chunk.chunkData.currentIndex < lar2Chunk.chunkData.length)
|
|
27
27
|
{
|
|
28
28
|
const art2 = readRIFFChunk(lar2Chunk.chunkData);
|
|
29
|
-
this.verifyHeader(art2, "art2");
|
|
29
|
+
this.verifyHeader(art2, "art2", "art1");
|
|
30
30
|
const modsAndGens = readArticulation(art2, false);
|
|
31
31
|
zone.generators.push(...modsAndGens.generators);
|
|
32
32
|
zone.modulators.push(...modsAndGens.modulators);
|
|
@@ -109,7 +109,7 @@ export class Synthetizer
|
|
|
109
109
|
this._voicesAmount = 0;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
|
-
* For Black MIDI's - forces release time to
|
|
112
|
+
* For Black MIDI's - forces release time to 50 ms
|
|
113
113
|
* @type {boolean}
|
|
114
114
|
*/
|
|
115
115
|
this._highPerformanceMode = false;
|
|
@@ -268,7 +268,7 @@ export class Synthetizer
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/**
|
|
271
|
-
* For Black MIDI's - forces release time to
|
|
271
|
+
* For Black MIDI's - forces release time to 50 ms
|
|
272
272
|
* @param {boolean} value
|
|
273
273
|
*/
|
|
274
274
|
set highPerformanceMode(value)
|
|
@@ -325,8 +325,8 @@ export class Synthetizer
|
|
|
325
325
|
|
|
326
326
|
/**
|
|
327
327
|
* Sets the interpolation type for the synthesizer:
|
|
328
|
-
* 0 - linear
|
|
329
|
-
* 1 - nearest neighbor
|
|
328
|
+
* 0. - linear
|
|
329
|
+
* 1. - nearest neighbor
|
|
330
330
|
* @param type {interpolationTypes}
|
|
331
331
|
*/
|
|
332
332
|
setInterpolationType(type)
|
|
@@ -663,7 +663,7 @@ export class Synthetizer
|
|
|
663
663
|
|
|
664
664
|
/**
|
|
665
665
|
* Sets the master stereo panning
|
|
666
|
-
* @param pan {number} -1 to 1, the pan (-1 is left, 0 is midde, 1 is right)
|
|
666
|
+
* @param pan {number} (-1 to 1), the pan (-1 is left, 0 is midde, 1 is right)
|
|
667
667
|
*/
|
|
668
668
|
setMasterPan(pan)
|
|
669
669
|
{
|
|
@@ -691,7 +691,8 @@ export class Synthetizer
|
|
|
691
691
|
* Changes the patch for a given channel
|
|
692
692
|
* @param channel {number} usually 0-15: the channel to change
|
|
693
693
|
* @param programNumber {number} 0-127 the MIDI patch number
|
|
694
|
-
* @param userChange {boolean} indicates if
|
|
694
|
+
* @param userChange {boolean} indicates if user has called the program change.
|
|
695
|
+
* defaults to false
|
|
695
696
|
*/
|
|
696
697
|
programChange(channel, programNumber, userChange = false)
|
|
697
698
|
{
|
|
@@ -912,6 +913,7 @@ export class Synthetizer
|
|
|
912
913
|
for (let i = 0; i < this.channelsAmount; i++)
|
|
913
914
|
{
|
|
914
915
|
this.controllerChange(i, midiControllers.reverbDepth, 127);
|
|
916
|
+
this.lockController(i, midiControllers.reverbDepth, true);
|
|
915
917
|
}
|
|
916
918
|
return "That's the spirit!";
|
|
917
919
|
}
|