ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Copying keyframes from one layer to another?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Josh FairheadCopying keyframes from one layer to another?
by on Dec 1, 2009 at 10:58:51 pm

I'm trying to get circles of different colours to fade out in sync with very basic music for a music technology project.
The way I am approaching this is to create the circles in after effects, look at the wave form and then fade out its opacity before the next peak. So to do that I have to go through every note and fade it manually, instead I thought I could generate keyframes from audio volume and then appears as a null object. I have no idea now how to turn the keyframes in the audio amplitude object into opacity information for the coloured circles. It seems I can't just copy these to the opacity layer and edit the fade information.

Is there a way of going about this maybe?


Return to posts index

Dave LaRondeRe: Copying keyframes from one layer to another?
by on Dec 1, 2009 at 11:54:10 pm

AE has a command called, "Convert Audio To Keyframes". It MIGHT get you where you need to be. You can look it up in AE Help to see the particulars on it. If you can get it to do position changes -- let's say in that null's Y axis -- you'd then have to write an expression to control opacity on the layer in question.

That's a good one for the AE Expressions forum.

But even so, using Convert Audio To Keyframes is like hitting a wire brad with a sledge hammer. You might have better luck isolating the beats with Trapcode Soundkeys: it lets you isolate a particular frequency range in the audio file, which is a lot more precise.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA

Return to posts index

Stuart ElithRe: Copying keyframes from one layer to another?
by on Dec 2, 2009 at 1:03:44 am

Soundkeys is definitely a nice plugin for things like this. It's got a visual interface which is nice, and you can control a lot of stuff with the generation of the keyframes.

If you don't want to buy a plugin, you might be able to achieve it using an expression or two.

Off the top of my head, it's something like this:

You want to make the circles pop on (100% opacity) when the audio hits a beat, correct? So, the points where the audio is loudest? You can look at your audio layer keyframes after you have applied the Convert Audio to Keyframes command... have a look at the values, take note of what the value is when it hits a beat (when you want the circle to be opaque).

I jsut did it with a random clip, and the highest value was about 5.

Now you need to tie the opacity of a circle to this value. Alt-Click the opacity stopwatch, use the pickwhip to drag to the keyframes you created (i think it's called Left Slider/Right Slider or something).

If you leave it like this, it will simply use this value as the opacity value. Which isn't what you want, probably, because it's a low number (in my case, only 5, which would mean only 5% opacity at the highest points.

So you can then edit your expression by adding a multiplier after the code that the pickwhip created... in my case, if i added *20 afterwards, it would multiply the result by 20 and therefore be 100% opacity at the high point.

That's the basic way to go about it, but depending on your music, this may not be enough, because there will typically be SOME audio at all points, so the circles will wobble in and out of opacity.

Return to posts index

Josh FairheadRe: Copying keyframes from one layer to another?
by on Dec 2, 2009 at 1:59:22 am

Actually, I was saying I was already using the convert audio to key frames command but then I ran into a problem then linking it.

I slowly figured it out from web tutorials. But still have a few problems on the next stage...

I linked the opacity of the circle to the volume and then used the expression: linear(value,8,25,0,100) to re map the opacity levels. This works fine for transperency though I now have to figure out how to change the circles colour on different notes.

Basically the velocity is now linked with opacity of the circle. I need to be able to change the circle (probably manually) when another pitch is sounded. Is there any way to write in the fill colour of the circle and change it over time?

I plan to have several circles of different colours doing this but with each coloured circle representing a different pitch of the chord, I'm not sure if that will limit my options...

Cheers for the help lads, I appreciate it greatly

Return to posts index

Stuart ElithRe: Copying keyframes from one layer to another?
by on Dec 3, 2009 at 1:56:28 am

If you use the Fill effect to color your circles, you will then be able to play with the color values numerically to change them (using the same data you have already extracted.
Doing it based on pitch is a tricky one though... I don't know how you would get AE to recognise the different pitches.

Return to posts index

Josh FairheadRe: Copying keyframes from one layer to another?
by on Dec 3, 2009 at 2:45:47 am

I'm sorry but I'm a total beginner with AE (only 2 days now but have mostly what I want to do working)

At the moment I'm extracting the auido volume data and assigning it to a circle. At the moment I create this circle by making a new solid layer and masking it with the ellipse tool. I then feather this a bit to make it look nice.

I need to be able to write into a time line of sorts, what colour a circle will be at a given point in time and be able to change this. I dont mind manually writing this so after effects won't have to work out pitch, just what colout to change to and when...

I'm not too sure about what you mean by using the fill, I notice there are a number of ways to do things which result differently so you may have to be sepcific (esp given my limited knowlage on AE).

An example I noticed was creating a circle could just be done with the ellipse tool with a fill but unless I do it on a solid layer I cant feather it. I'm assuming it having to do with one being a shape layer and another being a solid with a mask. Either way I just need to figure this last bit about how to automate colour change and I'm home free.

Again cheers for the help
-Josh Fairhead

Return to posts index

Stuart ElithRe: Copying keyframes from one layer to another?
by on Dec 4, 2009 at 12:43:54 am

OK you've got a few different comments/questions going on here. Let me see what I can clear up.

When I referred to the Fill effect, there is an actual effect called "Fill". It's in the Generate category of the effects menu, and it just lets you pick a color for the layer.
This is helpful for you, because you can keyframe the effect to change it.

To control the color, you can either change it by hand (activate keyframes for the Color attribute of the fill effect, then choose a new color at the point you want it to change).
Now, I can't quite tell if this is what you want... you said you don't mind doing this manually - do you mean you can just go through the timeline and choose the points where you want it to change? If so, that's easy, because you just do it as you like.

If you want an expression to change it, you can do this but as I said before, AE can't determine pitch as far as I know, so it wouldn't know when to change it.

Also note, if you're playing around with expressions for the color fill, the values need to be between 0 and 1, not 0 and 255 (like RGB). There are also 4 values... R, G, B and alpha.

So, for example, you could enter [0,0,1,100] for pure blue.

On a side note, if you want to use a shape layer instead of a solid, you can simply apply a Fast Blur effect which will give you a similar result to feathering a mask. But either option (solid layer or shape layer) works in most situations :)

Return to posts index

Josh FairheadRe: Copying keyframes from one layer to another?
by on Dec 4, 2009 at 3:24:29 am

Cheers Stuart you've been brilliant. Problem sorted!

While looking into what you said about fill I figured out I that you could gradient fill as well so I changed that on the shape layer and then added keyframes to change the colour manually. Then the opacity is changed based on volume information contained in the audio track (well the null object version of this any way...).

Thanks a lot, you've helped tremendously
Best of luck

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved