(tanh (* n (sin theta))) -> a square wave where n sets how square the corners are -- from an article on synchronizing fireflies.