Skip to main content
Inspiring
June 27, 2017
Answered

opacity of an image 0 or 100 tied to voice volume keyframes?

  • June 27, 2017
  • 1 reply
  • 4611 views

This is probably going to be stupidly easy, but I'm relatively new to AE, and I'm stumped.

So what I'm trying to do is make a little speaker symbol (similar to what you see in your taskbar) that reacts to audio.
For the quieter stuff, only one bar becomes visible, and for the louder/max stuff two/all three become visible.

And I mostly have it. But the different bars have a range of opacity. I just want them on/off within that range.

For example, the opacity of this .png is pick-whipped to a slider on the audio track. The slider has this expression on it: linear(value,2.6,4.9,0,100)

Works pretty good, but the opacity needs to be an on/off kind of thing, and not a 0-100% kind of thing.

Here's a screenshot:

Imgur: The most awesome images on the Internet

I've been trying to learn some if/then expressions, some checkbox stuff, and some 0 else 100 stuff... but correctly implementing any of them for this specific task has, so far, been unsuccessful.

Thank you for your help.

Message was edited by: derick white, typos

This topic has been closed for replies.
Correct answer Henrique -- TMMW

You can keep the line breaks there.

Paste it into the opacity property.

In this line you link to the both channels slider:

slider = effect("Slider Control")("Slider"); //LINK TO SLIDER

you final expression should look like this:

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

min = 2.6; // MINIMUM VALUE

max = 4.9; // MAXIMUM VALUE

if(slider>min && slider<max){

100

}else{

0

}

1 reply

Henrique -- TMMW
Inspiring
June 27, 2017

Hi there,

try this for the expression:

slider = effect("Slider Control")("Slider"); //LINK TO SLIDER

min = 2.6; // MINIMUM VALUE

max = 4.9; // MAXIMUM VALUE

if(slider>min && slider<max){

100

}else{

0

}

Henrique \ TMMWClips Exporter | Text Replacer | Selector for Premiere Pro | Thumbs Up
Derick777Author
Inspiring
June 28, 2017

Expression error. Am I intended to just paste that in to the expression box on the opacity?

If so, does "//link to slider" mean i need to re-do the pick whip? And Would I need to alter the formatting on the


"if(slider>min && slider<max){

100

}else{

0

}"

so that it's all on one line together, or is that how it's supposed to be?

Thank you for your help. In the mean time, i will continue to search for a solution, and i'll let you know if/what i find.

Henrique -- TMMW
Henrique -- TMMWCorrect answer
Inspiring
June 28, 2017

You can keep the line breaks there.

Paste it into the opacity property.

In this line you link to the both channels slider:

slider = effect("Slider Control")("Slider"); //LINK TO SLIDER

you final expression should look like this:

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

min = 2.6; // MINIMUM VALUE

max = 4.9; // MAXIMUM VALUE

if(slider>min && slider<max){

100

}else{

0

}

Henrique \ TMMWClips Exporter | Text Replacer | Selector for Premiere Pro | Thumbs Up