need to use nid to find channel to pause, and forgot to add i to channel_nid to get nid
This commit is contained in:
parent
c8047a2779
commit
91988b15b7
|
@ -294,12 +294,12 @@ if (window.Audio) (function () {
|
|||
if (!note) return;
|
||||
var instrumentNoteId = instrumentId + "" + note.id;
|
||||
|
||||
for(var i=0;i<channelInstrumentNoteIds.length;i++){
|
||||
var nid = (channel_nid + 1) % channels.length;
|
||||
for(var i=0;i<channels.length;i++){
|
||||
var nid = (i + channel_nid + 1) % channels.length;
|
||||
var cId = channelInstrumentNoteIds[nid];
|
||||
|
||||
if(cId && cId == instrumentNoteId){
|
||||
channels[i].pause();
|
||||
channels[nid].pause();
|
||||
channelInstrumentNoteIds[nid] = null;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue