Procedural wave generation, frequency shift issue
I suspect that the accumulator value is growing very large, which causes the float's resolution to degrade.  To avoid this you need to occasionally reduce the accumulator to manageable levels.  One way to do that is to subtract by 2*pi whenever you exceed 2*pi.