I'm trying to develop a function that can be used to approximate a sine wave, a triangle wave, and a square wave by adjusting one variable in the equation.
This function will be used as the main oscillator in a soft synthesizer and I would prefer computational simplicity over accuracy. So a parabolic approximation of sine would be much better than actually using a sine function.
The transition between waveforms would be Triangle -> Sine -> Square as the constant increases from 0 to 1 (or any similar number range).
The design of the synthesizer assumes that the input (x) of this function will oscillate from -1 to 1 linearly. But this could be changed to any range if needed.
Also, I would also like to adjust the slope/angle of the wave with a separate variable (think of the transition between a sawtooth wave and a triangle wave).
