Skip to content

Commit 57ff45c

Browse files
committed
fix issue reported by @kmf123kmf
1 parent 339ae97 commit 57ff45c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/diagram.psd

726 KB
Binary file not shown.

src/midi-parser.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ const MIDIParser = {
248248
break;
249249
case 0x01: // Text Event
250250
case 0x02: // Copyright Notice
251-
case 0x03: // Sequence/Track Name (documentation: http://www.ta7.de/txt/musik/musi0006.htm)
251+
case 0x03:
252+
case 0x04: // Instrument Name
253+
case 0x05: // Lyrics)
254+
case 0x07: // Cue point // Sequence/Track Name (documentation: http://www.ta7.de/txt/musik/musi0006.htm)
252255
case 0x06: // Marker
253256
MIDI.track[t-1].event[e-1].data = file.readStr(metaEventLength);
254257
break;
@@ -291,13 +294,13 @@ const MIDIParser = {
291294
//
292295
// IS REGULAR EVENT
293296
//
294-
else{ // MIDI Control Events OR System Exclusive Events
297+
else{ // MIDI Control Events OR System Exclusive Events
295298
statusByte = statusByte.toString(16).split(''); // split the status byte HEX representation, to obtain 4 bits values
296299
if(!statusByte[1]) statusByte.unshift('0'); // force 2 digits
297300
MIDI.track[t-1].event[e-1].type = parseInt(statusByte[0], 16);// first byte is EVENT TYPE ID
298301
MIDI.track[t-1].event[e-1].channel = parseInt(statusByte[1], 16);// second byte is channel
299302
switch(MIDI.track[t-1].event[e-1].type){
300-
case 0xF:{ // System Exclusive Events
303+
case 0xF:{ // System Exclusive Events
301304

302305
// if user provided a custom interpreter, call it
303306
// and assign to event the returned data

0 commit comments

Comments
 (0)