spessasynth_core 1.1.0 → 1.1.1
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
|
@@ -36,8 +36,8 @@ export class MIDI{
|
|
|
36
36
|
throw new RangeError(`Invalid MIDI header chunk size! Expected 6, got ${headerChunk.size}`);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// format
|
|
40
|
-
readBytesAsUintBigEndian(headerChunk.data, 2);
|
|
39
|
+
// format
|
|
40
|
+
const format = readBytesAsUintBigEndian(headerChunk.data, 2);
|
|
41
41
|
// tracks count
|
|
42
42
|
this.tracksAmount = readBytesAsUintBigEndian(headerChunk.data, 2);
|
|
43
43
|
// time division
|
|
@@ -95,6 +95,11 @@ export class MIDI{
|
|
|
95
95
|
let runningByte = undefined;
|
|
96
96
|
|
|
97
97
|
let totalTicks = 0;
|
|
98
|
+
// format 2 plays sequentially
|
|
99
|
+
if(format === 2 && i > 0)
|
|
100
|
+
{
|
|
101
|
+
totalTicks += this.tracks[i - 1][this.tracks[i - 1].length - 1].ticks;
|
|
102
|
+
}
|
|
98
103
|
// loop until we reach the end of track
|
|
99
104
|
while(trackChunk.data.currentIndex < trackChunk.size)
|
|
100
105
|
{
|