Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Convert audio to keyframes then select all those below a given value ?

  • Convert audio to keyframes then select all those below a given value ?

    Posted by Peter Dexter on March 10, 2014 at 9:50 pm

    HI
    Just wondering here if there was a method by which one could select keyframes of a property by their value.
    Similar to selecting ‘of equal value’ but instead to select all keyframes below lets say a value of 20.
    I am looking to use ‘Audio to keyframes’ and then tweak my resulting keyframes.
    The returned values are all rather close.. from around 14 – 29 and each is different 29.1342 or 29.1346 so so it would be nice to create an on and off type result using those key frames. I know sound keys does something similar but just wondered if there was a way to ‘cheat’ that in AE.
    To sum up. I want to be able to change all the keyframe values that are higher than 20 to a chosen value and all those above 20 to another chosen value.
    Hope that makes sense and thanks in advance for any help 🙂

    We spent all the budget on doughnuts and now we have no money to make our film.

    Roland R. kahlenberg replied 12 years, 4 months ago 3 Members · 6 Replies
  • 6 Replies
  • Walter Soyka

    March 11, 2014 at 12:03 am

    This is very easy with an expression.

    Alt-click the stopwatch for the property with the keyframes (such as Both Channels) and enter the following expression:

    if (value > 20) 100 else 0;

    Walter Soyka
    Principal & Designer at Keen Live
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    RenderBreak Blog – What I’m thinking when my workstation’s thinking
    Creative Cow Forum Host: Live & Stage Events

  • Peter Dexter

    March 11, 2014 at 8:54 am

    Thanks a lot. It is indeed simple and elegant.
    Thanks

    We spent all the budget on doughnuts and now we have no money to make our film.

  • Peter Dexter

    March 11, 2014 at 9:24 am

    Thanks again that is great. Just one little thing. I used action script 2 years ago quite a bit so it is all rather vague these days. I am sure that I can use that little snippet and tweak it.

    I want to use it with a slider and an existing expression.

    I have this on my slider: effect(“Both Channels”)(1)
    and this on my opacity property: thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”)

    If you had an example how to integrate the: If (value > 20) 100 else 0:
    In either of those lines it would be great.

    Also to extend the if else so that: if greater than twenty but less than twenty five 100 if greater than 25 80 else 0

    That would make my day. I think I could roll from there and then find a good basic expressions page somewhere to embeish.

    Expressions are addictive 🙂

    We spent all the budget on doughnuts and now we have no money to make our film.

  • Roland R. kahlenberg

    March 11, 2014 at 10:02 am

    This should do it –

    propVal = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

    if (propVal > 25) {
    80
    } else if (propVal > 20 && propVal < 25) {
    100
    } else {
    0
    }

    I’ve found this URL a good resource for Javascript Conditionals – https://stackoverflow.com/questions/253030/best-way-to-format-if-statement-with-multiple-conditions.

    https://www.w3schools.com/ is also good.

    HTH
    RoRK
    Latest AE Workshop – MoGraph Intensity – Shapes & Text

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations

    Imagineer Systems (mocha) Certified Instructor
    & Adobe After Effects CS6 ACE/ACI

  • Peter Dexter

    March 11, 2014 at 9:41 pm

    Thanks very much.
    I will for sure make a visit to the site mentioned

    We spent all the budget on doughnuts and now we have no money to make our film.

  • Roland R. kahlenberg

    March 12, 2014 at 12:27 am

    I’ve just realized that there is an issue with the script if the referenced value is at exactly 25. Currently, a value of 25, for the referenced property, will result in an opacity value of 0.

    If that is not intended behavior, then add an = sign to either one of the two explicit conditionals in the script – something like this:

    if (propVal >= 25) OR
    (propVal > 20 && propVal <= 25)

    HTH
    RoRK
    Latest AE Workshop – MoGraph Intensity – Shapes & Text

    Intensive mocha & AE Training in Singapore and Other Dangerous Locations

    Imagineer Systems (mocha) Certified Instructor
    & Adobe After Effects CS6 ACE/ACI

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