PDA

View Full Version : Waveform to image?


XminusOne
12-05-2008, 07:00 PM
Hey Mylenium, (i'm directing it to him as he'll probably answer first, but anyone can feel free to help as well)

I'm using a song for a project, and I want the waveform to be an image in the background. Now, I've used Trapcodes' Sound Keys and that's awesome, but I don't want the waveform animated. I would like ONE long(size wise) image of the entire waveform that I could pan across with camera. Any suggestions?

Thanks in advance!!!

XminusOne
12-05-2008, 07:47 PM
Well, I think i've figured it out. Not sure if it will work yet, but this is the theory. Using Sound Keys, I'll take the output of that, and apply it to a null with "Separate XYZ" applied to it and just apply it to the Y. Then i'll add a solid, with particular applied, then parent the emitter to the null. I'll use an expression to drive the null one pixel per frame in the -x direction. Particular will have settings where the particles will never die and have zero velocity, so basically light writting. The comp width will need to be the same as the comp length(in frames), as determined by the length of the audio. It should give me a black and white image of the waveform. Theoretically. I haven't done it yet, and if something sounds fishy in there, or if there's an easier way of doing it, or if that doesn't make any sense at all, by all means. Let me know. Thanks!!!

suztv
12-08-2008, 06:50 PM
There is an effect in AfterEffects already it's called "Audio Wavefrom" - you don't need soundkeys.

To use it: Create a solid or adjustment layer, select "Effect", "Generate" and then Audio Waveform. From there you can select the audio file that is in your comp, the color and what type of waveform (digital or analog).
And if you want the wave form to hold on 1 frame - precomp the layer, apply time-remapping select a frame that you like, create a key and right-click, toggle hold keyframe and make sure to delete the other keys
That's it.

***EDIT***

If you want to capture the entire wav form - then I think that messing with the samples and length will give you that. Other than that - taking a screen shot of the wave in a sound editing software might give the image that you need.

Sacmanis
12-08-2008, 10:14 PM
I don't believe that is what he is trying to do. That simply does a sound wave like what you would see on the visualizations on Windows Media Player.

He needs the wave to actually trace the song.

I have done an example that I think is what you are looking for. I did two bars, one for hte Treble and one for the Bass. This isn't necessary but I wanted to try it that way.

http://www.youtube.com/watch?v=Iy3U6i_hXAg

Start a new Comp

Drag in your Audio file

Right Click on the Audio file in the timeline and go to Keyframe Assistant/Convert Audio to Key Frames. This will create a null object that is moves with the audio.

In the effects panel, delete the left and right channels. You will only need the
'Both Channels' poriton to continue.

Rename the null object to 'Sound'.

Adjust the position of the null in the Comp to where you want it to start. I put mine at the center of the comp on the X access.

The movement of the null will be fairly limited so you will want to increase its reaction to the audio keyframes. Do this by adding the following expression to the null slider:

linear(value,0,60,0,500) * -1. What this does is look at the current value of the slider and remap it to a higher value. The first 0 is the lowest value that the null reaches, the 60 is the highest value. The second zero says when the slider value is 0 I want the slider value to be 0. The 500 says when the slider value is 60, I want the slider value to be 500. You will have to tweak these numbers to get the best performance. If it looks like the waveform is hitting a plateau at the top of the waveform, adjust the 60 up. You will have to adjust the 500 to keep the waveform on the screen. The *-1 inverts the movement. For whatever reason
the movement is inverted when you first start.

Next add the following expression to the Position of the Null:

SOUND = effect("Both Channels")("Slider");
value +[time*30, SOUND]

The time*30 is what effects the X axis scaling of the waveform. This can be adjusted and I guess it will depend on the height of your waveform. This worked well for me. You will need to keep this in mind as you will be setting the movement of your camera to this same X setting.

Add a new solid. Make it Comp Size and whatever color you want your wavefrom to be. I made mine white.

Add a new effect/simulation/CC Particle World.

I don't have any Trapcode plugins so I have to use native effects.

In the effecfs panel for the CCPW, turn the floor off. Set the birth rate to 100 to start. For a time * 30 motion you will want your longevity to be 15 seconds. If you change the X movement,you will need to change this number so that the particles do not die beofre they are off the screen. However, it actually looks kind of cool if they start to die off before they leave the screen.

Under the producer tab, set all of the settings to 0. You will need to change them all even if they look like 0 to default. Some of them are actually set to small decimals by default which do not show up unitl you click them. Do the same for all of the physics settings.

Change the particle type to Lens Convex.I used .004 as the birth and death size. You will need to adjust these to your taste. .004 seems to be the smallest you can make it.

Set the size variation to 0% and the max opactiy to 100%

Add the Following expression to the X position of the CCPW. Make sure this is on the CCPW and not the solid:

x=thisComp.layer("Sound").transform.position[0]-thisComp.width/2
x/thisComp.width

Add the Following Expression to the Y position of the CCPW:

y=thisComp.layer("Sound").transform.position[1]-thisComp.height/2
y/thisComp.height

I am not even going to try to explain those expressions. It took me hours last night trying to figure out how to convert the proportional position of the PW in a better way and I got close but finally settled on using Andrew Kramer's method.

In the expressions above:

The 'Sound' is the name of hte Null from before

The positon[0] or postion[1] refer to the X postion and Y position respectively.

Make sure the X uses 0 and the y uses 1. Also make sure the x uses width and the y uses height.

Add a new/camera

I set mine to the 35mm preset.

Depending on the size of your comp and the camera you chose, you will have to set the focus point and postion of the camera to move over time. I used a 640 x 480 comp and a 35mm camera so here is the expression I used for both the posistion and the focus point. If you don't move the focus point, the camera will pivot in 3d space and try to keep the center of the Comp as its focus point. This can actually result in a neat effect since the particals are 3D anyway. If you set the movement of the focus point to something less than * 30, you could get the camera to swing around the particles in 3D space. If you played with the settings enough, you could probably make it do a neat 360 around them. Also, even though it happens off screen, the particles decay as they were created so it looks like the particle wave is being eaten from the end.

[320+time*30,240,-622.2]

The starting camera position was 320,240.

That's it. The only difference in what I actually posted is that I did the treble and bass. If you want to it this way. At the very beginning. Add effect/audio/bass and treble effect to the sound file. Change the bass to 100 and the treble to -50 and create the keyframes. Then swap them and create keyframes again. This will create two nulls. Make sure you name them appropriatley and the don't forget to delete the Bass and Treble effect from the audio track before you render.

I did all of this by bashing together a couple of Andrew Kramer's tutorials over on Videocopilot.net.


Hope this helps,

Wade

Sacmanis
12-09-2008, 04:29 PM
I did another example using only one waveform to represent the entire audio track.

This one is much more dynamic so it makes for a much better waveform.

http://www.youtube.com/watch?v=TDpkaZcvTUA

FrostyPanda
12-11-2008, 02:04 AM
There is a cool effect you can create with the Trapcode Particular plug-in. The tutorial is here (http://www.videocopilot.net/tutorials/audio_to_animation/)

thethule
12-21-2008, 09:23 PM
SHAME on you for using that awful version of a classic song.....shame shame shame...

:scream:

FrostyPanda
12-21-2008, 10:24 PM
SHAME on you for using that awful version of a classic song.....shame shame shame...

:scream:

What song? The one in the tut? Not mine...:bounce:

Sacmanis
12-22-2008, 05:31 AM
I actually like that version. :thumbsup: It might be the hotty lesbian Russians.

The best part was the dynamic waveform it created.

Thanks for at least checking it out.

Wade

CGTalk Moderation
12-22-2008, 05:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.