To rhythm a video according to a sound

Moderators: Disciple, zlovatt

oscarus
Posts: 9
Joined: July 12th, 2004, 4:35 pm
Location: Paris
Contact:

February 14th, 2005, 1:45 pm

This expression allows you to manipulate time remapping on video layers in accordance with audio layers (fast-forward/freeze frame/rewind/...)

You might need to tweak the sound a little so that it contains clear frequency amplitudes.

Here is how to use it :

First of all convert the audio to kyeframes : Animation>keyframe assistant>Convert audio to keyframes. You get an "Audio Amplitude" layer. The expression only takes into account the keyframes of the "Both channels" stream, so you can consequently delete the "Left" and "Right" channel streams.

Next step is to apply three times the "Slider Control" effect to the Video layer you want to affect. Name them : "frequence min", "frequence max" and "frames"
(you can also use custom names, but correct them accordingly in the expression code).

Finally, apply the expression to the "Time remapping" property of the video layer.

Here two examples :

http://oscarvideo.free.fr/remap_ar.mov
http://oscarvideo.free.fr/remap_av.mov

and here is the expression :

Code: Select all

t=timeToFrames(inPoint);i=0; 
while(timeToFrames()>=t) 
{ 
min=effect("frequence min")(1).valueAtTime(framesToTime(t));max=effect("frequence max")(1).valueAtTime(framesToTime(t));a=effect("frames")(1).valueAtTime(framesToTime(t)); 
f=thisComp.layer("Amplitude audio").effect("Les deux couches")("Curseur").valueAtTime(framesToTime(t)); 
if(f>=min && f<=max){i+=1-a} 
t++; 
} 
timeRemap.valueAtTime(time-framesToTime(i))
jonnyquest45
Posts: 5
Joined: February 20th, 2005, 3:42 pm

February 21st, 2005, 8:14 am

effect("Les deux couches")
im a bit confused abut the above line
i know it means two layers
but what effect is this refering too.
Shinjipierre
Posts: 36
Joined: December 4th, 2004, 10:10 am

February 21st, 2005, 10:58 am

eheh, Thta's because he's using the french version of after effects.

One should careful when coding script :p

English scripts work for all languages, but ther languages only work on their own version ^^.

"Les 2 couches" = "Both channels"

("Curseur") won't work either ^^.
jonnyquest45
Posts: 5
Joined: February 20th, 2005, 3:42 pm

February 21st, 2005, 1:13 pm

Shinjipierre wrote:
("Curseur") won't work either ^^.
and just to be a total non french speaking person
what word should i use in this case
Shinjipierre
Posts: 36
Joined: December 4th, 2004, 10:10 am

February 21st, 2005, 3:48 pm

Hummm, I've tried your expression... I don't really know how I should configure the 3 sliders, if you could tell us a bit more ...
oscarus
Posts: 9
Joined: July 12th, 2004, 4:35 pm
Location: Paris
Contact:

February 23rd, 2005, 5:55 am

Hello jonnyquest45 and Shinjipierre !

Here the expression for the English version :

Code :

t=timeToFrames(inPoint);i=0;
while(timeToFrames()>=t)
{
min=effect("frequence min")(1).valueAtTime(framesToTime(t));max=effect("frequence max")(1).valueAtTime(framesToTime(t));a=effect("frames")(1).valueAtTime(framesToTime(t));
f=thisComp.layer("Audio Amplitude").effect("Both Channels")(1).valueAtTime(framesToTime(t));
if(f>=min && f<=max){i+=1-a}
t++;
}
timeRemap.valueAtTime(time-framesToTime(i))


Oscar.
jonnyquest45
Posts: 5
Joined: February 20th, 2005, 3:42 pm

February 23rd, 2005, 8:40 am

that is freaking sweet. i can think of a million difrent ways to use this
jonnyquest45
Posts: 5
Joined: February 20th, 2005, 3:42 pm

February 26th, 2005, 9:05 am

if i wanted this to effect lets say rotation
i would change the part about time remap to rotation?
sorry im new to the whole concept of expressions.
Lasvideo
Posts: 2
Joined: January 5th, 2005, 8:04 pm
Location: Las Vegas

February 26th, 2005, 1:40 pm

By adding "-100 to 100" as the range for the frames slider, I can get it to reverse direction. Can anybody modify the expression to utilize the 3 outputs from Sound Keys? I tried the obvious and didnt meet with success.
martin
Posts: 1
Joined: March 4th, 2005, 7:45 am

March 4th, 2005, 8:54 am

That's such a pretty cool effect.
But I can't get it to work.
Is there a step by step tutorial?

I made everything like oscarus said.

But the Movie is just jumping fast and is not playing und jumping back & foward etc.,
Do I need a single audio and video or can a take the aufio out of the video track?

do I have to change the frequence min, - max and frames. How does it know , which frequence it should take, for example the bass drum.

Thank you guys.

Cheers

Martin
jonnyquest45
Posts: 5
Joined: February 20th, 2005, 3:42 pm

March 4th, 2005, 8:56 am

you have to set the feq max and min use the slideers you pu on the video layer. make sure your min is less then you max.
then you need to set the frames. to get it to jump back set a negitive number i like 3 frames to 5 frames for most stuff.
pseudojag
Posts: 2
Joined: February 25th, 2005, 11:08 pm

March 4th, 2005, 10:12 am

Can anyone please explain how to modify the above expression so that the video moves forwards slowly and then jumps ahead on the specified frequencies. Just like here…

http://www.geocities.com/pseudojag/rhythmfly.mov

Thanks for any help you guys can give me


-Phil
ranjha
Posts: 1
Joined: February 28th, 2005, 3:43 am

March 4th, 2005, 11:14 am

Hi,

if you have trapcodes soundkeys, check out this thread at creativecow, it does exactly what you want.

http://www.creativecow.net/forum/read_p ... ght=ranjha

Ranjha.
pseudojag
Posts: 2
Joined: February 25th, 2005, 11:08 pm

March 4th, 2005, 11:40 am

Dear Ranjha,

Thanks for the link. I have Soundkeys… but could you be more specific with settings…? I tried Dan Ebbert's Sound Keys settings but all I get is a still frame of video. Maybe you could post your settings (what layer was linked to which expression, etc… for clarity's sake).

Thanks for your help

-Phil
Lasvideo
Posts: 2
Joined: January 5th, 2005, 8:04 pm
Location: Las Vegas

March 4th, 2005, 7:01 pm

Hey, to whoever applied for a patent relating to sound controling motion... I'd love to buy your softeware. I encourage you to market it, many people would bury you in sales Im sure!
Post Reply