when stopping a note, look through the channels from oldest to newest, stop only the first matching note, then null it out and return
parent
6462f82fde
commit
c8047a2779
|
@ -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
|
|||
}
|
||||
})();
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue