Sin Osc (for curiosity)
Posted: Thu Jul 28, 2022 3:26 pm
Here's a sin osc.
But it's more for curiosity.
I recommend to use the Martin Vicaneck sin osc that is a little faster.
Also my phase system would probably make little problem ??
(need at least a dezip if controlled manually)
Optionally, we could have a little 3x harmonic.
I tried to shut down the aliasing, but i'm not sure i found the perfect value.
I liked the concept to use less variables, only 2, to convert a triangle in a sin approximation.
But this take more calculation..
Here's the formula :
X is Trig (0-1) >
X1 = X*X
X2 = 1-((1-X)*(1-X))
z = ( (X2-X1)* X) + X1
zz = ( (z-X)* 0.282425) + X
result = ( (X2-X1)* zz) + X1
(I also find that a triangle derivative multiplied by the frequency, then again derivative * freq make almost a sin..
But this lead to DC problematic that are more hard to deal..)
But it's more for curiosity.
I recommend to use the Martin Vicaneck sin osc that is a little faster.
Also my phase system would probably make little problem ??
(need at least a dezip if controlled manually)
Optionally, we could have a little 3x harmonic.
I tried to shut down the aliasing, but i'm not sure i found the perfect value.
I liked the concept to use less variables, only 2, to convert a triangle in a sin approximation.
But this take more calculation..
Here's the formula :
X is Trig (0-1) >
X1 = X*X
X2 = 1-((1-X)*(1-X))
z = ( (X2-X1)* X) + X1
zz = ( (z-X)* 0.282425) + X
result = ( (X2-X1)* zz) + X1
(I also find that a triangle derivative multiplied by the frequency, then again derivative * freq make almost a sin..
But this lead to DC problematic that are more hard to deal..)