Crash: Track:setInstrument() while a note is playing (missing Lua Wrapper)

Thanks for getting back to this.

I've been able to validate the keep-a-reference workaround, but it's a handful to work with since you need to keep 2 references for every synth: the previous one and the one you are replacing it with.

Workaround demonstration: (working)

In the process I found a memory leak where sequences are not cleaned up. In simulator, this code crashes after about 70 iterations. Note that it already incorporates the track:clearNotes workaround from [How to free up memory from a sound.track? - #3 by AdamsImmersive]: