Create a Rhythmic Seismograph in After Effects

Saturday, December 12th, 2009

Using only the tools available in After Effects, you will learn how to create a audio reactive seismograph. Also you will learn to sync it to rhythm of music using a free After Effects preset. There are lots of ways to do this, some requiring lot of scripting. This is the one of the easiest way to do it in After Effects without any third-party plug-ins. But we would like suggest you to use 3D software, if you have one to do such complex motion graphics. It will give you more control and you will finish it much faster than creating it in After Effects. But for now let us start with After Effects.


Preview

Step 1

Create a new composition “Time” of time equal to your audio track. Create a new solid and add two slider controls to it. Name the first one “Time Multiplier” and the second “Output Time”.

Create a Rhythmic Seismograph in After Effects

Step 2

Add this little expression to the “Output Time”. Set the value of Time Multiplier to 20, only for this tutorial. You can adjust it later according to your requirement. To get expression input box hold ALT key and click on the stopwatch icon. You can use pick whip tool instead of typing it.

effect("Time Multiplier")("Slider")*time

Create a Rhythmic Seismograph in After Effects

Step 3

Create a new composition with the name “Paper” and of size 2000*1000.

Create a Rhythmic Seismograph in After Effects

Step 4

Create a white solid “paper” of composition size. Add grid and fractal noise effect to it. Set the values as shown in the screenshot to give it a look of a graph paper. Or you can skip this step by using premade paper texture. Using premade graph paper texture (JPEG, PSD, PNG) you can render it much faster. Fractal noise effect uses lot of CPU power. And you will be duplicating the paper layer many times and to render it, will take lot of time. So it’s better to use premade texture. Just import your image file and add the expression and that’s it. Only see that edges blend with each other. But the best option would be to use a looped video composition of graph paper moving.

Create a Rhythmic Seismograph in After Effects

Create a Rhythmic Seismograph in After Effects

Step 5

Create a new camera and place it below the layer.  Layer->New->Camera

Create a Rhythmic Seismograph in After Effects

Step 6

Select the solid layer “paper” and press P to get the position parameters. Now add this expression to the position.  

temp = (index-1)*2000;

value+(0,0,temp)

Create a Rhythmic Seismograph in After Effects

Now every time you duplicate the layer, the next layer will automatically will be positioned at +2000. 2000 is value of width of this composition. Thinking why duplicate layer and why not create a layer of size you need. Doing it this way gives you flexibility. The length of “paper” depends on the speed at which it is moving and the total time of the audio track. So in case you replace the audio track, you just need to duplicate the “paper” layer to fill the blank space. You will understand it more once we animate the camera. Make sure that the camera layer is placed under the paper layer.

Create a Rhythmic Seismograph in After Effects

Step 7

Select the camera layer and add this expression to the anchor point and position.

x = comp("Time").layer("White Solid 2").effect("Output Time")("Slider");

value+[x, 0,0]

Create a Rhythmic Seismograph in After Effects

Camera will now move from left to right.

Create a Rhythmic Seismograph in After Effects

Step 8

Create a new composition “Graph”. Add the audio track to this composition. You can view the waveform by pressing “LL” on keyboard.  Convert audio to keyframe. This automatically creates a new layer with keyframes of all the audio channels in it.

Create a Rhythmic Seismograph in After Effects

Create a Rhythmic Seismograph in After Effects

Choose “both channels” and add this little expression to slider control. The values depend upon your audio track. Add this expression to the slider

linear(value,5,70,0,150)

It will map the values from 5 to 70 to 0 to 150. You can choose the value according to the amplitude of your audio track. Use graphical keyframe editor to see the values.

Create a Rhythmic Seismograph in After Effects

Create a Rhythmic Seismograph in After Effects

Step 9

Create a new solid with name “Diagram”. The width of the solid should be more than or equal to that of x position of camera in the “paper” composition at the last frame. After that adjust the position so that left side of the solid layer is aligned with left side of composition.

Create a Rhythmic Seismograph in After Effects

Create a Rhythmic Seismograph in After Effects

Step 10

Add an expression to the position of the layer diagram.

p = comp("Time").layer("White Solid 2").effect("Output Time")("Slider")*(-1);

value+[p, 0]

Create a Rhythmic Seismograph in After Effects

Step 11

Add write-on effect to the diagram layer. Set the values as shown in screenshot.

Create a Rhythmic Seismograph in After Effects

Step 12

Add this expression to the brush position of write-on effect.

x = comp("Time").layer("White Solid 2").effect("Output Time")("Slider");

y = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

value+[x, y]

Create a Rhythmic Seismograph in After Effects

Basically this takes time value from the “Output Time” layer and assigns it to X position, while Y position is driven by the audio keyframes. Turn off write-on effect for temporary as it slows down previews.

Create a Rhythmic Seismograph in After Effects

Step 13

Create a new composition “Needle”. Enable grid from view->Show Grid. Create a solid “needle” of the composition size and draw the needle using pen tool. You can also draw a traditional seismograph needle.

Create a Rhythmic Seismograph in After Effects

Create a Rhythmic Seismograph in After Effects

Step 14

Add this expression to position of the layer. Needle will move along Y axis with the write-on brush.

temp = comp("Graph").layer("Diagram").effect("Write-on")("Brush Position")[1];
value+[0, temp]

                  OR

Add this expression to rotation of the layer. It calculates the angle by which the needle has to turn when the write-on brush moves. Though x value changes with respect to time, when you consider x position of all three points at any time, it’s basically same as at time 0. Since only the Y position of brush is changing and not x position and therefore you will have to compensate for the error. In simple needle is performing a circular motion whereas the motion of the brush point is in straight line. It’s totally up to you to use it.

point1=comp("Graph").layer("Diagram").effect("Write-on")("Brush Position")[0],comp("Graph").layer("Diagram").effect("Write-on")("Brush Position")[1];

p2x=comp("Graph").layer("Diagram").effect("Write-on")("Brush Position")[0]-transform.anchorPoint[0];

point2=p2x,transform.anchorPoint[1];

q=396;

l=comp("Graph").layer("Diagram").effect("Write-on")("Brush Position")[1]-q;

pi=Math.PI;

r=length(point1,point2);

c=2*pi*r;

theta=(360*l)/c;

value+(theta)

Create a Rhythmic Seismograph in After Effects

Step 15

Create a new composition with same settings as the previous one. Create a new solid and draw a pointed end of the needle using pen tool.

Create a Rhythmic Seismograph in After Effects

Step 16

Give your needle a nice metallic look using a gradient. Do the same for the tip.

Create a Rhythmic Seismograph in After Effects

Step 17

Create a new composition and add “Paper”, “Graph”, “Needle”, and “Tip” to it. Create a new camera and turn on the 3D switch for all the layers.

Create a Rhythmic Seismograph in After Effects

Step 18

Position the camera and all the layers as shown in the screenshot. Arrange all the composites in 3D space. Place "Tip" below and at end point of the needle. Do not change the size of the needle composition layer from the final composition. Instead change it through “Needle” composition. If you do not you could be out of sync to the moving brush as we have used the expression in that composition.

Create a Rhythmic Seismograph in After Effects

Step 19

After positioning the tip properly in the 3D space, add this expression to its position.

y = comp("Graph").layer("Diagram").effect("Write-on")("Brush Position")[1];

value+[0,y,0]

Create a Rhythmic Seismograph in After Effects

Step 20

Position your camera to get a nice view.  Don’t forget to turn on depth of field of the camera. Add a light source, a background layer and a shadow. Turn on the motion blur switch for “tip” and “needle” layer.

Create a Rhythmic Seismograph in After Effects

Create a Rhythmic Seismograph in After Effects

For Rhythmic Seismograph

The above animation is driven by the sound amplitude much like the real seismograph that captures amplitude of seismic waves (that is you get exact representation of audio waveform). After all seismograph are used to measure the ground vibration and not for sound. But the working principle is the same. Instead of ground vibration we have sound as for the input. If you like to make it react to rhythm or beat then you will need free Spectrum Analysis Preset from Satya Meka or Trapecode Sound Keys Plug-in.

Step 1

For this create a new solid “audio spectrum” and add Audio spectrum preset to it. Set the values as show in the screenshot. The technique is the same even if you use Trapcode sound keys. For this create new solid layer "Audio Spectrum" inside graph composition and the audio spectrum to it. Increase the height and adjust the frequency bands. See the screenshot.

Create a Rhythmic Seismograph in After Effects

Step 2

Create new layer "keyframes" and add the spectrum analysis preset to it. Choose the spectrum layer and watch the spectrum while you can hear the audio (hit NUM 0 key on keyboard). You will see that specific sound have specific frequencies which you can easily choose by moving the box. You will see that the range value changes as there is change in the frequency. And hence you can convert it to keyframes and utilize it for animation.

Create a Rhythmic Seismograph in After Effects

Step 3

After choosing the sounds convert the range value to keyframes. For this select the Final Range value slider and go to Animation->Keyframe Assistant->Covert Expression to Keyframe

Create a Rhythmic Seismograph in After Effects

Step 4

Now all you have to do is use these keyframes instead of previous one to drive your animation. Also linearize the keyframe value to your range, same way as we did before. Once that is done add this expression to the position of write-on effect.

x = comp("Time").layer("White Solid 2").effect("Output Time")("Slider");
y = thisComp.layer("keyframes").effect("Final Range Value")("Slider")
value+[x, y]

Create a Rhythmic Seismograph in After Effects

And with few minor adjustments you are done. And in case you do not want go through all these steps or do not want to waste your time then use the After Effects CS4 Project file.

Project Files

Project file will be up soon.

 

Discussions