Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random expression in frames

  • Random expression in frames

    Posted by Patrick Murphy on February 7, 2017 at 7:50 pm

    Hi there!

    I have this script but instead of hold time in seconds, I’d like it to be hold time in frames.
    I’ve looked around and tried some things but I’m still a bit of a noob.
    Thanks!

    Here’s the expression I have to convert

    hold = .5; //time to hold each number (seconds)
    min = -1;
    max = 1;

    seed = Math.floor(time/hold);
    seed_random(seed,true);
    random(min,max)

    Patrick Murphy replied 9 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    February 7, 2017 at 8:06 pm

    you can convert a frames value to time, or a time value to frames… i think i’d use the first option like this

    hold = 15; //time to hold each number (frames)
    min = -1;
    max = 1;

    seed = Math.floor( time / framesToTime( hold ) );
    seed_random( seed, true );
    random( min, max )

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Patrick Murphy

    February 7, 2017 at 8:10 pm

    Thank you so much!!

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