Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions using the expression if/else

  • using the expression if/else

    Posted by Bert Beltran on November 29, 2011 at 7:46 pm

    I have an image that I animated were the lights in the image light up. I want to sync the intensity of the lights to music. I know that you need to convert the audio to keyframes and parent the intensity settings to the audio keyframes. But what my issue is that some of the keyframes in the audio go over the limit that I want it to go. For example I want to keep the light intensity no higher than 8% but there are keyframes in the audio that go over that. What ends up happening is that the light goes over exposed to much and it doesn’t look realistic. Here is what the expression looks like when I parent the light intensity to the audio

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

    I know that you can add a negative number like so

    thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”)-2

    But what ends up happening is that it effects all the key frames so the key frames that are at 2% end up being 0% and it throws off the motion.

    I just need help with writing an expression that tells Ae that if there is a key frame that goes over 8% to keep it at 8% and anything else that is below 8% to keep the same as the audio keyframes.
    Hopefully the way I explained this makes sense.

    Muchos Thank You’s

    Dan Ebberts
    replied 14 years, 5 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    November 29, 2011 at 8:24 pm

    Try this:

    Math.min(thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”),8)

    Dan

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