FORUMS: list search recent posts

Countdown Timer As Words Instead of Numbers

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Leon
Countdown Timer As Words Instead of Numbers
on Apr 2, 2015 at 6:58:00 pm

I have been looking for a way to create a countdown timer that uses words instead of numbers,
for example "FIVE FIFTY NINE" instead of 5:59. What I want to know is, there a way I can create this with an expression or other technique that does not have entail typing out every single word and animating it that way?


Return to posts index

Daniel Waldron
Re: Countdown Timer As Words Instead of Numbers
on Apr 2, 2015 at 10:42:23 pm

That seems tricky. I would post in the Expressions forum; you will likely get some sort of answer if no one here has any ideas. I would imagine some sort of script would need to be written to tell AE what text correlates to what numeral.

Return to posts index

Declan Smith
Re: Countdown Timer As Words Instead of Numbers
on Apr 4, 2015 at 1:13:40 am

You'll have to do some kind of look. You didn't specify the source of your numbers and what you want to countdown (limits etc), so the example I have given below makes some assumptions.

Add this expression to a text source object and add a slider to the text layer. The slider in this case is the source of numbers. So in your question, if the slider is set to 5.59, the text source will read "five fifty nine". The way it's written below will allow for up to 99.99 (which would read "ninety nine ninety nine"). Also note that 1.05 will read "one zero five"

Hopefully there is enough below to give you a starting point.

nums = ['zero','one','two','three','four','five','six','seven','eight','nine'];
teens = ['ten','eleven','twelve','thriteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen'];
tens = ['null','null','twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety'];

function numberToText(number) {
if (number < 10) {
numStr = nums[number];
} else if (number <20) {
numStr = teens[number];
} else {
tensIndex = parseInt(number/10);
numsIndex= number % 10;
if (numsIndex == 0) {
numStr = tens[tensIndex] ;
} else {
numStr = tens[tensIndex] + " " + nums[numsIndex];

return numStr;
rawnumber= effect("Slider Control")("Slider");
num1 = parseInt(effect("Slider Control")("Slider"));
num2 = '';
num3 = parseInt((rawnumber-num1) * 100);
if (num3 < 10) {
num2="zero ";
numberToText(num1) + " " + num2 + numberToText(num3)

Declan Smith
After Effects CS6/ FCS3 / Canon XLH1 / Canon 7D / Reason / Cubase

"it's either binary or it's not"

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 All Rights Reserved