Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Make a sine wave react to an audio track

  • Make a sine wave react to an audio track

  • Daniel Griffin

    April 30, 2021 at 11:35 pm

    Hello my friends. I am trying to make an effect that will make these sine waves react to and audio track. Any ideas how this can be accomplished? The default plugins that come with After Effects don’t have this kind of lines. Thank you for your help.

  • Kevin Camp

    May 1, 2021 at 12:46 am

    Try this:

    Create a new comp, add your audio source, right-click the audio layer and choose Keyframe Assistant>Audio to Keyframes and twirl down the layer properties to see the audio keyframes, then create a long skinny solid (like comp-width and 5 pixels high).

    Add the Repetile effect and set the top and bottom values to a high value, maybe 200 or more and set the Tiling to ‘none’ (this will expand the layer vertically, you won’t see anything but it will help with the next part).

    Now add Wave Warp to the solid (after Repetile), add an expression to the Wave Height property then click-hold the expression pickwhip and drag it to the audio keyframes for Both Channels on the audio keyframe layer you created earlier and add “* value” to the end of the expression. You expression should look something like this:

    thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider") * value

    Position the CTI (current time indicator) at a point where you can hear the audio, then scrub the Wave Height property until you see a wave height that seems good.

    Preview it and make adjustments to the Wave Height as needed.

    If you want the wave tapered at the ends (like your example), try setting the Pinning to ‘Vertical Edges’.

    — EDIT —

    I should have also added if the wave is getting clipped just increase the Expand Up and Expand Down values for Repetile.

  • Daniel Griffin

    May 3, 2021 at 3:44 pm

    Thank you very much for your help Kevin. It works sort of, but the problem is that the waves are uniform in height and the kind of wave I am trying to achieve, if you see the previous drawing, it’s not , I think that it is because the script is working with volume and not the audio frequency like in the effects that come with After Effects.

  • Kevin Camp

    May 3, 2021 at 6:49 pm

    That is correct, it can only look at the audio level and cannot identify/separate frequencies. It was the closest solution I could think of to visually match your example, particularly with the tapered ends.

    I was thinking that you might be able to combine a couple more lines, linking linking each to a different audio levels output — if you add the bass & treble effect to the audio layer, adjusting the bass up & treble down, and then the reverse, you will get different levels based on the frequency change of the bass & treble effect and create something that was somewhat close to what you are looking for and interesting visually.

  • Daniel Griffin

    May 3, 2021 at 8:48 pm

    Yes, that may get me closer. I will to continue experimenting. Thank you very much for your help Kevin. I appreciate it.

  • Kevin Camp

    May 3, 2021 at 11:52 pm

    I was able to make something closer. I found that if you create a bunch of black and white vertical lines, blur them and use that as a displacement map on a line, it creates a sine wave.

    Then I did Bass & Treble trick to create 3 different audio level keyframe sets and use that to drive opacities of 3 layers that overlap the blurred vertical lines and created a sine wave that has some variance in amplitude across the waveform.

    I’ve attached the zip here. To use your own audio you would just need to convert your audio to keyframes 3x (using the bass/treble trick) and name the audio level layers as they are in the ‘disp map’ comp and delete the ones in there now.

    This set would be improved if you had a better way to separate frequencies. Trapcode/Red Giant had (and probably still does have) an effect called SoundKeys that gave more control over frequencies and that might help a lot here.

  • Daniel Griffin

    May 4, 2021 at 2:02 am

    Yes this is a bit better. Thank you for taking the time to make these tests. Unfortunately it has to be much closer to the design they gave me. Will take a look at Sound Keys, maybe I can get closer to what they want.

  • Kevin Camp

    May 5, 2021 at 6:12 pm

    Hi Daniel, I had a bit of time this morning to learn about a newish expression addition that Adobe made in 2018 that allows us to access mask/shape points (something I had wanted to do for a while, but never had the need)

    It seemed that using a shape layer would be the best way to achieve a smooth sine wave, and having a way to link nulls to shape layer points would be a better way to go rather than trying to control a displacement map.

    Here is a basic comp that uses 16 nulls to create a path on a shape layer. If you are able to find a way to convert more frequencies to keyframes (or values of some kind), I think you could use that to drive the y-positions of the nulls and create the wave animation that way.

    If needed, you can adjust the curve tangents with point controls on the shape layer.

  • Daniel Griffin

    May 5, 2021 at 11:38 pm

    Hi Kevin. Thanks for sending this test. I think it could work and get me closer to the result I am looking for. I’ll make some tests and see what I can do. Thank you very much!

Viewing 1 - 9 of 9 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy