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,14 +294,14 @@ if (window.Audio) (function () {
|
||||||
if (!note) return;
|
if (!note) return;
|
||||||
var instrumentNoteId = instrumentId + "" + note.id;
|
var instrumentNoteId = instrumentId + "" + note.id;
|
||||||
|
|
||||||
for(var i=0;i<channelInstrumentNoteIds.length;i++){
|
for(var i=0;i<channels.length;i++){
|
||||||
var nid = (channel_nid + 1) % channels.length;
|
var nid = (i + channel_nid + 1) % channels.length;
|
||||||
var cId = channelInstrumentNoteIds[nid];
|
var cId = channelInstrumentNoteIds[nid];
|
||||||
|
|
||||||
if(cId && cId == instrumentNoteId){
|
if(cId && cId == instrumentNoteId){
|
||||||
channels[i].pause();
|
channels[nid].pause();
|
||||||
channelInstrumentNoteIds[nid] = null;
|
channelInstrumentNoteIds[nid] = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue