Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on Twitter
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
Virtual 3D Sets with After Effects

Virtual 3D Sets with After Effects
  Play Video
Rob Mize demonstrates techniques for creating a virtual set in 3D space. He shows how you can build sophisticated, detailed environments, where your actors appear to interact with their 3 dimensional surroundings. Build the set of your dreams using nothing more than After Effects, a few textures and your creativity.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: The Tilt Shift Effect

Lite Bite for After Effects: The Tilt Shift Effect
  Play Video
In this tutorial, Martin Ainsworth will demonstrate the "Tilt Shift" effect also known as "Toy Town Look" using Abobe After Effect. This simple yet very power technique can add an extra dimension to an opening introduction.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: How do I use 8 or 16 bpc effects on 16 or 32 pbc projects?

Lite Bite for After Effects: How do I use 8 or 16 bpc effects on 16 or 32 pbc projects?
  Play Video
"Lite Bites" are short no-frills tutorials giving quick answers for busy people. In this next AE Lite Bite tutorial, Andrew Devis shows how to use 8 or 16 bpc effects safely on 16 or 32 bpc projects.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: How do I animate Text on a Path?

Lite Bite for After Effects: How do I animate Text on a Path?
  Play Video
"Lite Bites" are short no-frills tutorials giving quick answers for busy people. In this next AE Lite Bite tutorial, Andrew Devis shows how to quickly and easily animate text on a path.

Tutorial, Video Tutorial
Adobe After Effects
You Ask....I Answer: Masking vs Track Matting Part 2: Adobe After Effects

You Ask....I Answer: Masking vs Track Matting Part 2: Adobe After Effects
  Play Video
In this tutorial, Kevin P McAuliffe takes a look at doing the same viewer requested track matting technique he showed in Motion 5, but the time he demonstrates the technique inside of Adobe After Effects.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: How do I create a simple Light Wrap?

Lite Bite for After Effects: How do I create a simple Light Wrap?
  Play Video
"Lite Bites" are short no-frills tutorials giving quick answers for busy people. In this first AE Lite Bite tutorial, Andrew Devis shows how to make a quick 'light wrap' effect for a keyed item so that the edge or alpha channel of the keyed item includes some of the pixels from the background element so that it starts to look as if the two items really belong together.

Tutorial, Video Tutorial
Adobe After Effects
Weißabgleich nachträglich ändern ein Quicktip in Adobe After Effects

Weißabgleich nachträglich ändern ein Quicktip in Adobe After Effects
  Play Video
Weißabgleich nachträglich ändern ein Quicktip in Adobe After Effects von Lucas Pfaff: lernen die Grundlagen der Weißabgleich.

Tutorial, Video Tutorial
Adobe After Effects
Using the Scribble & Stroke Effects

Using the Scribble & Stroke Effects
  Play Video
The "Scribble" and the "Stroke" effects are often overlooked due to the fact that it isn't immediately obvious how they work as they won't work unless applied in a very particular way. In this in-depth tutorial, Andrew Devis explains how to apply these effects and then goes through the many options in each effect which can make them very powerful and able to produce a surprisingly large variety of results.

Tutorial, Video Tutorial
Adobe After Effects
Character Design and Animation in AE: Part One

Character Design and Animation in AE: Part One
  Play Video
Rob Mize demonstrates the process of designing, creating and animating a character entirely in After Effects. Part 1 focuses on the design and creation of the character using nothing more than AE shapes.

Tutorial, Video Tutorial
Adobe After Effects
Adobe Creative Cloud Offers Applications, Services, Community

Adobe Creative Cloud Offers Applications, Services, Community

With Creative Cloud, Adobe is switching from a model of software as a product to Software as a Service (SaS). By early 2012, Adobe Creative Cloud is expected to include such applications as After Effects, Premiere and Photoshop. Creative Cloud includes a hub for viewing, sharing and syncing of files, and a subscription with 20GB of cloud storage.

Feature, People / Interview
MORE


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

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

[Top]