Skip to content

Commit 079d548

Browse files
committed
fix Issue mudcube#14
1 parent 9c8721e commit 079d548

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

js/MIDI/Player.js

-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ root.loadFile = function (file, callback) {
112112
return;
113113
}
114114
///
115-
var title = file.split(" - ")[1] || file;
116-
document.getElementById("playback-title").innerHTML = title.replace(".mid","");
117-
///
118115
var fetch = new XMLHttpRequest();
119116
fetch.open('GET', file);
120117
fetch.overrideMimeType("text/plain; charset=x-user-defined");

js/MIDI/Plugin.js

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ if (window.AudioContext || window.webkitAudioContext) (function () {
137137
var synth = MIDI.GeneralMIDI.byName[instrument];
138138
var instrumentId = synth.number;
139139
var url = urlList[index];
140+
if (!MIDI.Soundfont[instrument][url]) { // missing soundfont
141+
return callback(instrument);
142+
}
140143
var base64 = MIDI.Soundfont[instrument][url].split(",")[1];
141144
var buffer = Base64Binary.decodeArrayBuffer(base64);
142145
ctx.decodeAudioData(buffer, function (buffer) {

0 commit comments

Comments
 (0)