Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Randomly freeze and skip value

  • Randomly freeze and skip value

    Posted by Noel Powell on December 30, 2013 at 9:41 pm

    Dan Ebberts has helped me with something similar in the past: https://forums.creativecow.net/readpost/227/20569

    What I’m trying to accomplish now is a little different. Any guidance you can give me is greatly appreciated. I am looking to randomly change a value on every frame, but it needs to occasionally and randomly freeze the value for a random amount of time, then continue on changing on every frame. I have four Slider Controls which I would like to use to control the boundaries of randomness:

    Minimum Play Time
    Maximum Play Time
    Minimum Freeze Time
    Maximum Freeze Time

    Instead of on a Time Remapping effect, this expression would go on the “Evolution” parameter of a Fractal Noise Effect. I’d like to have the value range from -30,000 to 30,000.

    So to sum up, during the “Play Time”, the Evolution value would be changing every frame using a function like “random(-30000,30000)”. It would do this for a random number of frames (determined by the “Play Time” slider controls). Then, it would hold (freeze) a value for a random number of frames (determined by the “Freeze Time” slider controls). Then it would just continue playing, then freezing, then playing, etc.

    Thanks.

    After Effects templates – lens flares, light leaks, old film effects, digital glitches, VHS glitches, and more: https://CreationEffects.com

    Noel Powell replied 12 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 30, 2013 at 11:09 pm

    Something like this should work:


    if (time >= inPoint){
    minPlay = .75;
    maxPlay = 1.5;
    minFreeze = .2;
    maxFreeze = .7;
    minVal = -30000;
    maxVal = 30000;
    t0 = inPoint;
    seg = -1;
    seedRandom(index,true);
    while (t0 <= time){
    seg++;
    if (seg%2){
    t0 += random(minFreeze,maxFreeze);
    }else{
    t0 += random(minPlay,maxPlay);
    }
    }
    seedRandom(seg,seg%2);
    random(minVal,maxVal)
    }else
    value

    Just attach the play and freeze min and max to sliders.

    Dan

  • Noel Powell

    December 30, 2013 at 11:51 pm

    Brilliant. Works great. You’re my hero, Dan. Thank you.

    After Effects templates – lens flares, light leaks, old film effects, digital glitches, VHS glitches, and more: https://CreationEffects.com

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