Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Make Holdtime a variable

  • Make Holdtime a variable

    Posted by Tayla Frances on August 25, 2017 at 10:38 am

    Currently I am using the below code and I was wondering if just as the effect itself varies in intensity with a min and max val if I could do the same for the holdTime, so for instance it could hold anywhere between .5 sec to 5 sec.

    effect("Minimax")(2)
    holdTime = 3;
    minVal = 20;
    maxVal = 100;

    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    random(minVal,maxVal)

    Tayla Frances replied 9 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 25, 2017 at 3:58 pm

    Like this:


    minVal = 20;
    maxVal = 100;
    minDur = .5;
    maxDur = 5;
    seedRandom(index,true);
    tNext = tPrev = 0;
    while (tNext <= time){
    tPrev = tNext;
    tNext += random(minDur,maxDur);
    }
    seedRandom(tPrev,true);
    random(minVal,maxVal)

    Dan

  • Tayla Frances

    August 26, 2017 at 8:59 am

    Thanks Dan worked like a charm!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy