Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Trigger sound effects

  • Trigger sound effects

    Posted by Marcelo Cabral on October 3, 2017 at 3:15 pm

    Hi. I found an expression in one of the Dan posts and it works perfectly if I use the sound layer marks. But I don’t know how to make it work with the “PLAY” layer marks.

    Thank you in advance.

    len = thisLayer.source.duration;
    if(marker.numKeys > 0){
    m = marker.nearestKey(time).index;
    if(marker.key(m).time > time) m--;
    if(m > 0){
    mt = marker.key(m).time;
    if(time < mt+len){
    linear(time, mt, mt+len, 0, len);
    }else 0
    }else 0
    } else value;

    Dan Ebberts replied 8 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    October 3, 2017 at 4:36 pm

    This should work:


    len = thisLayer.source.duration;
    m = thisComp.layer("PLAY").marker;
    val = value;
    if(m.numKeys > 0){
    val = 0;
    n = m.nearestKey(time).index;
    if(m.key(n).time > time) n--;
    if(n > 0){
    mt = m.key(n).time;
    if(time < mt+len){
    val = linear(time, mt, mt+len, 0, len);
    }
    }
    }
    val

    Dan

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