Gergely Bencsik @gergelybencsik • Joined Aug 2021 • Active 4 years ago Remove Connection Are you sure you want to remove from your connections? Timeline Profile Connections 1 Photos Forums Points Leader Badges Discussions Replies Favorites Discussions Replies Favorites 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