This is a popular question, so here's the answer.
Only the sawtooth function has a reset parameter. So you can use
the map.sin function to get a sine wave out of the sawtooth:
map.sin(sawtooth(10, grid.onactivated))
This generates a sine wave with a period of 10 seconds and it resets each time the grid is activated. The map.sin function takes a percent value and map it to a sine wave. It's also wrapping the value, letting you offset the wave like this:
map.sin(sawtooth(10, grid.onactivated) + 25)
Adding 25 means the sine wave has an offset of 25%. This way, you can generate multiple sine waves with different offsets, all restarting when the grid is activated. For example, add multiple sources with this formula:
map.sin(sawtooth(10, grid.onactivated) + px)
The offset is the horizontal position of the source in percent. Pretty fun :)