Skip to main content
Known Participant
October 29, 2018
Question

Create a path (audio wave) from audio file

  • October 29, 2018
  • 2 replies
  • 3976 views

Hello everyone,

I'm struggling with a (probably) very simple problem in AE.

Basically, I have an audio file from which I'd like to generate a path, according to the audio waves.

Let me explain what I have in my mind: I have a podcast audio file from which I'd like to generate audio waves that "draw" themselves, just like this but without the particular effect (I just want a very simple white line): https://videohive.net/item/audio-particle-intro/1145173

As far as I know, the audio spectrum/waves effects are only applied on a solid on which the entire audio frequencies are spread (linear, circular...). But what I want is a "progressive" audio spectrum, kind of an EKC (see the link).

I didn't manage to recreate what's on the link above, so I thought about a more simple solution: importing my mp3, generating audio waves for the full audio file, then convert these into a path, and finally use the Trim Path content effect.

The only thing is that I didn't find any solution to generate a path from audio waves... do you have any idea how to?

Thank you very much in advance, any help would be welcome!

Best.

This topic has been closed for replies.

2 replies

Community Expert
October 30, 2018

You can start with Animation>Keyframe Assistant>Convert Audio to Keyframes.

When you get that done you will have a new layer with three animated sliders. Most of the time you can delete all but Both Channels. Look at the graph editor and choose Value Graph and you will see the minimum and maximum values that the conversion has generated. Make note of the valeus. Let's say just for argument that they are between .1 and 3. You'll have to check for your own values.

The next step is to attach those values to the position value of a null so you can generate a motion path. You can control the distance the path moves in Y using an expression like this:

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

y = linear(t, .1, 3, 0, 800);

[value[0], value[1] - y]

If you apply this expression to the position property of a null you will get a motion path that moves the Y position up 800 pixels every time the Audio Amplitude Both Channels slider value gets to 3.

That null can do all kinds of things. The example you showed used a particle system and attached the null to the position. The particle layer was also moving and the motion of the emitter was also modified by time. To keep the emitter in the center you apply the same expression to the anchor point of the particle layer.

For example, if you used CC particle world to generate the particles you would use this expression on the anchor point for that layer:

[value[0] + (time /thisComp.frameDuration), value[1]]

You would apply this expression to the null's position layer:

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

y = linear(t, .1, 3, 0, 800);

[value[0] + (time /thisComp.frameDuration), value[1] - y]

And you would tie the emitter position to the null using the pickwhip to generate this expression:

thisComp.layer("Null 1").position

The last step is to adjust the particle life, gravity, lifespan and look until you get the look you want.

Did you follow that? It's kind of complicated, but that's how I would do it. Once you get the null to move with the audio the rest is pretty easy. You can use the motion of the null to animate a path using the new Create Paths from Nulls script. 

Known Participant
October 30, 2018

Hello Rick and thank you very much for your detailed answer,

Thanks to you, I managed to have the null moving according to the audio.

However, I couldn't find any "create path from nulls" script, only "create nulls from paths".

Do you know where I can find this?

Because at the moment all I was able to do is linking a shape to the null. It does move according to the sound, but only from top to bottom (I can't figure out how to create a ligne that will curve and keep drawing itself, just like an EKC).

I hope I'm clear enough about what I'm trying to achieve

Thanks Rick!

Mike_Abbott
Legend
October 29, 2018

I think you can get what you want using the Generate > Audio Waveform effect.