Copy link to clipboard
Copied
Hello, I am a kind of new user of Adobe After Effects, and I was reluctant to make an online post in these type of forums as the question could not be looked at by the global community which global itself is crazy.
To the question/problem, I wanted to know from the 'gods' from above in After Effects land if I am able to use Audio Amplitude to solely trigger the y-value of objects e.g. a 2-dimensional red circle? I will try to attach visual aids to explain my problem to you whoever you are.
I have tried to accomplish my desired effect using the BeatEdit plugin, but all that does is apply x-value position movements to the metronome beat from what I saw.
Please be kind and understanding, and I will try not to informally reply based on my mood.
Thanks.
Copy link to clipboard
Copied
Hi! Welcome. You'll want to right click your adio layer go to Keyframe Assistant > Convert Audio to Keyframes. That will create a new layer called something like Audio Amplitude. After that you will want to define the range of amplitudes. Here's a pretty good tutorial: https://www.youtube.com/watch?v=k6xZUlhlZxs
Copy link to clipboard
Copied
No that video did not help me and I watched it the other day to no help. I searched on Youtube.com on this technique and most of these videos are about SCALE, some about OPACITY, and rarely to none about POSITION. I can see why the above two are the most common because I also have tried SCALE and it was doable, but I would like to see a POSITION based video which would hopefully straight answer my question...
Thank you for your help.
Copy link to clipboard
Copied
The principals are all the same. Turn the change in Audio Amplitude - Both Channels (or left or right), into values for one or more properties using a linear or ease interpolation method. The expression is going to be the same up to the point where you get to the array at the end. 3D layers have 3 spots for Anchor Point, Position, and Scale so the array looks like this [xValue, yValue, zValue]. Change the layer to 2D and you only have two values in the array. Colors have 4 values so they look like this [0 to 1 for Red, 0 to 1 for Green, 0 to 1 for Blue, 0 to 1 for Alpha]. There are a lot of properties that have only one value. Rotation is an example.
The expression always starts by declaring a variable that looks in a Comp, then for a Layer, then for an effect or other element like the Range Selector for a text animator, then the property that has a value. When you have defined the property using that hierarchy you can then apply that to a linear operator. For example:
t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
tMin = 0; //minimum Both Channels Slider value
tMax = 30; //maximum Both Channels Slider value
value1 = 0; // minimum starting value to output
value2 = 200; // maximum ending value to output
NewV = ease(t, tMin, tMax, value1, value2);
[value[0], value[1] + NewV, value[2] * NewV]
I chose t, tMin, tMax, value1, and value2 for the variables because when you choose the Expression Language Menu>Interpolation>ease function you get the text I used for NewV. You can leave off the tMin, tMax, value1, and value2 variables and just enter numbers in the ease method if you like but it makes it easier to explain how this expression works.
Apply that expression to the Position of a 3D layer and the Position values for X, Y, and Z will not start to change until the value of the Both Channels slider moves above zero. The expression will move the layer up to 100 pixels in Y and multiply the original Z position by 100 as the audio levels change from 0 to 30.
The easiest way to figure out what the values you should use for tMin and tMax is to look at the graph editor.
That explanation should solve your problem, Just match the array to the property you want to animate and set value1 and value2 to the minimum and maximum amount of movement.
Copy link to clipboard
Copied
Dear Rick, thanks for the overwhelmingly detailed reply. I shall try out the expression code within the next five hours as I have school commitments later this evening. I am not a competent expression user and only used it once properly in a Youtube.com video (if you would like to see the effect in the video I can attach it in my next reply? It is not the same effect I hope to achieve but it uses Audio Amplitude and POSITION values).
Copy link to clipboard
Copied
You have to be very careful about the tutorials you find on YouTube. Most of them are prepared by enthusiasts and they are poorly explained and often promote terrible workflows. Vet your trainers. Make sure they know what they are talking about.
Don't be afraid of the User Guide and the Search Help field in the top right corner of After Effects. The tutorials in the user guide are all pretty decent and the Search Help field will direct you to a lot of resources that can help you find answers faster than a general web search.
Copy link to clipboard
Copied
The video was my own and it just featured instead of teaching the effect if you did not see the entire post. And yes thank you for the caution, most of the Youtube.com videos are not great, but some of them do explain clearly visually and audibly, enthusiasts or trainers. Thank you for the help.
Copy link to clipboard
Copied
And can I use your given expression for 2 dimensional objects instead of 3 dimensional objects i.e. the red circle in the attached video in the original post?
Copy link to clipboard
Copied
Sorry for the spamming replies, but I have tried it, did not work, turned on 3D, did not work. The error is the first line and forgive my beginner level knowledge of expressions; I am clueless about what to do with expressions.
Copy link to clipboard
Copied
You have cropped your screenshot and your error message isn't telling me anything. The most obvious problem is that you have renamed the Audio Amplitude layer or it is not in the comp.
Post another screenshot and expand the error message so I have some idea what is missing. I need to see all layers but I don't need to see all of the expressions.
To make the expression work with 2D layers just change
[value[0], value[1] + NewV, value[2] * NewV]
to
[value[0], value[1] + NewV]
so you are now delivering X and Y to the array instead of X, Y, and Z.
And yes, some of the tutorials by enthusiasts show some good things but the great majority of them are poorly explained with inefficient workflows and they lead users that try and follow them down dark alleys. Don't trust them completely, and if you are following the steps carefully and they don't work don't assume that the problem is something that you are doing or that it is a bug. More often than not the problem lies with the tutorial.
Copy link to clipboard
Copied
Hey Mr Rick I could print screen my screen but it would show personal hard drive details, and clicking out of After Effects closes the expression space and Snipping Tool doesn't capture it.
Copy link to clipboard
Copied
Here is the video featuring the effect related to what I was hoping to achieve: https://www.youtube.com/watch?v=YjOZFlnGYP4
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You have resized the screenshot so much that I can't read the error message but it looks like you just need to remove the Z part of the array in the last line because your layer is 2D.
Try this:
t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
tMin = 1; //minimum Both Channels Slider value
tMax = 4.5; //maximum Both Channels Slider value
value1 = 0; // minimum starting value to output
value2 = 125; // maximum ending value to output
NewV = ease(t, tMin, tMax, value1, value2);
[value[0], value[1] - NewV]
That works just fine in this comp:
I changed the values based on the audio file used for this comp.
Copy link to clipboard
Copied
Hey I used the Adobe options and chose to make it Large or whatever. The more I try to succeed with this expression the more I think of alternate, simpler methods to get what I want. Being an expression beginner the confusion may be just me or it is your method of delivery. Thanks for the help which 99 percent of the Adobe community would so called click with.
Copy link to clipboard
Copied
Dear Rick, thank you for the help. The latest expression code did work though I do not wish to mark anything as the Correct Answer. Probably someone else will, but thank you for trying to help me find the right expression and I guess you would mind if I credit you in Youtube videos for your help.
Thank you thrice.
Copy link to clipboard
Copied
If you copy the expression I posted and paste it to the position property of the layer you want to move up and down based on an audio layer it will work. There is nothing to figure out.
I made a project file for you. Only the values have changed, the expression is perfect. I added the expression to a null that was attached to one of the points on a shape layer using the Create Nulls from Paths script that now comes with After Effects.
Here's the file. Download it and look at what I have done.
https://www.dropbox.com/s/epta56ykza4n6u7/Audio%20moves%20mouth.aep?dl=0
If your browser adds a .txt extension to the AEP file then just delete it. You won't have the audio track but you can add your own, then delete the Audio Amplitude layer if you like. You'll see that the expression does work.
What are Adobe options? Do you mean the Transform properties?
Copy link to clipboard
Copied
The Adobe options are those small, medium and large formatting options. That is likely why my photos are smaller than yours. I will look at your given file since you have done the hard part to help me, would you mind if I credit you in Youtube videos which feature the effect?
Copy link to clipboard
Copied
Yes the file downloaded without the txt extension and effect worked; the face was a surprise.