Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression help, incrementing a variable in an expression ???

  • Expression help, incrementing a variable in an expression ???

    Posted by Jesse Lucas on June 10, 2005 at 1:36 pm

    Hi all.
    I’m trying to make a movie play only when the soundtrack level reaches a certain value and then pause until the audio goes up again. So on the audio side no problem. I’ve got the sound level converted to keyframes. But of course I can’t directly access the speed of the movie in AE expressions (would be easy : if (sound level > thresold) speed = 1 else speed =0 ). So I’ve got to get the same effect with timeRemap. But to do so I need to increment the timeRemap value when the sound is bigger than the treshold. And keep the current timeRemap value to simulate a pause in the movie. But I can’t seem to increment a variable in AE expression to get this effect. Is it possible ? Any other ideas to achieve this effects ? Thx very much

    Dan Ebberts
    replied 19 years, 8 months ago
    3 Members · 2 Replies
  • 2 Replies
  • Mylenium

    June 10, 2005 at 4:03 pm

    What are you using so far? Normally a while() loop with a min and max range compared to time should take care of that. Not really sure what you’re trying to achieve. BTW, you could calculate the speed, but that’s even more complex than trying other methods ;o).

    Mylenium

    [Pour Myl

  • Dan Ebberts

    June 10, 2005 at 8:40 pm

    Try something like this:

    
    threshold = 10;
    audio = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    
    f = Math.round(time/thisComp.frameDuration);
    frameCount = 0;
    for (i = 0; i <= f; i++){
      if(audio.valueAtTime(i*thisComp.frameDuration) > threshold) frameCount++;
    }
    frameCount*thisComp.frameDuration
    
    

    It will bog down if your comp is too long.

    In that case you might want to consider using a script.

    Dan

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