when stopping a note, look through the channels from oldest to newest, stop only the first matching note, then null it out and return

master
Brian Stoner 2013-03-14 11:54:05 -04:00
parent 6462f82fde
commit c8047a2779
1 changed files with 6 additions and 2 deletions

View File

@ -295,9 +295,13 @@ if (window.Audio) (function () {
var instrumentNoteId = instrumentId + "" + note.id;
for(var i=0;i<channelInstrumentNoteIds.length;i++){
var cId = channelInstrumentNoteIds[i];
var nid = (channel_nid + 1) % channels.length;
var cId = channelInstrumentNoteIds[nid];
if(cId && cId == instrumentNoteId){
channels[i].pause();
channelInstrumentNoteIds[nid] = null;
return;
}
}
};
@ -582,4 +586,4 @@ MIDI.noteToKey = {}; // 108 == C8
}
})();
})();
})();