when stopping a note, look through the channels from oldest to newest, stop only the first matching note, then null it out and return
This commit is contained in:
parent
6462f82fde
commit
c8047a2779
1 changed files with 6 additions and 2 deletions
|
@ -295,9 +295,13 @@ if (window.Audio) (function () {
|
||||||
var instrumentNoteId = instrumentId + "" + note.id;
|
var instrumentNoteId = instrumentId + "" + note.id;
|
||||||
|
|
||||||
for(var i=0;i<channelInstrumentNoteIds.length;i++){
|
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){
|
if(cId && cId == instrumentNoteId){
|
||||||
channels[i].pause();
|
channels[i].pause();
|
||||||
|
channelInstrumentNoteIds[nid] = null;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -582,4 +586,4 @@ MIDI.noteToKey = {}; // 108 == C8
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue