Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions adding falloff to an expression

  • Dan Ebberts

    July 17, 2007 at 12:59 pm

    Play around with this:

    decayTime = 1; // decay time (seconds)
    mult = 5;
    audLev = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);

    k = 4.605/decayTime;
    currFrame = Math.round(time/thisComp.frameDuration);
    decayFrames = Math.round(decayTime/thisComp.frameDuration);
    sampleFrame = Math.max(0, currFrame – decayFrames);
    decayTime = 0;
    curMax = 0;

    while (sampleFrame <= currFrame){ sampleVal = audLev.valueAtTime(sampleFrame * thisComp.frameDuration) * mult; curVal = curMax/ Math.exp(decayTime * k); if (sampleVal >= curVal){
    curMax = sampleVal;
    decayTime = 0;
    }else{
    decayTime += thisComp.frameDuration;
    }
    sampleFrame++;
    }
    curVal

    Dan

  • Michael Duff

    July 18, 2007 at 2:29 am

    thanks Dan! I’ll study through that when I have a big coffee ….. in the meantime I have another, hopefully much simpler, question …

    i just want to grab the Y-position of a layer but at a different point in time .. so something like transform.position[1].valueAtTime(time-1)

    does that makes sense?

    thanks!

  • Dan Ebberts

    July 18, 2007 at 2:57 am

    Sure, but it would be like this:

    transform.position.valueAtTime(time-1)[1]

    Dan

  • Michael Duff

    July 18, 2007 at 3:31 am

    thanks! i knew it would be something simple like that …

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