Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Typewriter Expression

  • Typewriter Expression

    Posted by Gershon Fiedler on December 4, 2007 at 6:52 pm

    Hey expression gurus,

    I’ve got a project that has a lot of typing on screen with a typewrite sound effect. It’s a very tedious job making the sound effect match the screen animation so I decided to try this out with an expression to do the work for me.

    Here’s what I’ve done so far:

    I made a text layer, typed some text and added the typewriter animation preset which gives me the range selector of 0 – 100 percent for the text to type on.

    I added my typewriter sound effect and converted audio to keyframes.

    I then added an expression to that keyframe layer so that the keyframe will show either 100 or 0 depending on if there is a click sound effect at that moment. That expression was:

    x=linear(value, 0, 10, 0, 100)
    if (x>30) 100
    else 0

    then I pickwhiped the text layer’s range selection to the audio keyframe and at this point the text will be either 0% or 100%, making the text on and off when the sound effect is heard.

    So I”m almost there…now I just need it so that it actually counts each 100% ‘click’ to make the range count from 0% to 1% to 2% and so on. I need an expression that would sort of look like the following, except in an actual expression form:

    x=thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”)
    if (x=100) add 1 to value
    else keep last value

    Any ideas? Thanks!

    Glenn Wright replied 13 years, 6 months ago 4 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    December 4, 2007 at 8:57 pm

    Expression results don’t survive from one frame to the next, so at each frame, you have to loop through previous frames to figure out what’s happened in the past. It sounds like you need a variation of this beat counter:

    https://www.motionscript.com/design-guide/audio-count.html

    Just set the threshold to your value (100?) and multiply “n” by the appropriate scale factor. That should do it.

    Dan

  • Gershon Fiedler

    December 5, 2007 at 3:31 pm

    That did it thanks!

  • Yathish Dhavala

    August 9, 2011 at 4:36 pm

    hi
    i am not familiar with using expressions in after effects..
    could you please send me the .aep file
    or explain in a little detail how exactly to attain the effect along with sound
    thanks

  • Glenn Wright

    February 19, 2013 at 7:20 pm

    Hey did you ever find a way for this to work??

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