No.11270359 ViewReplyOriginalReport
I invented a circled sine function. What do you guys think? Will it result in a warm sound?
It may look like a really round sine, especially if stretched vertically. Here is how I generated it. Remember the challenge is to generate it as a function of time, NOT in the polar coordinates since I want to implement a soft clipper plugin in the time domain.
So here is my secret. Knowing the polar form:
y=r*sin(theta) and x=r*cos(theta),
simply solve for theta=acos(x/r) and then solve for y.

So this "sine" is just two half circles.
Here is how you generate them:
float circle (float x)
{
float m = fmod(x+M_PI/2, M_PI*2);
if (m < 0)
m += M_PI*2;

if (m > M_PI*2)
{
m -= M_PI*2;
}

float theta;

if (m <= M_PI)
{
theta = acos ((m-M_PI/2)/M_PI*2);
}
else
{
theta = -acos ((-M_PI+m-M_PI/2)/M_PI*2);
}

return sin(theta);

}

Pretty cool, huh?