Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Need Help Using Music to Animate Layers

  • Solie Swan

    June 3, 2007 at 9:15 pm

    Which Adobe tutorial are you referring to? Also as a shot in the dark, you might want to look at a plugin called Sound Keys from Trapcode.com

  • Chris Zwar

    June 3, 2007 at 10:12 pm

    I don’t know what tutorial you’re referring to, but I often animate to music and can give you some pointers.

    The problem is that all music tracks are different, and when you use the “convert audio to keyframes” function the values can vary widely.
    So I always pad my expressions out with the “linear” interpolation function, with a few settings which allow you to fine-tune the results.

    So a simple scale expression might be:
    s = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    s=s*8;
    [s,s]

    But what I tend to do is this:
    s = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    audiomin=5;
    audiomax=40;
    resultmin=0;
    resultmax=100;
    s=linear(s,audiomin,audiomax,resultmin,resultmax);
    [s,s]

    Then what you do is adjust the “audio min” and “audio max” values to suit the music track you’re using, and set the “result min” and “result max” to the smallest and largest values you want to end up with.

    Anyway hope this helps and gives you something to try,

    -Chris

  • Renee Fossler

    June 3, 2007 at 11:30 pm

    Sorry for not specifying which Adobe tutorial I was referring to. It’s the one located at: https://www.adobe.com/ap/tips/aft6audio/

    Chris, I followed your advice and it worked great! The only thing I had to do was substitute the “s” for “temp”

    I don’t know enough about expressions to say why I had to substitute, I’m just glad I was able to figure it out and that it worked.

    I saved the expression as an animation pre-set (I think that’s what I was supposed to do) so I’ll have it handy for future projects.

    I’m fairly new at learning AE so your help is greatly appreciated.

  • Chris Zwar

    June 4, 2007 at 6:54 pm

    Hi,

    Glad you sorted it out.
    When you use expressions, you’re basically writing a small program in JavaScript, so all the basics of computer programming applies, including variables.
    When I’m writing expressions I tend to choose variable names which remind me what I’m doing- x, y & z for co-ordinates, scl for scale, min and max for minimum and maximum values I might be using, etc etc.

    Some words can’t be used as variables, because they’re reserved by After Effects- such as “time”. So I’ll often use t=time when I’m working with time.

    When you use the pick-whip, After Effects automatically uses the variable name “temp”, because it’s a temporary variable. There’s nothing wrong with that, but if you’re doing more complex stuff then it helps to use variables with more appropriate names.

    You can also add comments to remind yourself what you’re doing – anything you type between // is ignored. This is really useful when you devise long complex expressions which may be useful in 6 months time.

    If I look at the example I posted yesterday and tidied it up a bit, a version with more accurate variable names and comments would look like this:

    audkeys = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”); // get music volume from audio keyframes//

    audiomin=5; // set this to the softest values in the music //
    audiomax=40; // set this to the loudest values in the music //
    resultmin=0; // set this to the minimum scale value required //
    resultmax=100; // set this to the maximum scale value required //

    scl=linear(s,audiomin,audiomax,resultmin,resultmax); // interpolate between the audio keyframes and the required range //

    [scl,scl]

    There you go. So the reason you had to change “temp” to “s” (originally) is because After Effects automatically uses “temp” when you pickwhip, and I changed it to “s” as an abbreviation for “scale”. As you can see from above, you can change it to “scl” or almost anything else you like- but not “scale”, because that’s a word reserved by AE.

    Hope this helps,

    -Chris

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