Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions added specific time to soundkeys expression

  • added specific time to soundkeys expression

    Posted by Dzakwan Kurnia on September 14, 2018 at 4:36 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.

    Dzakwan Kurnia replied 7 years, 10 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    September 14, 2018 at 6:12 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

  • Dzakwan Kurnia

    September 14, 2018 at 10:46 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.

  • Dan Ebberts

    September 14, 2018 at 11:47 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);
    }

  • Dzakwan Kurnia

    September 15, 2018 at 9:31 am

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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy