Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Queue Video or Animation Based on Audio

  • Dan Ebberts

    December 4, 2015 at 11:38 pm

    The basic idea is explained here:

    https://www.motionscript.com/design-guide/audio-trigger.html

    Assuming you converted your audio to keyframes and your animation is in a time remapped layer, this time remap expression should be close to what you need:

    threshold = 10.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;
    }
    t

    Dan

  • Kurt Barken

    December 4, 2015 at 11:41 pm

    That should do the trick! Thanks for the help!

  • Kurt Barken

    December 5, 2015 at 12:01 am

    Your expression worked good, but is there any way to accomplish this through Trapcode Sound Keys?

  • Dan Ebberts

    December 5, 2015 at 12:14 am

    Do you mean using just Sound Keys? I don’t think so.

    If you mean using the expression with Sound Keys, I think all you would have to do is change the second line to something like this:

    audioLev = thisComp.layer(“Black Solid 1”).effect(“Sound Keys”)(“Output 1”);

    and maybe adjust the threshold value in the first line, depending on how you have your Sound Keys output set up.

    Dan

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