Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to slow down Random value

  • How to slow down Random value

    Posted by Michal on May 3, 2005 at 9:51 pm

    Hi guys,
    how do I slow down my random script so the value changes every ie. 5seconds
    I’m working on a project that needs to finished today. Please help!!!

    Thanks

    this is what I have so far on my scale value

    x = gaussRandom(50,60);
    y = x;
    [x,y]

    Dan Ebberts replied 21 years ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    May 3, 2005 at 10:16 pm

    Try this:

    rate = 1/5; // once every 5 seconds
    posterizeTime(rate);
    x = gaussRandom(50,60);
    y = x;
    [x,y]

    Dan

  • Michal

    May 3, 2005 at 10:30 pm

    Thank you for your prompt reply but it didn’t seem to work. 😛

    Is there a way you can modify Random() expression in similar way as wiggle();??

  • Dan Ebberts

    May 3, 2005 at 11:38 pm

    Hmmm… what version of AE are you running?

    Try this instead:

    period = 5; // every 5 seconds

    seed = Math.floor(time/period);
    seedRandom(seed,true);
    x = gaussRandom(50,60);
    y = x;
    [x,y]

    Dan

  • Michal

    May 3, 2005 at 11:46 pm

    I’m running AE 6.5..the only thing about the previous script is it makes it just freezes the frame for the time specififed in the script and changes random value suddenly but not gradually. let me try your suggestion.

  • Michal

    May 3, 2005 at 11:49 pm

    hmm same thing..it changes value at 0—5—10 etc.. which is fine
    however in between those times the scale does not change. Any idea?? Does it work for you??

  • Dan Ebberts

    May 4, 2005 at 12:03 am

    Ah OK – I didn’t pick up that you wanted it to ramp from one value to the next. Try this:

    period = 5; // every 5 seconds

    seed = Math.floor(time/period);
    seedRandom(seed,true);
    xNow = gaussRandom(50,60);
    seedRandom(seed+1,true);
    xNext = gaussRandom(50,60);
    x = linear(time,seed*period,(seed+1)*period,xNow,xNext);
    y = x;
    [x,y]

    Dan

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