Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Generating random text…how?

  • Generating random text…how?

    Posted by Adam Taylor on July 16, 2007 at 9:13 pm

    i need to create some randomly generated lines of text within a box. Very much along the lines of the text seen by The Terminator when we are seeing things from his perspective.

    Is there an easy way to do this, or anyone know of a tutorial i could use to get this sorted?

    thanks in advance

    adam

    Editor/Mixer
    Character Options Ltd
    Oldham, UK

    Adam Taylor replied 18 years, 10 months ago 3 Members · 4 Replies
  • 4 Replies
  • David Franklin

    July 16, 2007 at 9:37 pm

    Here’s a link to a Dan Ebberts tutorial about building a random array of binary numbers.

    https://www.motionscript.com/design-guide/binary-block.html

    Perhaps you could use this as a starting point, only instead of reducing your string to base 2 as he does, keep it in base 10. This seems to me like it would do nicely for generating random strings of actual text.

  • Adam Taylor

    July 16, 2007 at 10:00 pm

    great..thanks very much

    adam

    Editor/Mixer
    Character Options Ltd
    Oldham, UK

  • Mike Clasby

    July 16, 2007 at 10:21 pm

    Here is another Dan link for a random number and letter grid:

    https://www.creativecow.net/articles/ebberts_dan/ae6_exp/index2.html

    Go to the part just above “Time to Split”.

    Here is that same expression for letters only:

    numRows = 4;
    numChars = 8;
    holdFrames = 5;

    seed = Math.floor(time/(holdFrames*thisComp.frameDuration));
    seedRandom(seed,true);

    s = “”;
    j = 0;
    while(j < numRows){ k = 0; while (k < numChars){ c = Math.floor(random(58,84)); if (c > 57) c += 7;
    s += String.fromCharCode(c);
    k += 1;
    }
    s += “\r”;
    j += 1;
    }
    s

    Here is that expression for letters and numbers:

    numRows = 4;
    numChars = 8;
    holdFrames = 5;

    seed = Math.floor(time/(holdFrames*thisComp.frameDuration));
    seedRandom(seed,true);

    s = “”;
    j = 0;
    while(j < numRows){ k = 0; while (k < numChars){ c = Math.floor(random(48,84)); if (c > 57) c += 7;
    s += String.fromCharCode(c);
    k += 1;
    }
    s += “\r”;
    j += 1;
    }
    s

  • Adam Taylor

    July 18, 2007 at 3:26 pm

    exactly what i needed – worked like a charm.
    thanks all.

    adam

    Editor/Mixer
    Character Options Ltd
    Oldham, UK

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy