Skip to content

Commit

Permalink
A little fail-safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed May 19, 2022
1 parent 14140dd commit 734ab5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion midiParse/js/bankMapReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ self.getSoundBank = function (msb, prg, lsb) {
let bankName = (msb || 0).toString().padStart(3, "0") + " " + (prg || 0).toString().padStart(3, "0") + " " + (lsb || 0).toString().padStart(3, "0") + " ";
let to = soundBankInfo;
for (let c = 0; c < 3; c ++) {
to = to[arguments[c]];
to = to[arguments[c] || 0];
if (!to) {
break;
} else if (c == 2) {
Expand Down
10 changes: 7 additions & 3 deletions midiParse/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,17 @@ self.task = setInterval(function () {
};
case 89: {
// Key Signature
curKey = (e.data[0] + 12) % 12;
curScale = e.data[1];
curKey = (e.data[0] + 12) % 12 || 0;
curScale = e.data[1] || 0;
break;
};
case 33: {
// I don't know what it does, really. Just that the Monkey Island MIDI file appeared this.
break;
};
case 47: {
// End of track
textField.innerHTML += `End of track: ${audioPlayer.currentTime}.\n`;
//textField.innerHTML += `End of track: ${audioPlayer.currentTime}.\n`;
break;
};
default: {
Expand Down

0 comments on commit 734ab5f

Please sign in to comment.