AudioJungle

Synchronizing

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

Hi folks,

I rarely open topic’s regarding After Effects, I tend to solve problems myself. But for this one, I’m really stuck!

Maybe it’s really really stupid and basic stuff, but, believe it or not, I cannot solve it :D

So, here’s my trouble.

I have certain number of nested compositions, in the Main timeline and those nested compositions contain a layer which react’s to audio amplitude null layer which is in the main timeline. Everything’s ok with the first composition starting from frame 1 in main time line, but other nested comps are out of sync with audio.

I have tried couple of silly solution’s, but none of them work.

p.s. I do not want audio amplitude null layer to be in these reacting composition’s, want it to be in main timeline comp.

Hope I was clear enough and you can help me, although maybe it’s very basic as I said.

Thanks :)

p.p.s. Here is the expression for 2 layer’s which react’s to audio:

s=comp("*** Main Timeline Comp ***").layer("Audio Amplitude").effect("Both Channels")("Slider")*3; temp = comp("*** Main Timeline Comp ***").layer("Audio Amplitude").effect("Both Channels")("Slider");[temp,temp]*2;
1000 posts
  • Envato Staff
  • Lead Reviewer
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Beta Tester
  • Has been a member for 5-6 years
+3 more
baf2681 staff says

Silly question but shouldn’t all the comps be the same length and have the same initial start point? They can have different in/out points but the 3 pre-comps you nest should all line up at zero on the timeline. (the little black triangles should all start at zero)

sorry for may lame explanation I’m a terrible teacher :)

B

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

Silly question but shouldn’t all the comps be the same length and have the same initial start point? They can have different in/out points but the 3 pre-comps you nest should all line up at zero on the timeline. (the little black triangles should all start at zero)

sorry for may lame explanation I’m a terrible teacher :)

B

Well, that’s practicly impossible, there are a LOT of layer’s in that comp, including camera movements and stuff like that, and idea is to duplicate several (at least 10-15) comps with the similar settings, and now it would be really hard to move that by hand. If you understand what I mean. :)

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

So? Anyone? :)

4388 posts
  • Elite Author
  • Community Moderator
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips moderator says

Baf’s answer is right. You are using three iterations of the same composition as three different layers in your composition Main_Comp.

So how’s the composition supposed to know which of its iterations’ layer times it’s supposed to be looking at?

If the precomp is 170 frames long and the current time in Main Comp is 114, then as far as the first layer’s concerned the time is 114, as far as the second is concerned it’s -56 and as far as the third is concerned, it’s -226.

You are talking about one precomp with one expression. So I ask the question again, how does it know? Answer: It doesn’t… it just takes the first one that the AE engine comes to i.e. the lowermost one.

You would either need to do as Baf suggests… line them up at 0 and alter the in and out points accordingly. Alternatively, you would need to make duplicate compositions, then write a script which is able to read the layer’s offset.

You could refer to the layer specifically…

var C = comp(“Main Comp”);
var L = C.layer(“a layer”);
var offsetT = L.startTime;
var T = time + offsetT;
var AudioAmp = C.layer(“Audio Amplitude”).effect(“Both Channels”)(1).valueAtTime(T);

alternatively you could use an expression that searches for a layer with this source.

var C = comp(“Main Comp”);
var i = 1;
var L;
while(i <= C.numLayers) {
try {C.layer(i).source}catch(e){i++; continue;}
if(C.layer(i).source.name == thisComp.name) {
L = C.layer(i);
break;
}
i++; }
if(L) {
var offsetT = L.startTime;
var T = time + offsetT;
var AudioAmp = C.layer(“Audio Amplitude”).effect(“Both Channels”)(1).valueAtTime(T);
} else {
value;
}

-f.

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

i’m trying all the variants you wrote felt, on the layer’s property (to be specific, scale property), but i get syntax error on line 1. Maybe i’m not doing it right?

4388 posts
  • Elite Author
  • Community Moderator
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Beta Tester
  • Has been a member for 4-5 years
  • United Kingdom
+5 more
felt_tips moderator says

If you’re copying and pasting out of my post, I suspect there are some illegal characters in there. Wrong kind of line break or something. You’ll probably need to type it in by hand.

-f.

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

but, I see now, it’s best to do like baf told…. I just thought, it would be easier to do this without extra pain. :)

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

If you’re copying and pasting out of my post, I suspect there are some illegal characters in there. You’ll probably need to type it in by hand. -f.

No, except “Main Comp” where I stated full composition name….

p.s. damn man, you have some serious programing knowledge :D

1949 posts
  • Elite Author
  • Community Superstar
  • Has been a member for 2-3 years
  • Sold between 50 000 and 100 000 dollars
  • Author had a File in an Envato Bundle
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a Free File of the Month
+5 more
EFEKT_Studio says

Just for audiance, felt solved my problem, and someone should make a new badge, looking like brain or something like that!

Seriously, felt should have at least forum superstar badge or somet’n!

Thanks mate!

by
by
by
by
by