Page 1 of 1

Simulate a "scrubbing" effect

Posted: May 24th, 2004, 11:28 am
by malex
Problem : How to simulate a "scrubbing" effect, as if you were randomly dragging the time needle around a timeline

Solution : Posted by Dan Ebberts on AE List Aug 27 2003

tmin = .125; //minimum segment duration(can't be zero)
tmax = .25; //maximum segment duration = 0;
initialSeed = 11;

end = 0;
j = initialSeed;
while (time >= end){
j +=1;
start = end;
end += random(tmin,tmax);

targetTime = random(this_comp.duration);
dummy=random(); //this is a throw-away value
oldTime = random(this_comp.duration);

Fiddle with the first three parameters to change the effect. You might also
want to change the last line from linear() to ease().

Posted: August 30th, 2004, 9:57 am
by JeffKopp
Very Cool Expression... Thanks! 8)

Scubbing expression

Posted: February 21st, 2007, 12:13 am
by MadCow
Not to sound like a complete moron but in which layer property box do I want to add this expression?
thanks in advance

Posted: February 21st, 2007, 12:43 pm
by Disciple
Enable Time remapping and plug it in there!


Posted: November 27th, 2007, 1:22 pm
by explorer
you should check this out. ... huffle.php

seems to be just a thing

Posted: December 3rd, 2007, 9:14 am
by Atomic

This code does not seem to really work.

No matter what values I put in, it does not change the speed or duration of footage. I applied it to a time map of a precomp.

I am looking for a way to randomly select a frame from a precomp, have it remain on screen for x number of frames, then choose another.


The multaanon code also suffers from the lack of the ability to control the speed of the effect.

Posted: December 3rd, 2007, 2:11 pm
by Dan Ebberts
Something like this might work:

Code: Select all

n = 10; // hold frames
f = timeToFrames(time); // current frame
period = Math.floor(f/ n);
if (numKeys >1){
 random(inPoint,key(numKeys).time - thisComp.frameDuration)

Posted: December 3rd, 2007, 2:44 pm
by Atomic

Thanks for the reply.

I am using AE7.0.

Just to be clear, is this how I use the expression?

I enable time remapping on my precomp.
Then I paste the expression into the time remap value.

Using this technique, I still end up with blank frames being displayed by the expression. It seems like the expression is doing an on for hold frames, then off for hold frames before it picks a new frame.

What does the number of keys have to do with the expression? By default, when I enable time remap, I get two key frames. I stretch out my precomp length to generate my coverage, then move the last keyframe to the end of the precomp.

Ideally, it would be nice to be able to have the frame fade in and fade out at the end of the hold time. This would be like telling a movie clip to play in flash. I am wondering if this is possible via expressions, or would I be better off doing this in JSX. Presently I am generating my precomp with a JSX.

I guess my JSX would need to look at the list of items in the project window, then pick one and assign it to a layer. Then fade it in an out and save the out time to be the in time for the next picked layer. Continue until coverage time is met.

Posted: December 3rd, 2007, 2:52 pm
by Dan Ebberts
Try not moving the second keyframe. :-)

Not sure exactly what you're after with the fade in/fade out, but it should be possible with an opacity expression set to the same period.