Forum Replies Created

  • Gergely Bencsik

    August 15, 2021 at 3:12 pm in reply to: Chunking up sine waves (one quarter at a time)

    Hi

    I think this could work for you. You did most of the work figuring out the modulus-thing, you can just put that in an if-else.

     

    freq = 0.25;

    // sin input

    phi = time*freq;

    if(phi%1>0.25)

    {

    y=0;

    }

    else

    {

    y = -Math.sin(Math.PI*2*phi)*200;

    }

    y

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy