Page 1 of 1

### Simulate a "scrubbing" effect

Posted: May 24th, 2004, 11:28 am
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;
seed_random(j,true);
start = end;
end += random(tmin,tmax);
}

targetTime = random(this_comp.duration);
seed_random(j-1,true);
dummy=random(); //this is a throw-away value
oldTime = random(this_comp.duration);
linear(time,start,end,oldTime,targetTime)

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
Very Cool Expression... Thanks!

### Scubbing expression

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

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

Alex

Posted: November 27th, 2007, 1:22 pm
you should check this out.
http://library.creativecow.net/articles ... huffle.php

seems to be just a thing

Posted: December 3rd, 2007, 9:14 am
Malex,

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.

Explorer,

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
Something like this might work:

Code: Select all

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

Posted: December 3rd, 2007, 2:44 pm
Dan,

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
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.

dan