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().
Simulate a "scrubbing" effect
Enable Time remapping and plug it in there!
Alex
Alex
you should check this out.
http://library.creativecow.net/articles ... huffle.php
seems to be just a thing
http://library.creativecow.net/articles ... huffle.php
seems to be just a thing
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.
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.
Last edited by Atomic on December 3rd, 2007, 2:27 pm, edited 1 time in total.
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
Something like this might work:
Dan
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,
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.
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.
-
- Posts: 320
- Joined: June 26th, 2004, 10:01 am
- Location: Folsom, CA
- Contact:
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

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