ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

added specific time to soundkeys expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dzakwan Kurnia
added specific time to soundkeys expression
on Sep 14, 2018 at 4:36:12 pm

Hi everyone, can you help me? how to write timing expression if i want to add specific time

in null object y rotation

i want to make this active at the time 0:04:20:21 - 0:05:04:13 and 0:06:12:06 - 0:06:38:22

minAudio = 7;
maxAudio = 50;
minStretch = 0;
maxStretch = 15;
y1=thisComp.layer("a3").effect("Sound Keys")("Output 1");
y2=thisComp.layer("a3").effect("Sound Keys 2")("Output 1");
yr1 = linear (y1, minAudio, maxAudio, minStretch, maxStretch);
yr2 = linear (y2, minAudio, maxAudio, minStretch, maxStretch);
[yr1+yr2]

and add this active at the time 0:05:04:14 - 0:06:12:05
minAudio = 7;
maxAudio = 50;
minStretch = 0;
maxStretch = 15;
y1=thisComp.layer("a3").effect("Sound Keys")("Output 1");
y2=thisComp.layer("a3").effect("Sound Keys 2")("Output 1");
yr1 = linear (y1, minAudio, maxAudio, minStretch, maxStretch);
yr2 = linear (y2, minAudio, maxAudio, minStretch, maxStretch);
[-yr1+yr2]

please help me sir, and thanks.


Return to posts index

Dan Ebberts
Re: added specific time to soundkeys expression
on Sep 14, 2018 at 6:12:19 pm

I don't have time to set this up and test it (so it might not be exactly right), but I would set it up this way:


tc1 = "0:04:20:21";
tc2 = "0:05:04:13";
tc3 = "0:06:12:06";
tc4 = "0:06:38:22";

function tc2t(tc){
sp = tc.split(":");
return sp[0]*3600 + sp[1]*60 + sp[2] + framesToTime(sp[3]);
}

t1 = tc2t(tc1);
t2 = tc2t(tc2);
t3 = tc2t(tc3);
t4 = tc2t(tc4);

minAudio = 7;
maxAudio = 50;
minStretch = 0;
maxStretch = 15;
y1=thisComp.layer("a3").effect("Sound Keys")("Output 1");
y2=thisComp.layer("a3").effect("Sound Keys 2")("Output 1");
yr1 = linear (y1, minAudio, maxAudio, minStretch, maxStretch);
yr2 = linear (y2, minAudio, maxAudio, minStretch, maxStretch);

if (time < t1){
value;
}else if (time < t2){
yr1 + yr2;
}else if (time < t3){
-yr1 + yr2;
}else if (time < t4){
yr1 + yr2;
}else{
value;
}



Dan



Return to posts index

Dzakwan Kurnia
Re: added specific time to soundkeys expression
on Sep 14, 2018 at 10:46:45 pm

im very thanks sir for your help, ill try this, but if have some error, ill try to fix it, because now i know what i need, thank you so much sir Dan.


Return to posts index


Dan Ebberts
Re: added specific time to soundkeys expression
on Sep 14, 2018 at 11:47:14 pm

I think i messed up the timecode-to-time function. Try it this way instead:


function tc2t(tc){
sp = tc.split(":");
s0 = parseInt(sp[0],10);
s1 = parseInt(sp[1],10);
s2 = parseInt(sp[2],10);
s3 = parseInt(sp[3],10);
return s0*3600 + s1*60 + s2 + framesToTime(s3);
}




Return to posts index

Dzakwan Kurnia
Re: added specific time to soundkeys expression
on Sep 15, 2018 at 9:31:46 am

yeah i got it now :'D enjoy your day sir, and my biggest thanks for you sir.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]