Skip to main content
ninose11
Inspiring
April 23, 2022
Question

does After Effects have an expression to trigger and align typewriter effect to typing sounds???

  • April 23, 2022
  • 3 replies
  • 1799 views

I know that in After Effect you can make audio react to layers by using the "convert audio to keyframes" command. But is there an expression that would allow me to automatically sync and trigger the sound of a typewriter with AE's "typewriter" effect? I know I could just insert that effect and manually align the sound to every instance of a letter being typed, but I that would require a lot of layers and be quite time consuming. I was hoping there might be a more efficient way to do this with an expression that would automate it. Thank you in advance for any help with this.

This topic has been closed for replies.

3 replies

granth54436419
Known Participant
April 26, 2022

For setting the audio trigger to individual keystrokes, you might use markers. This would be a pain for long passages, (might be worth just recording someone typing the text you are showing), but fairly easy for a shorter passage.
See this short video: "
Link Text Animation to Markers in After Effects" from UKramedia.

ninose11
ninose11Author
Inspiring
April 26, 2022

Thank you very much for your help granth. I'm hoping to use an expression because I have a whole paragraph of text to animate, and manually lining up the typewriter key sound to each character would take quite a long time. 

Dan Ebberts
Community Expert
Community Expert
April 23, 2022

The trick with something like this is deriving the triggers. You could set up a time-remapped audio layer of a single typewriter keystroke and use a time remapping expression like this to use the Start property in the Typewriter effect's Range Selector to calculate the timing for the sound of each character typed:

T = thisComp.layer("Text");
txt = T.text.sourceText.value;
st = T.text.animator("Animator 1").selector("Range Selector 1").start;
n = txt.length;
delta = (st.key(2).time - st.key(1).time)/n;
if (time >= st.key(1).time && time <= st.key(2).time){
  (time - st.key(1).time)%delta;
}else{
  0
}

but the sounds will fire off at a very regular, mechanical-sounding rate (and spaces will sound the same as letters). But it might be a good place to start if you're up for a challenge.

 

ninose11
ninose11Author
Inspiring
April 24, 2022

Thank you very much for your help Dan. I'll be sure to try that out. Thanks again!  😀

Mylenium
Legend
April 23, 2022
ninose11
ninose11Author
Inspiring
April 23, 2022

Thank you very much for your help Mylenium. But isn't that plugin just a more efficient way to browse files in AE?

Community Expert
April 23, 2022

Probably the easiest thing to create that kind of timing scenario would be to create a smooth typewriter effect, then pre-compose, time remap the animated layer, then apply an expression to time remapping to control the timing. Dan Ebberts has an example or two on his website. Look at his audio-counter, or his audio-trigger example, or look down the page on his Expression Speed and Frequency Control page for the streetcar example that uses audio amplitude to retime a movie.

 

This can be a lot easier if you purchase this script: https://aescripts.com/beatnik/. Dan is the man when it comes to this kind of animation.

 

I hope this helps.