Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Targeting opacity with audio levels

  • Targeting opacity with audio levels

    Posted by Liam King on August 1, 2011 at 11:16 am

    Hi all,

    I’m currently working on a project with a very short deadline and need help targeting the opacity of some layers with the audio levels.

    I have converted audio to keyframes, grappled the opacity of the layer to th “Both Channels” Slider.

    What I’m creating is basically an equalizer, so there are different panels that move in accordance to the level of audio.

    These panels are made up of seperate cubes (pngs’) on seperate layers, and I need to tell after effects to make to opacity of each layer either 100 or 0 when the audio reaches a certain level.

    this is wht I have written out so far, but it’s not working.

    thisComp.layer(“AudioTreble”).effect(“Both Channels”)(“Slider”);
    if (“AudioTreble” >50) 100 else 0

    this is in the opacity of the layer i need to effect, and the audio layer is called “AudioTreble”.

    Any help will be gratefully appreciated!

    Thanks,
    Liam

    Roland R. kahlenberg replied 15 years ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 1, 2011 at 1:11 pm

    Try it this way:


    a = thisComp.layer("AudioTreble").effect("Both Channels")("Slider");
    if (a > 50) 100 else 0

    Dan

  • Liam King

    August 1, 2011 at 2:13 pm

    That works perfectly! I see what I was doing wrong now, don’t think I was targeting it properly!

    Thanks so much Dan! This is awesome!

    Liam

  • Roland R. kahlenberg

    August 1, 2011 at 2:23 pm

    You used a variable, “Audio Treble” without first declaring it as a variable.

    Your first line, if written as follows;
    AudioTreble=thisComp.layer(“AudioTreble”).effect(“Both Channels”)(“Slider”);

    would indeed declare AudioTreble as a variable. Thus allowing your second line and the entire Expression to work correctly. Take note that variables aren’t allowed to have spaces.

    HTH
    RoRK

    Intensive AE & Mocha Training in Asia.

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