Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE Amplitude Expression ease timing

  • AE Amplitude Expression ease timing

    Posted by John Dessin on August 18, 2024 at 12:17 am

    Hello cows,

    am new to this forum so i try to be specific as possible to save everbodys time:

    I have a click sound, that translates into very clear keyframes with values between 10 and 20 at a click and I want to my graphic to be 10px further up everytime a click/keyframe value occurs

    BUT

    I need the animation to be linear but smooth starting and ending just halfway between the clicks so the next animation can start just in time. The clicks are not unison but vary in clicks per minute.

     

    I already tried

    ease(value, 11, 20, 0, 10)

    smooth(width=0.1, samples=50)

    smooth goes into the right direction but I cant change it to be precise where i need the animation to start and end and to be at 10 exact at the click.

     

    Could somebody please point me into the right direction or am i missing something?

    THANKS!

    Dan Ebberts replied 3 weeks ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    August 18, 2024 at 12:34 am

    It will probably look something like this:

    // count previous beats
    threshold = 10.0;
    moveAmt = [0,-10];
    audioLev = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    above = false;
    frame = timeToFrames(time);
    n = 0;
    fSave = 0;
    while (frame >= 0){
    t = framesToTime(frame);
    if (above){
    if (audioLev.valueAtTime(t) < threshold){
    above = false;
    }
    }else if (audioLev.valueAtTime(t) >= threshold){
    if (fSave == 0) fSave = frame;
    above = true;
    n++;
    }
    frame--
    }
    // find the next beat
    frame = Math.round(time / thisComp.frameDuration) + 1;
    above = audioLev.value > threshold
    while(framesToTime(frame) < thisComp.duration){
    t = framesToTime(frame);
    if (above){
    if (audioLev.valueAtTime(t) < threshold){
    above = false;
    }
    }else if (audioLev.valueAtTime(t) >= threshold){
    break;
    }
    frame++;
    }
    dt = time - framesToTime(fSave);
    tTot = framesToTime(frame - fSave);
    value + n*moveAmt + linear(dt,0,tTot,[0,0],moveAmt)

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