ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

speed variation in typewriter effect

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
david bauer
speed variation in typewriter effect
on Jun 4, 2020 at 7:47:49 am

Hi,

I've got an expression to do my typewriting effect that works fine. But the effect is at a constant speed and I'd like to add some variation to it (like a human typing on a keyboard) How could I modify my current expression to do this? I've imagined adding some kind of wiggle on the speed variable...but can't figure it out though.

Many thanks for your help!

curTimer = time - thisLayer.inPoint;
speed = effect("Speed")("Slider");
enableOverwrite = effect("Use Overwrite Cursor")("Checkbox");
T = curTimer * speed;
F = Math.round(curTimer % 1);

if (F == 1 | (T, 0)) {
if(enableOverwrite == 1){
cursor = "_";
} else {
cursor = "|";
}
} else {
cursor = " ";
}
substr(0, T) + cursor;


Return to posts index

Oleg Pirogov
Re: speed variation in typewriter effect
on Jun 12, 2020 at 8:37:40 pm

As i see it, you want the increment of the revealed text to vary (wiggle) over time.

Thus, the variable you need is the "progress" (how much of the text is revealed) multiplied by the "speedMultiplier" parameter (giving you control of the overall speed of the animation).

Thus, your expression for the "Text" property turns to:

speedMultiplier = 10;
curTimer = time - thisLayer.inPoint;
progress = effect("Progress")("Slider");
enableOverwrite = effect("Use Overwrite Cursor")("Checkbox");
T = speedMultiplier*progress;
F = Math.round(curTimer % 1);

if (F == 1 | (T, 0)) {
if(enableOverwrite == 1){
cursor = "_";
} else {
cursor = "|";
}
} else {
cursor = " ";
}
substr(0, T) + cursor;


(curTimer is now only to determine the mode of the "cursor")

The "progress" variable is assigned to the value of the "Progress" slider effect. It's a strictly increasing function corresponding to how much of the text is revealed. The expression for the Progress slider effect is:

spd = effect("Increment")("Slider")
accum = 0;
for (i = timeToFrames(inPoint); i <= timeToFrames(time); i++){
accum += spd.valueAtTime(framesToTime(i));
}
value + accum*thisComp.frameDuration


(that's from Dan Ebberts, btw)

"Increment" is another slider effect, whose value is non-negative and wiggles over time. It's expression is:

Math.abs(wiggle(1, 0.5))

The actual parameters here are for you to play with, of cause.
In the end, the whole scheme makes the typing speed vary over time.


Return to posts index

david bauer
Re: speed variation in typewriter effect
on Jun 16, 2020 at 9:10:43 am

Thanks for getting back. I found another way in the end but your expression works well. Thank you for taking the time to answer my question!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]