Copy link to clipboard
Copied
I have a text layer in After Effects that I’m animating using a type writer effect and a keyword sound manually matched to the individual characters showing up on screen to make it sound as isf some one was typing them.
Yes, it is a tideous work!
I’m thinking surely there must be a way to maybe make these individual character trigger a sound from another comp instead.
I literally vacuumed the Internet but all I find is the opposite - sound to control wave forms among others which is not what I’m looking for.
There is also suggestions to use text to speech apps, but the speech would then need to only have one keyboard stroke sound in it. Maybe that would work but I’d rather have it made inside of After Effects if possible.
Is there a solution?
It would help if we could see your comp with the modified properties of the layer you are using revealed.
If I were doing the project I would animate a range selector by letter. I would put the sound its own layer trimmed to just the length of the click. Then I would apply Time remapping, apply a loopOut expression and set up the time remapping keyframes so that the clicks happened at a specific number of beats per minute.
Now you have two sources, a typewriter effect that you can control by the
...Copy link to clipboard
Copied
You can put the audio into a precomp and add a slider to it named "letterfps" for example.
Next you activate time-remap and put an expression to it:
letterfps = Math.floor(thisLayer.effect("Slider Control")("letterfps"));
t = timeToFrames(time) % letterfps;
This will repeat the audio every x frames, depending on what you set up the slider. It will cut off the audio, if the audio is longer than the frames you have set up (audio 10 frame, letterfps set to 5 frame = audio cut off and repeat after 5 frames).
You can try to animate the slider, if the typewriter isn't linear (faster and slower writing).
To increase automation, you'll need to look at the effect. There are selectors - start and end I think - and those numbers are in interest. You could analyze the numbers, calculate the increasing of the start selector and trigger a sound when it's happening. But to play the sound is a bit triggy this way and will return in slow processing code, especially on long comps.
*Martin
Copy link to clipboard
Copied
@martinr84659894
Thank you so much for a quick answer.
I realise that my skill in understanding expressions is at a lower level so I might have to dive in to understand the syntax a bit more.
I tried to follow the instructions as far as my understanding goes but I get this error message:
This is what I did:
The sound I'm using is only 1 frame plus a pause of one, but I guess it would not be a problem:
Copy link to clipboard
Copied
It would help if we could see your comp with the modified properties of the layer you are using revealed.
If I were doing the project I would animate a range selector by letter. I would put the sound its own layer trimmed to just the length of the click. Then I would apply Time remapping, apply a loopOut expression and set up the time remapping keyframes so that the clicks happened at a specific number of beats per minute.
Now you have two sources, a typewriter effect that you can control by the keyframing of the range selector to make the letters type on, and a soundtrack that will last as long as you need it to last. The easiest thing to do would be to adjust the position of the third - the pause keyframe, in the click audio track so the timing matches. This will give you constant rate characters appearing and keys clicking sound effect in one comp.
Once you get the loop out expression in the audio layer you can press the L key twice to reveal the waveform to help you line up the timing.
To adjust the final timing, because Pitch is probably not that critical, you could pre-compose both the text layer and the looped audio layer and apply time remapping to the pre-comp so you could make letters type on faster at one point and slower at another. As long as the timing is fairly consistent it should be pretty easy to set up.
That's the first simple idea that I came up with. To keep the pitch consistent and play an audio track every time a letter appears would take an expression that it would take me a while to come up with, but it would be driven by the index number of the letters in the text animator.
Maybe this will give you some ideas. If you are lucky enough to have Dan Ebberts drop by he could probably write that expression off the top of his head.
Copy link to clipboard
Copied
Rick Gerard
Thank you so much!
I will try your suggestion and see if it'll do the trick.
Copy link to clipboard
Copied
Oh, and the screen dump of the project with the manually positioned key stroke sounds:
Copy link to clipboard
Copied
Sorry, my fault! I always mess the syntax for sliders, because I pig-whip them in most cases.
letterfps = Math.floor(thisLayer.effect("letterfps")("Slider"));
t = timeToFrames(time) % letterfps;
This should work - if not, pig-whip the slider.
You can choose Ricks solution and remake the typing-timing with time remap as he suggested - or take my solution and keyframe the slider.
*Martin
Copy link to clipboard
Copied
Thank you Rick! You were both right but I chose to go with your solution.