Produce musical signal from instantaneous frequency
The f[i] * i together determine the phase and frequency at every i so sine wave is only rendered correctly if there is no speed change, so the algorithm must be changed to allow for continuous time i and any change in frequency must not cause a phase jump.
So try a phase accumulator approach, where phase for each i is incremented as required by the frequency.