ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Random jump cuts with fade/dissolve~ time remapping

FAQ   •   VIEW ALL
 Random jump cuts with fade/dissolve~ time remapping on Dec 17, 2018 at 2:57:25 am

Hello

I am currently using the expression below with time remapping to jump cut to a new position within a clip every .44 seconds

How can I alter this expression code such that rather than making jump cuts, it randomly fades/cross dissolves into a different position within the clip? Is there a way to do this such that I have control over the duration of the dissolve?

Thank you so much!!

```segDur = .44;// duration of each "segment" of random time minVal = inPoint; maxVal = outPoint - segDur; seed = Math.floor(time/segDur); segStart = seed*segDur; seedRandom(seed,true); startVal = random(minVal,maxVal); endVal = startVal + segDur; linear(time,segStart,segStart + segDur, startVal, endVal);```

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 17, 2018 at 12:51:44 pm

It requires two layers to cross fade the video, so you would need a setup where both videos changed randomly every .88 seconds, with one of them offset by .44 seconds (or minimally by the duration of the fade). Then you need an expression for the fade (transparency) of the top layer that happens every .44 seconds, alternating between fading from 0 to 100 and 100 to 0. The alternating fade is a bit of a challenge. I'm thinking it might be along these lines:
`linear(Math.abs(time-Math.round(time/.88)*.88), .44-fadetime/2, .44+fadetime/2,0,100)`
You'd have to define the variable "fadetime" and it can't be more than .44 sec.
That formula has a good chance of being wrong. Also, it needs to use the time value without time remapping, so you may have to source it from a different layer that doesn't have time remapping applied to it.

Kalleheikki Kannisto
Senior Graphic Designer

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 17, 2018 at 3:38:13 pm

Hi Kalleheikki!

Thank you so much for this!! Sorry to be so useless but I am a little confused how to go about implementing what you describe in a new expression. Would you mind showing me what the new expression codes would look like and how I would go about applying them in the dual layer setup you describe?

Again thank you so so much!!

Cheers!
Anna

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 17, 2018 at 5:16:07 pm

You might want to add a little time to segment duration in the original expression to account for the fade:

segDur = .69;// duration of each "segment" of random time
minVal = inPoint;
maxVal = outPoint - segDur;
seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = random(minVal,maxVal);
endVal = startVal + segDur;
linear(time,segStart,segStart + segDur, startVal, endVal);

Then you need an opacity expression for that layer:

segDur = .69;
t = time%segDur;

Finally, you need to add another copy of the original clip below the first one, with this time remapping expression:

If you adjust the values, just make sure that the segDur and fadeDur values are consistent across the three expressions (or time them to sliders) and that fadeDur is less than segDur.

Dan

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 22, 2018 at 6:28:04 pm

Thank you so so much for this thorough walk through this works beautifully!

One question~ when I am rendering clips of this out with the above scripts the renders take crazzzzzzy long~ just to do a single minute of footage I am getting 59 minute render times. Is there anything I can do to rework the script or the way it renders to make it faster? With the same render settings other clips render very quickly so there must be something particularly taxing about what this script requires?

Thank you so much!

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 22, 2018 at 7:10:09 pm

You could try converting the expressions to keyframes before rendering (Animation > Keyframe Assistant > Convert Expression to Keyframes).

Dan

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 23, 2018 at 6:30:05 pm

Hmmmm thank you but that didn't seem to help

Any other ideas for speeding up the render? I'm confused why this would take a long time to process... it seems like skipping around the timeline/shifting the opacity wouldn't be particularly taxing computations?

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 23, 2018 at 6:36:47 pm

Do you mean is doesn't render faster with the expressions converted to keyframes, or that it takes a long time to do the conversion?

Dan

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 23, 2018 at 6:46:40 pm

The conversion happens relatively quickly about 30 seconds per expression, I meant that converting the expressions to keyframes does not help anything to render any faster

 Re: Random jump cuts with fade/dissolve~ time remappingon Dec 23, 2018 at 7:09:22 pm

That really surprises me, but I'm no expert on rendering. Maybe somebody will jump in with a better idea.

Dan