ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Text Layer Display Current Sound

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>

Christian Ekren
Text Layer Display Current Sound
on Mar 17, 2011 at 6:36:16 pm

Hi, I am making a mostly audio only video, but it includes many 2-3 second audio clips, and I was wondering if it was possible to make a text layer that dynamically changes to the file name of the current sound being played.

There are abot 400 audio clips so you can understand why I am hesitant to do it all manually...

Thanks!
- Christian

P.S. If I didn't explain it clear enough please let me know!


Return to posts index

Brian Charles
Re: Text Layer Display Current Sound
on Mar 17, 2011 at 8:51:25 pm

I'm sure you could use an expression to change the text to the layer name. You may want to post on the expressions forum.



Return to posts index

Walter Soyka
Re: Text Layer Display Current Sound
on Mar 17, 2011 at 9:32:42 pm

You could add a Text layer above a sound effect, and enter something like "Layer Name" as the text. Twirl the Text properties group down to reveal the Source Text property. Alt-click the stopwatch and enter thisComp.layer(index+1).name

This expression will cause the text layer to display the name of the layer immediately below it in the stack. You can copy and paste this layer over each of your sound effects, trimming the in and out points to match. This can all be done from the keyboard, so it'd be pretty straightforward to program a keyboard macro program to help out with this.

If you have renamed your SFX layers so they no longer match the original filename, I think you could use thisComp.layer(index+1).source.name, but this will fail on things which don't have sources (like text or shape objects).

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index


Christian Ekren
Re: Text Layer Display Current Sound
on Mar 17, 2011 at 10:37:02 pm

Thanks, I understand the first two paragraphs, and have that working, but what do you mean having renamed my SFX layers, it sounds like that function would work on the audio files, but they are all original names. Here is a picture of what I want:



(click to see full size)

Notice that the scrubber is on ..._01 and the text reads ..._00. Also, the time of each clip is different, so I don't know if a macro would work (at least the kind im thinking of)


Return to posts index


Walter Soyka
Re: Text Layer Display Current Sound
on Mar 18, 2011 at 1:01:11 am

Let's take this expression apart:

thisComp.layer(index+1).name

Using thiscomp.layer(...) lets us refer to a layer in the comp by number. index refers to the number of the layer the expression is in; adding one to the index (index+1)makes it refer to the number of the layer immediately beneath the expression we're evaluating. .name grabs the name of the layer; .source.name grabs the name of the layer's source.

If you slide that layer up and down the layer stack, you'll see the text update to reflect the name of the layer immediately underneath it. AE doesn't "know" which sound effect file is playing at any given point in time, so this has nothing to do with the name of the file playing now; it only tells us the name of the file in the layer beneath the text layer.

An expression in AE is calculated on every frame that it's rendered. To figure out what sound is playing right now, you'd have to walk down the layer stack from top to bottom, comparing the in and out points of each layer with the current time to see if it's playing or not until you found one. With up to 400 layers to step through, this expression would run very slowly, and might even time out, causing your render to fail.

Instead, I am suggesting that you select that text layer, copy it, and paste it over and over, so there is one text layer above each SFX layer.

When you paste, AE always pastes immediately above whatever layer you have selected. Also, trimming the ins and outs of a layer to match the layer beneath it can be done entirely with the keyboard, which is why I have suggested a keyboard macro. You'll need a macro application like QuicKeys or Keyboard Maestro on the Mac, or AutoHotKey on the PC.

Once you've copied the text layer to the clipboard, the following keystroke sequence could be looped to add additional layers and trim them. (I've used Mac keyboard shortcuts; if you're on a PC, substitute Ctrl for Cmd, and Alt for Option)

Cmd-V
paste

Cmd-DownArrow
select the next layer down in the stack

I
go to the selected layer's in point

Cmd-UpArrow
select the next layer up in the stack

Option-[
set the current layer's in point to the current time

Cmd-DownArrow
select the next layer down in the stack

O
go to the selected layer's out point

Cmd-UpArrow
select the next layer up in the stack

Option-]
set the current layer's out point to the current time

Cmd-DownArrow
select the next layer down in the stack

Cmd-DownArrow
select the next layer down in the stack

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Christian Ekren
Re: Text Layer Display Current Sound
on Mar 19, 2011 at 4:27:20 am

Ok, thanks I have figured out the key combos, but... How do I use AutoHotKey? I see no 'record' or 'stop' button (I see a pause), and I don't see a playback button... Maybe it's just my lack of sleep but could you explain one more thing? Thanks, and sorry for any inconvenience. :)


Return to posts index


Christian Ekren
Re: Text Layer Display Current Sound
on Mar 19, 2011 at 5:37:35 am

Ah, never mind, I found a good alternative, a simple and to the point macro recorder, haha. Thanks anyways, though, and it all worked fine! One more thing though, you wouldn't happen to know some good render settings for an irregular dimensioned video (750 x 50) that includes RGB+Alpha channel, would you?


Return to posts index

Walter Soyka
Re: Text Layer Display Current Sound
on Mar 20, 2011 at 2:41:59 am

[Christian Ekren] "I found a good alternative, a simple and to the point macro recorder"

I'm glad you found something that worked. What macro program did you end up using?


[Christian Ekren] "you wouldn't happen to know some good render settings for an irregular dimensioned video (750 x 50) that includes RGB+Alpha channel, would you?"

What's your deliverable? You could use Quicktime (MOV) with either the Animation or PNG codec, you could use uncompressed AVI with the None codec at 32 bit color depth, or you might try Flash Video (FLV) with the On2 VP6 codec if this is a Flash/web banner video.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Christian Ekren
Re: Text Layer Display Current Sound
on Mar 20, 2011 at 3:16:09 am

[Walter Soyka] "I'm glad you found something that worked. What macro program did you end up using?"

It's actually called Easy Macro Recorder (http://www.flashplayerpro.com/MacroRecorder/)!

[Walter Soyka] "What's your deliverable? You could use Quicktime (MOV) with either the Animation or PNG codec, you could use uncompressed AVI with the None codec at 32 bit color depth, or you might try Flash Video (FLV) with the On2 VP6 codec if this is a lash/web banner video."

For all intents and purposes I want the smallest video possible, since this is only for changing text in the video I can get away with 15fps (anything lower and it stops syncing with audio). It would be nice to use an alpha channel, but the background color doesn't change on the video so I can just get away with using that!

By the way... it might have something to do with the fact that there is nearly 1,000 layers with the audio + text, but it always seems to render *very* fast until it hits about half way through where it just stops moving. I double click AE and it fades white (win7 lock up) and then will suddenly go back about 30 sec later and render 40 or so frames and then stop again. Am I running out of RAM or what? It says 60% of 4GB used (32x CS4, sys has 8GB). Sorry for long post but do you have any suggestiosn? Thanks!


Return to posts index


Walter Soyka
Re: Text Layer Display Current Sound
on Mar 21, 2011 at 9:02:27 pm

[Christian Ekren] "By the way... it might have something to do with the fact that there is nearly 1,000 layers with the audio + text, but it always seems to render *very* fast until it hits about half way through where it just stops moving. I double click AE and it fades white (win7 lock up) and then will suddenly go back about 30 sec later and render 40 or so frames and then stop again. Am I running out of RAM or what? It says 60% of 4GB used (32x CS4, sys has 8GB). Sorry for long post but do you have any suggestiosn?"

You'll probably get a better response to this if you start a new thread on it.

I'd suggest that you make sure you have the lastest updates for AE CS4 installed. I'd check the media on the spot where AE fails to make sure it's not corrupt. If you're using MP3 or similarly-compressed audio files, I'd transcode them to AIFF or WAV.

You can monitor your system's CPU and RAM usage while rendering to see if it is a resource problem. Hit Ctrl-Shift-Esc to open the Windows Task Manager, then see the Performance tab.

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Christian Ekren
Re: Text Layer Display Current Sound
on Mar 17, 2011 at 10:37:26 pm

By the way, it seems that changing the index+# determines the layer name, would there be a way to make it change that number each time a clip ends? I have no idea how to code so I'm just spitballing ideas now, :).


Return to posts index

Ryan ONeil
Re: Text Layer Display Current Sound
on Jul 13, 2011 at 6:18:01 am

Are all the sound effects the same size?


If so, why not just use keyframe assistant? Put all the layers in and create them all with the same length (say 2 seconds each). Use the keyframe assistant to sequence the layers. (Animation->keyframe assistant->sequence layers...) Choose no overlap. This will sequence all of your sound layers one after the other.


Let's say X=number of layers you have.

Then, do the exact same steps with X copies of the text layer we've been discussing (with source text property expression being thisComp.layer(index+1).name) The only difference, instead of putting +1, put -X. After you use your keyframe assistant, all of your layers will magically be in place!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]