Considering the fact that the sine wave generated for a note always starts at 0, but can end at pretty much any value between -1 and 1, this could likely be the cause. Might be worth to have the instruments remember the last value written to the buffer and then try to shift the sine wave for the next note on the x-axis so that its start value matches the end of the previous note.
There is a noticeable glitch after each note.
Considering the fact that the sine wave generated for a note always starts at 0, but can end at pretty much any value between -1 and 1, this could likely be the cause. Might be worth to have the instruments remember the last value written to the buffer and then try to shift the sine wave for the next note on the x-axis so that its start value matches the end of the previous note.