ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Is there a wordPerSec expression?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Olly Starkey
Is there a wordPerSec expression?
on May 8, 2019 at 8:49:12 am

Hi there

I hope you can help.

I am looking for a wordPerSec expression that works in the same way as this expression

charPerSec = 40;
tTotal = value.length/charPerSec;
t = easeIn(time,0,tTotal,0,tTotal);
idx = Math.floor(t*charPerSec);
value.substr(0,idx)

But with words not individual characters.

Thanks in advance


Return to posts index

Kalleheikki Kannisto
Re: Is there a wordPerSec expression?
on May 8, 2019 at 3:02:24 pm

There's probably a neater way to do this, but this should work.

wordsPerSec = 4;
word_array = value.split(" ");
tTotal = word_array.length/wordsPerSec;
t = easeIn(time,0,tTotal,0,tTotal);
idx = Math.floor(t*wordsPerSec);
output = "";
for (i=0; i<idx; i++){
output = output +" "+word_array[i]}
output


Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Kalleheikki Kannisto
Re: Is there a wordPerSec expression?
on May 8, 2019 at 3:05:03 pm

Note: since there's an Ease In, it doesn't really start at 4 words per second but builds up to it.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index


Olly Starkey
Re: Is there a wordPerSec expression?
on May 8, 2019 at 3:50:56 pm

Thanks Kalleheikki. That's super helpful.

I'll have a check on this when I get back in later.

Thanks so much


Return to posts index

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