Improve Scriptracker.js instrument change preview
Would incorrectly restart note whenever instument set,
not 100% accurate now but better
@@ -212,7 +212,8 @@ ScripTracker.prototype.processTick = function() {
if (this.currentTick === 0) {
// Change instrument and retrigger current note.
- if (instrIndex !== 0) {
+ // but only if the instrument changed or has a note
+ if ((instrIndex !== 0) & ((instrIndex != registers.instrument) | (note != 0)) ) {
registers.instrument = instrIndex;
this.dispatchEvent(
ScripTracker.Events.instrument,
