FORUMS: list search recent posts

# Pulse Opacity

FAQ   •   VIEW ALL
 Pulse Opacity on Sep 11, 2012 at 6:34:14 pm

So...I suddenly got stuck! :(

All I needed was the most simple expression to make the opacity of a layer pulsate smoothly over a given time in a sinus-like-way.

It seems so simple, but I`m not man enough to figure it out.
Anyone?

/tom

 Re: Pulse Opacityon Sep 11, 2012 at 7:25:39 pm

f=1;
s=Math.sin (f * time * Math.PI * 2);

The above will give you values ranging from -1 to 1 'f' times per second. If you want to remap the output then I recommend the linear() function:

linear (s, -1, 1, 0, 100);

The 2nd and 3rd arguments (-1 and 1) are the input range and the 4th and 5th (0 and 100) are the output range that 's' is remapped to linearly. Try changing these numbers around to clip the pulse in interesting ways.

Darby Edelen

 Re: Pulse Opacityon Sep 11, 2012 at 7:25:48 pm

Like this maybe:

freq = 1;
50*(1 + Math.cos(time*freq*Math.PI*2))

Dan

 Re: Pulse Opacityon Sep 11, 2012 at 11:17:35 pm

Thanks a bunch!!!
Works like a charm.

 Re: Pulse Opacityon Dec 10, 2013 at 5:57:04 pm

Works wonders, glad this was here.

 Re: Pulse Opacityon Sep 15, 2016 at 10:48:06 am

Cool! How can I adjust the expression so that it pulsates from 100 to 50 in value, instead of 100 to 0 ?

 Re: Pulse Opacityon Sep 15, 2016 at 10:50:29 am

figured it out, thanks!

freq = 1;
50*(2 + Math.cos(time*freq*Math.PI*1))