Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking Opacity to Audio On/Off

  • Linking Opacity to Audio On/Off

    Posted by Christian Buettner on June 14, 2008 at 1:24 pm

    Hey guys …

    I´ve searched the forum, but didn´t got the combination right yet. What I want to achive is that layer opacity reacts to audio beats. So if there is beat I want the layer to appear and then fade out at a controlable rate.

    cheers and thanks for any help

    Christian

    Dan Ebberts replied 17 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    June 16, 2008 at 5:49 pm

    Something like this maybe:

    threshold = 10.0;
    decay = 4.0;

    audioLev = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);

    above = false;
    frame = Math.round(time / thisComp.frameDuration);
    while (true){
    t = frame * thisComp.frameDuration;
    if (above){
    if (audioLev.valueAtTime(t) < threshold){ frame++; break; } }else if (audioLev.valueAtTime(t) >= threshold){
    above = true;
    }
    if (frame == 0){
    break;
    }
    frame–
    }
    if (! above){
    t = 0;
    }else{
    t = time – frame * thisComp.frameDuration;
    }

    value/ Math.exp(decay * t)

    Dan

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