Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
LIBRARY:TutorialsVideo TutorialsReviewsInterviewsEditorialsFeaturesBusinessAuthorsRSS FeedTraining DVDs

Creating an Audio LED Meter

COW Library : Adobe After Effects Tutorials : Roland R. Kahlenberg : Creating an Audio LED Meter
Creating an Audio LED Meter


A CreativeCOW After Effects Tutorial

Creating an Audio LED Meter

Roland Kahlenberg

Roland R. Kahlenberg, Singapore, Singapore
Video * Motion Graphics * Original Music



Article Focus:
In this tutorial, Roland Kahlenberg demonstrates creating an 'as real as you want it to be' audio LED meter using Motion Math and Expressions. At the bottom of the page is a sample of its use in Roland's demo reel -- just to give you a 'real world' example.


Download Project Movie Project file Download Stuffit Expander for Windows

 Prerequisites - Stuff you should know before attempting to follow through with this tutorial.
  1. Expression Basics including vector Math addition and subtraction
  2. Applying MotionMath (There's an Expression script provided below for those without the PB)

Things you'll need to work on the tutorial:

  1. Audio File (not included)
  2. A wide eye and a fresh pair of brains (no worries, I was merely referring to the left and right ones)

Today, we'll be creating an "as real as you want it to be" audio LED meter. This tutorial uses a number of Expressions that aren't that difficult. The interpolation script that I've used here was 'borrowed' from JJ Gifford's on-line site at http://www.jjgifford.com/expressions/basics/interpolation.html. You too can be decently successful in integrating some Expression scripts into your work. If you haven't done so yet, then I'm hopeful that this tutorial will help to get you started.

Another good reason to get into Expressions is that you can easily use a single Expression and apply it in many other ways to create other cool effects.

Let's begin by examining the 'physics' of an LED meter. It's made up of equal-sized discrete rectangles. The conventional LED meter is usually strung from bottom to top. A loud audio track will light up most of the rectangles, while a softer one will only light up those on the lower rungs. And if the audio file has a silent spot, then none of these rectangles will be lighted. Given these characteristics, we'll try to emulate this 'real-world' phenomenon. There are obviously other stylistic adaptations of an LED meter.

We'll need a few thingies - rectangles, an audio file, and not so obvious is a "controller" layer. The "controller" will accept audio level information from the audio file (via MotionMath Script, layeraud.mm - ships with the AE Production Bundle only). For those without the Production Bundle, all is not lost. You can use the following Expression to move the Controller along its y-axis.

//Start
(position[0].position.wiggle(3,200)[1])
//End of Expression

Checkout the AE manual for info on the wiggle function so that you can control the movement of the Controller better.


1) Create a new Comp (100 x 240)

2) Create an 80x4 pixel layer and name it "Controller" - Set its position to (70,120)

3) Create a 40x10 layer and name it "Rectangles" - Set its position to (50,235) so that it sits at the bottom of the Comp Window.

- We will be duplicating this layer once we've written the necessary Expressions

4) Drop your audio file into the timeline

Note - Ensure that all files start at the same point on the timeline.

5) Let's apply an Expression to our rectangle's opacity so that it's level at any point in time is dependent on the Y-POSITION of the "Controller" layer. To do this, apply an Expression to the opacity of layer "Rectangles". Type in the following -


PosA = position[1];

// this statement creates a variable, PosA, that refers to this layer's y-position

CntrlPos = this_comp.layer("Controller").position[1];

// this statement creates a variable, CntrlPos, that refers to the "Controller"'s y-position

delta = sub(PosA,CntrlPos);

// this statement creates a variable, delta, that subtracts the current layer's position from that of the Controller layer.

distance = length(delta);

// this statement creates a variable, distance, that returns the result of the delta = ... statement.

length is a built-in Expression function that calculates distances

if (delta>0)

opacity = 100

// This section of the "if ... else" conditional statement checks to see if the Controller is higher (y-position) than the current active layer. If the controller is higher, ie. closer to the bottom of the comp, then the current layer's opacity should be set to 100%. Remember that AE calculates [x,y] positions starting from the top left-hand corner of a Comp Window. It's a little counter-intuitive, so sketch out the problem to have a better idea of what's going on here.

else

linear(distance, 0, 30, 100, 40)

//if the first line is not true, then we'll apply a linear interpolation between the distance of layer Controller and the current layer. Basically we're remapping the values of the distance between the two layers and applying the result towards our opacity. This is done in a linear fashion. To ease in, use the following line instead:

ease_in(distance, 0, 30, 100, 40)

When the distance is 0, the opacity of our rectangles will be 100%. When the difference is 30 or more, then the opacity will be set at 30%. This ensures that our rectangles will have an opacity value of at least 30% at all times. If you want the rectangles to be totally off until it's 'hit' by the controller then simply change the last line to - linear(distance,0,30,100,0).

6) The Expression in its entirety reads as such;

PosA = position[1];

CntrlPos = this_comp.layer("Controller").position[1];

delta = sub(PosA,CntrlPos);

distance = length(delta);

if (delta>0)

opacity = 100

else

linear(distance,0,30,100,40)


7) Now, mass-duplicate the layer "Rectangles" and offset each one to create a ladder of rectangles.

8) To test our script, we'll manually move the y-position of our Controller layer. Open up the position parameter in your timeline for the Controller layer by selecting the layer and pressing the "P" key. Now manually move the Controller up along the y-position. Alternatively, you can select the Controller (object) in the Comp Window, depress the Shift Key (to restrict the movement to the y-axis) to physically move it along the y-axis. As you do so, you should notice that the opacity of each rectangle reacts to the movement of the Controller.

9) With everything in place, we'll now apply MotionMath script, layeraud.mm, to the Controller layer's y-position. You may have to finesse the min. and/or max. ranges within the layeraud.mm script to fine-tune the results.

Start with a min. setting of 240 (the lowest point in our 100x240) comp and max. setting of 0 - the highest point in our comp. Yep, that's right, we have to reverse the min. and max. settings - again to take into account the fact that AE calculates position starting at (0,0) from the top left hand corner of your comp.

Tip: If the Controller's motion path is bunched up within the middle of the comp, you can spread it out easily by changing the min. to a number higher than 240 and setting the max. to less than 0. And if the the top of the motion path maxes out too soon, you'll only have to change the max. setting to a lower number. This will 'stretch' the motion path while retaining the lower values.

10) You can dress up the rectangles with glows, bevels, textures - whatever your fancy is. I've included a tiny section from my partially completed demo reel as an example of how else to use the same Expression you've seen here. Pay attention to the red areas at top left and bottom right of the movie. Notice how the red buttons (Controller Layers) highlight the different rectangles as it moves up and down their respective y-axes. Each rectangle has a different word written on it. Instead of using an audio file to drive the button, I simply wrote an Expression to wiggle the button along the y-axis. Take a look by clicking on the graphic below.


That's it for now. Have fun and as always, God Bless.
 
###



Roland is a leader in the Adobe After Effects forum at CreativeCow.net.




Visit our forums and view other articles at Creativecow.net if you found this page from a direct link.


  Adobe After Effects Tutorials   •   Adobe After Effects Forum
Reply   Like  


Related Articles / Tutorials:
Adobe After Effects
What's new in After Effects CS6: Shapes from Vector Layers

What's new in After Effects CS6: Shapes from Vector Layers
  Play Video
In this tutorial, Kevin P McAuliffe shows you how, using the great new "Create Shapes from Vector Layers" command in After Effects CS6, you can create 3D extruded client logos in minutes, as opposed to having to wait hours for a 3D application to render it out.

Tutorial, Video Tutorial
Adobe After Effects
AE Basics 44: Shaping Text And Advanced Options

AE Basics 44: Shaping Text And Advanced Options
  Play Video
AE Basics - A Creative COW series for new users of Adobe After Effects. Lesson 44: In this (more advanced) tutorial, Andrew Devis shows the options to change the way text moves through its range and explains how to change this from the default smooth animation to a much more 'digital' or abrupt instant change. Andrew then goes on to demonstrate more of the advanced options in the timeline to 'shape' your text so that it can have a more interesting or dramatic look allowing for the type of animation that would be very difficult to achieve otherwise.

Tutorial, Video Tutorial
Adobe After Effects
Create a Rotating Counter TWO: Adding & Adjusting a Bounce

Create a Rotating Counter TWO: Adding & Adjusting a Bounce
  Play Video
In the second part of this 2 part tutorial, Andrew Devis shows how to animate the rotation of this group of layers as well as how use and adjust an expression that ships with After Effects to have the layers bounce in place as they stop which can give the sense of the counter having some real mechanical properties rather than just a linear of easy-ease keyframe approach.

Tutorial, Video Tutorial
Adobe After Effects
Create a Rotating Counter ONE: Positioning 3D Layers

Create a Rotating Counter ONE: Positioning 3D Layers
  Play Video
In the first part of this 2 part tutorial, Andrew Devis shows how to create and place layers in 3d space such that they can be rotated as a single group to be used for a rotating counter. Andrew shows how to create and place the layers using both the math function of AE as well as a handy and simple expression that places layers a fixed distance or rotation from the previous layer. He then goes on the show how to create and use a controller for the multiple layers so that they act as a single group. In the next tutorial, Andrew will show how to animate the rotation of this group of layers as well as how use and adjust an expression that ships with After Effects to have the layers bounce in place as they stop which can give the sense of the counter having some real mechanical properties rather than just a linear of easy-ease keyframe approach.

Tutorial, Video Tutorial
Adobe After Effects
Confessions of a Creative Maniac: Keys to Getting It In

Confessions of a Creative Maniac: Keys to Getting It In

In the history of computing, including the extension to the notion of what actually falls under the guise of history - let's face it, smartphones are really just diminutive computers in a somewhat flimsy disguise - an often overlooked aspect of the entire discussion is something absolutely core to the idea of how these communications devices interface with us - the venerable keyboard.

Editorial
Adobe After Effects
Introducing After Effects CS6 - Extruded Text and Shapes

Introducing After Effects CS6 - Extruded Text and Shapes
  Play Video
In this introductory tutorial to the new 3D capabilities of After Effects CS6, Kevin P McAuliffe shows the basics of how to extrude text and shapes inside of After Effects CS6, and also shows how tight integration with Adobe's Illustrator will have you creating powerful client logos in minutes, instead of in separate 3D applications.

Tutorial, Video Tutorial
Adobe After Effects
Adobe After Effects: Compositing Actors in Virtual 3D Sets

Adobe After Effects: Compositing Actors in Virtual 3D Sets
  Play Video
Rob Mize follows up his Creating Virtual 3D Sets tutorial with this demonstration of how to composite real-life actors into these 3 dimensional environments. Learn how to create an effective sense of interaction between your actors and their virtual environment using only your green screened footage and AE's 3D capabilities.

Tutorial, Video Tutorial
Adobe After Effects
FreeForm Pro and Aqua Pack: Basic introductory series Part 2

FreeForm Pro and Aqua Pack: Basic introductory series Part 2
  Play Video
The second tutorial from the series describes techniques for manipulating the depth map and texture map that can be used for a logo reveal.

Tutorial, Video Tutorial
Adobe After Effects
Panning Large Scenes Using Target Layers in 3D

Panning Large Scenes Using Target Layers in 3D
  Play Video
In this follow-on tutorial to his short series on working in 3D space, Andrew Devis shows how to use this simple technique to quickly and accurately pan around large layers/compositions to zoom in to the exact point required each time. You'll use target layers to get the exact coordinates needed for accurate panning - simple but effective!

Tutorial, Video Tutorial
Adobe After Effects
FreeForm Pro and Aqua Pack: Basic introductory series Part 1

FreeForm Pro and Aqua Pack: Basic introductory series Part 1
  Play Video
Introductory series (first in a set of three) for simulation of large bodies of water, water environments and water replacement in After Effects using FreeForm Pro from Mettle and the Aqua Pack enhancement pack.

Tutorial, Video Tutorial
MORE


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2012 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]