Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Introducing variance to the playback speed of a clip, using expressions and time remapping

  • Introducing variance to the playback speed of a clip, using expressions and time remapping

    Posted by Perry Kroll on May 10, 2012 at 4:28 am

    Hello expressions geniuses!

    I am stumped by this problem…

    I want a layer to play with a slightly varying playback speed. So that it never jumps backwards in time, but sometimes it slows down a bit (to, say, 30% of normal speed) and sometimes it speeds up (to, maybe 300% of normal speed). It doesn’t matter when it reaches the end of the clip.

    I’m stuck after trying to apply a random or wiggle function to the Tme Remap property, because those make the footage jump backwards in time sometimes. What I want seems like it would be a wiggle that always increments a value to greater numbers (never turning back on itself) just sometimes incrementing up by less and sometimes by more on each frame.

    Thanks so much for any insight you may have.

    Dan Ebberts
    replied 13 years, 12 months ago
    3 Members · 4 Replies
  • 4 Replies
  • Darby Edelen

    May 10, 2012 at 3:36 pm

    The temporalWiggle() function will get closest to what you’re describing without having to write a lot of code. This may still cause your clip to play backwards (especially at higher amplitudes) but you can check your time remap property in the graph editor while varying the values to get something that works for you.

    Darby Edelen

  • Perry Kroll

    May 10, 2012 at 5:04 pm

    This is a great function, which I did not know about, but I’m finding that it still causes backwards playback no matter how I tweak it.

    I’ve got a pre-comp with a bunch of text scrolling one line at a time, at a set interval, and I’m trying to simulate a computer terminal readout where it sometimes slows down or speeds up, so with scrolling text it’s really obvious when this doubles back on itself for a moment.

    Does anyone know of an example script that someone has written somewhere which demonstrates the ‘a lot of code’ method for approaching something like this?

  • Perry Kroll

    May 10, 2012 at 7:51 pm

    Well, I did some more fussing, and I ended up with this, which is a modified script I found posted on this site by Dan Ebberts:

    Adder = thisComp.layer("speed controller").effect("Slider Control")("Slider");
    f = timeToFrames(time);
    Cumulo = 0;
    for (i = 0; i <= f; i++){
    t = framesToTime(i);
    Cumulo += Math.max(0,((Adder.valueAtTime(t)+1.6)/30));
    }
    Cumulo%38.9

    The speed controller is a null slider with a wiggle on it.

    wiggle(8,6)

    This line
    Cumulo += Math.max(0,((Adder.valueAtTime(t)+1.6)/30));

    Does some hardcoded tweaking to effect how that number from the wiggler is used. Whenever the value+1.6 is below 0 the scrolling text simply pauses. The whole thing is also divided by 30. All arbitrary numbers that just looked good.

    This was, of course, abysmally slow once out into the 1-2 minute range, and I ended up baking the expression to keyframes.

  • Dan Ebberts

    May 10, 2012 at 11:21 pm

    I love it when my old posts beat me to the punch. Good job!

    Dan

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