Pulse opacity

could someone point me in the right direction of how to pulse the opacity property.

Math.sin on something and offset and scale the wave to run from 0-1 ?

cant get my head around it though (syntax). any tips or ideas most welcome.

thx