FORUMS: list search recent posts

# Opacity ease from 0-100 but with random timing

FAQ   •   VIEW ALL
 Opacity ease from 0-100 but with random timing on Jun 1, 2014 at 9:41:37 pm

Hey all,

I've looked for a few expressions on here to fix my scenario.. some come really close but I'm not savvy enough to get it to work.

I have a grid of separate boxes, I want each one to fade in and out for a predetermined amount of time. Say fade 12 frames in, hold 100 opacity for a random range of frames, and then fade to 0 over 12 frames to hold for another random range of frames. I'd like the timing of when they're 100% visible and when they're 0% visible to randomly change.

Basically the fades are predetermined but the final value timings are randomly generated. The final piece will be 30 secs if it helps. Any ideas you crazy awesome geniuses?

Best regards,
Ronny

 Re: Opacity ease from 0-100 but with random timingon Jun 2, 2014 at 4:09:06 pm

Maybe something like this:

``` minHold = 24; // min hold frames maxHold = 40; // max hold frames fade = 12; // fade frames seedRandom(index,true); t = t0 = 0; hold1 = minHold; f = fade*thisComp.frameDuration; while (t <= time){ hold1 = Math.round(random(minHold,maxHold))*thisComp.frameDuration; hold2 = Math.round(random(minHold,maxHold))*thisComp.frameDuration; t0 = t; t += f*2 + hold1 + hold2; } t1 = t0 + f; t2 = t1 + hold1; t3 = t2 + f; if (time < t1) linear(time,t0,t1,0,100) else if (time < t2) 100 else if (time < t3) linear(time,t2,t3,100,0) else 0; ```

Dan