(Close)
Forgot password?
Join Now! Watch Tutorials
macProVideo.com
Close

Free Premium Access

Access our entire library of Premium Hub Articles, Project Files and the first 10% of each Tutorial-Video from the Online Tutorial Library.

Create your FREE Account now!

Already a member? Login

Categories

Related Articles

  • After Effects: 13 3D Workflow Tips
  • by Clay Asbury
  • 13 is unlucky for some, but certainly not for all of you After Effects users out there! Clay Asbury, Adobe After Effects expert trainer, reveals 13 of his tastiest tips for working in 3D.
  • MPV FREE Stuff: After Effects Music Video Kit
  • by Toby Pitman
  • Free lunch, free beer, or free After Effects goodies for creating your own music videos… it's not a tough choice when you see what Toby Pitman has created for you!
  • After Effects: Audio Stems To Radio Waves
  • by Toby Pitman
  • From importing audio stems into After Effects through to converting audio to keyframes and using linear expressions, this article has it all. Toby Pitman shares his tips on how to animate audio in AE.
  • After Effects: The Roto brush Tool
  • by Richard Lainhart
  • This excellent tutorial on using Adobe After Effect's Roto brush tool is from the unpublished collection of Hub articles by Richard Lainhart, RIP. This is an essential article on compositing. Enjoy.
  • Create A Lunar Landscape in After Effects CS5.5
  • by Toby Pitman
  • Space. The final frontier? Maybe. In this After Effects step-by-step, there's no need for 'giant leaps' as Toby Pitman (moon) walks you through how to create a realistic lunar landscape.

Related Tutorial-Videos

  • Reason 6 107
  • Beat Design Basics
  • Making solid beats is 5% inspiration and 95% perspiration. In this 33-video collection you’ll work up a good sweat as you develop a strong foundation in the art and science of building beats in Reason 6...
  • Motion 5 105
  • Animating Effects
  • Got a behavior problem? Motion 5‘s got a solution. Learn how to animate using Behaviors, Keyframing and Tracking with the always animated Motion expert, Michael Wohl...
  • After Effects CS5 303
  • More Cartoon Animation Basics
  • Learn to use Adobe After Effects' Puppet Pin tool to animate characters in the "squash-and-stretch" style seen in the classic cartoons of the 30s & 50s in More Cartoon Animation Basics by After Effects expert Richard Lainhart...
  • Motion 5 104
  • Effects, Particles and Replicators
  • Motion comes jam-packed with a huge variety of very hot motion graphic effects. This tutorial shows you how to ignite these awesome Filters, Particle Systems and Replicators to fill your frames with kinetic energy and action...
  • Photoshop CS5 404
  • Lighting & Light Effects
  • Join Film Industry Pro Mark Stope as he shows you how to light scenes and create dramatic lighting effects using Photoshop CS5.
  • Live 8 405
  • Max For Live: Basics
  • Learn the fundamantals of Max For Live and begin designing your own uniques Devices, Instruments and Effects in Ableton Live...
  • Final Cut Pro X 106
  • Titles, Effects and Compositing
  • Final Cut Pro X incorporates very powerful tools for creating titles, visual effects and complex composite shots. Join star trainer and video editor Michael Wohl, as he explores each of these techniques and shows you how they are created, customized and edited to perfection. So if you're wondering how create stunning effects in FCP X, this tutorial will get you going down the right path!
  • Cubase 6 103
  • Production Basics
  • Now that you’ve mastered the “Fundamentals” of Cubase it’s time to start producing music! This tutorial by Matt Hepworth explores all the need-to-knows techniques required to start you on your way to producing tracks in Steinberg’s Cubase 6...
  • After Effects CS5 302
  • Cartoon Animation Basics
  • Learn how to animate photos and create basic characters in the style of “South Park”, “Monty Python” and “Jib Jab” in this tutorial, Cartoon Animation Basics, by After Effects expert Richard Lainhart.
  • Live 8 202
  • Live's Effects: Plugged In!
  • Join Mo Volans as he takes you on an overview of Live’s amazing bundled plug-ins! This tutorial, filled with tons of audio examples, is a treasure-trove of information on how to use and master all of Live's included effects!
  • After Effects CS5 203
  • Secrets of Particle Playground
  • Learn the little-known secrets of After Effects' Particle Playground plugin with special effects expert & Star macProVideo.com Trainer Richard Lainhart.
  • After Effects CS5 201
  • Motion Tracking and Stabilization
  • Learn the ins-and-outs of After Effects’ Motion Tracking and Stabilization techniques with special effects expert, Richard Lainhart.
  • Web Design 102
  • WordPress Basics
  • Wordpress is “the” software for creating blog sites. Join expert trainer, Geoff Blake as he takes you through all the ins and outs of creating a "feature rich" Wordpress based website!
  • Web Design 101
  • XHTML Basics
  • Do you want your web creations to work in all platforms from desktop to handheld? Then take a step toward the future and learn to program in XHTML with web design guru, Geoff Blake!
  • After Effects CS5 101
  • Core After Effects CS5
  • Adobe’s After Effects CS5 is the industry-leading motion graphics software that powers animations across all media including the web, on TV and in feature films. Join visual artist/musician and macProVideo.com trainer Richard Lainhart in this detailed exploration of everything you need to know about the powerful animation tools in After Effects CS5.
  • Feb 14, 2012
After Effects: Expressions Basics
  • Genre: Video
  • Level: Beginner/Intermediate
  • Time to Complete: 15-30 minutes
  • 0 comments — Start Discussion

Preview these After Effects Tutorial-Videos

After Effects CS5 101: Core After Effects CS5 - Play IconAfter Effects CS5 101: Core After Effects CS5 - Preview Video
After Effects CS5 303: More Cartoon Animation Basics - Play IconAfter Effects CS5 303: More Cartoon Animation Basics - Preview Video
After Effects CS5 302: Cartoon Animation Basics - Play IconAfter Effects CS5 302: Cartoon Animation Basics - Preview Video

Expressions in After Effects are a powerful but rather scary feature that even many experienced AE artists shy away from, simply because expressions look like computer code. Well, they are computer code, of a sort - in fact, expressions are based on Javascript, much used in Web programming, and like all computer languages and scripts, expressions have a strict syntax. If you don't follow the syntax, the code won't execute, and many find that syntax obscure and unintuitive. 

However, After Effects has tools that help you create useful expressions without having to know the proper syntax or understand the underlying code. In this article, we'll take a brief look at Expressions and show you how to use a simple expression to create an automatic VU meter that appears to respond to an audio track.


Step 1 - What Are Expressions?

An expression in After Effects is a modifier applied to a specific animation property, like Rotation, to either link that property to the values in another property, even in another layer, or to automatically animate that property without using keyframes. 

For example, let's make a simple analog loudness meter in After Effects: create a new comp about 5 seconds long, and add a new long, narrow Solid to it, called Needle - I've made mine 20 pixels wide and 200 pixels high:

Needle


Double-click the solid to open it in its Layer window, grab the Pan Behind (Anchor Point) tool, and shift the anchor point for the Needle down to its bottom edge, so the Needle will rotate around its end instead of its middle.


Step 2 - The Wiggle Expression

Now at this point we could add some random Rotation keyframes so the needle rotates around, but a much faster and more flexible way to do that is to use a Wiggle expression, which will automatically rotate the needle randomly.

So, type R to solo the Rotation property for the Needle, then Option-click the Stopwatch for the Rotation property (Option-clicking the stopwatch will add a new expression). When you do, you'll see that the property values for Rotation turn red, meaning they're controlled by an expression, and you'll also see a line of highlighted text in the Timeline saying transform.rotation:

Rotate it


You'll also see some additional interface objects appear under the red property values. Now, that "transform.rotation" text is just a placeholder, reminding us that whatever expression we add will be applied to Rotation. Next, with that text still highlighted, click on the Expression Language Menu arrow that appeared below the red Rotation values when you added the expression and choose Property > wiggle(freq, amp, octaves = 1, amp_mult = .5, t = time). You'll then see that whole "wiggle" line replace the "transform.rotation" line.

setting the wiggle values


If you click away from that text, you'll get an unhelpful error message from After Effects, saying that the expression is disabled. Don't worry about that for the moment; here's what it means.

The words that you see in the parentheses after "wiggle" are the possible arguments, or modifiers, that the wiggle command can take. "Freq" (frequency) refers to the rate of the wiggle, "amp" (amplitude) to the amount of wiggle, and so on. 

For this wiggle expression to work, we have to replace those argument names with actual numbers - as it is, the arguments are just reminders of what can be modified.That's what the error is referring to - that the arguments have to be replaced with real values. In this case, we're going to remove the last three arguments and just modify the first two, which will give us a simple randomized animation.

So, put your cursor inside the parentheses and select and delete everything between them, so you just see this: wiggle().  Then type in 5, 20 inside the parentheses. What we've just done is replace the first two text argument's actual numbers - the position of the numbers, and the comma between them, tell wiggle that the first number is to be applied to freq  - that is, the rotation will wiggle randomly 5 times per second for the length of the comp. The second number 20 in the amp position means that the value of the Rotation will vary plus and minus 20 units (in the case of Rotation, plus and minus 20 degrees). 

Your expression should now look like this:

The expression


And your animation should look something like this:


The wiggle expression randomly rotates the Needle around in a way that simulates a VU meter responding to audio levels. To change this response, just change the two numbers inside the parentheses - a higher first (freq) number will make the needle jitter more rapidly; a higher second (amp) value will cause the needle to swing in a wider arc. 

As you can see, keyframing something like this would require many keyframes, and changing that keyframed motion after the fact would require a lot of tweaking. By using an expression instead, simply changing a couple of values will change the animation completely, and make it much easier to adjust the effect.

Well, that's a basic introduction to expressions. We're going to follow this up with another tutorial on linking this meter to the real amplitude values in an audio track, so stay tuned for that. In the meantime, as always, experiment and have fun!

Continue the joinery with After Effects Expressions in Part 2.

Preview these After Effects Tutorial-Videos

After Effects CS5 101: Core After Effects CS5 - Play IconAfter Effects CS5 101: Core After Effects CS5 - Preview Video
After Effects CS5 303: More Cartoon Animation Basics - Play IconAfter Effects CS5 303: More Cartoon Animation Basics - Preview Video
After Effects CS5 302: Cartoon Animation Basics - Play IconAfter Effects CS5 302: Cartoon Animation Basics - Preview Video
Richard Lainhart

Richard Lainhart

Richard Lainhart is an award-winning composer, filmmaker, and author. His compositions have been performed in the US, Europe Asia, and Australia, and recordings of his music have appeared on the Periodic Music, Vacant Lot, XI Records, Airglow Music, Tobira Records, Infrequency, VICMOD, and ExOvo labels. His animations and short films have been shown in festivals in the US, Europe, and Asia, and online at ResFest, The New Venue, The Bitscreen, and Streaming Cinema 2.0. He has authored over a dozen technical manuals for music and video hardware and software, served as Contributing Editor for Interactivity and 3D Design Magazines, and contributed to books on digital media production published by IDG, Peachpit Press, McGraw Hill, and Miller Freeman Books. Previously an Adobe Certified Expert in After Effects and Premiere, a demo artist for Adobe Systems, and co-founder of the official New York City After Effects User Group, he was, from 2000-2009, Technical Director for Total Training Productions, an innovative digital media training company based in New York and California.

Comments

You must be logged in to post a comment.
Create an Account  Login Now

What is macProVideo.com?

macProVideo.com is an online education community featuring Tutorial-Videos & Training for popular Audio & Video Applications including Adobe CS, Logic Studio, Final Cut Studio, and more.
© 2012 macProVideo.com
a division of NonLinear Educating Inc.

About

Our Plans

Tutorials

Community

Help

Legal

Link