Highlighted

Need Help Configuring Expression With Adjustable Threshold

New Here ,
Apr 08, 2020

Copy link to clipboard

Copied

On my current After Effects project, I'm trying to animate a glow effect within certain parameters. Each part of the glow effect needs to be animated by an audio amplitude that has an ease(value) function on it. The individual parts of the glow need to all have a base value so they're not off when not being effected, but they need to still be intensified when the audio amplitude is inputting values. I'm still learning expressions, and everything I'm doing seems to not be rendering the desired result. I need an expression that can be applied to any individual parameter of the effect, that, when not being effected, has a base value. Otherwise, when being input upon by the amplitude, it will react from said value to another adjustable value, like a ceiling if you will. I hope this is descriptive enough, thand

Adobe Community Professional
Correct answer by Rick Gerard | Adobe Community Professional

In the Expression Language Menu>Interpolation in the timeline, you will find the methods for ease, easeIn, easeOut, and linear. For audio visualizers I usually pick the ease method. 

 

Here is how that looks:

ease(t, tMin, tMax, value1, value2)

Here's what that means:

  • ease is the interpolation method
  • t is the property you are sampling like the Both Channels Slider
  • tMin, tMax are the minimum values of the sampled property like The Both Channels slider
  • value1, value2 become the corresponding new values applied to the property you are animating

If you wanted to animate the Minimum and Maximum value for Glow Intensity from 1.5 to 3.7 and the minimum and maximum values you wanted to use for the Both Channels slider was between .5 and 8 then the expression would look like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
ease(t, 1.5, 8, 1.5, 3.7)

Here is the analysis and setup workflow I usually use:

Screenshot_2020-04-08 13.15.17_ATKiCl.pngScreenshot_2020-04-08 13.19.20_xEKdZI.png

Fortunately most of the properties in the Glow Effect are arrays so all you need is one value. if you wanted to animate a property color you would have to use a 4 place array like this [red, green, blue, alpha] with all values ranging between 0 and 1. You would define a variable for each color using a different linear method for each. Having the Audio drive the color of Color A might look like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
c = ease(t, 1.5, 8, 0, 1);
[value[0] + c, c, value[3]-c, 1]

In the array I'm adding the value c to the current value of value[0] which is red, using the value of c for green, subtracting the value of c from value[2] which is red and setting the value of the alpha channel to 1 so the colors will be visible]

 

I hope that makes some sense.

TOPICS
Audio, Expressions, How to, Scripting

Views

130

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Need Help Configuring Expression With Adjustable Threshold

New Here ,
Apr 08, 2020

Copy link to clipboard

Copied

On my current After Effects project, I'm trying to animate a glow effect within certain parameters. Each part of the glow effect needs to be animated by an audio amplitude that has an ease(value) function on it. The individual parts of the glow need to all have a base value so they're not off when not being effected, but they need to still be intensified when the audio amplitude is inputting values. I'm still learning expressions, and everything I'm doing seems to not be rendering the desired result. I need an expression that can be applied to any individual parameter of the effect, that, when not being effected, has a base value. Otherwise, when being input upon by the amplitude, it will react from said value to another adjustable value, like a ceiling if you will. I hope this is descriptive enough, thand

Adobe Community Professional
Correct answer by Rick Gerard | Adobe Community Professional

In the Expression Language Menu>Interpolation in the timeline, you will find the methods for ease, easeIn, easeOut, and linear. For audio visualizers I usually pick the ease method. 

 

Here is how that looks:

ease(t, tMin, tMax, value1, value2)

Here's what that means:

  • ease is the interpolation method
  • t is the property you are sampling like the Both Channels Slider
  • tMin, tMax are the minimum values of the sampled property like The Both Channels slider
  • value1, value2 become the corresponding new values applied to the property you are animating

If you wanted to animate the Minimum and Maximum value for Glow Intensity from 1.5 to 3.7 and the minimum and maximum values you wanted to use for the Both Channels slider was between .5 and 8 then the expression would look like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
ease(t, 1.5, 8, 1.5, 3.7)

Here is the analysis and setup workflow I usually use:

Screenshot_2020-04-08 13.15.17_ATKiCl.pngScreenshot_2020-04-08 13.19.20_xEKdZI.png

Fortunately most of the properties in the Glow Effect are arrays so all you need is one value. if you wanted to animate a property color you would have to use a 4 place array like this [red, green, blue, alpha] with all values ranging between 0 and 1. You would define a variable for each color using a different linear method for each. Having the Audio drive the color of Color A might look like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
c = ease(t, 1.5, 8, 0, 1);
[value[0] + c, c, value[3]-c, 1]

In the array I'm adding the value c to the current value of value[0] which is red, using the value of c for green, subtracting the value of c from value[2] which is red and setting the value of the alpha channel to 1 so the colors will be visible]

 

I hope that makes some sense.

TOPICS
Audio, Expressions, How to, Scripting

Views

131

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 08, 2020 0
Guide ,
Apr 08, 2020

Copy link to clipboard

Copied

You can use linear() to transform a value area to another one - like input is 0 ...100, but output is 51...67.

The same is possible for ease, but with the easing the result might be not what you want. So, try the linear way.

 

Read more about it in the language reference:

https://helpx.adobe.com/after-effects/using/expression-language-reference.html

 

*Martin

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 08, 2020 1
Adobe Community Professional ,
Apr 08, 2020

Copy link to clipboard

Copied

In the Expression Language Menu>Interpolation in the timeline, you will find the methods for ease, easeIn, easeOut, and linear. For audio visualizers I usually pick the ease method. 

 

Here is how that looks:

ease(t, tMin, tMax, value1, value2)

Here's what that means:

  • ease is the interpolation method
  • t is the property you are sampling like the Both Channels Slider
  • tMin, tMax are the minimum values of the sampled property like The Both Channels slider
  • value1, value2 become the corresponding new values applied to the property you are animating

If you wanted to animate the Minimum and Maximum value for Glow Intensity from 1.5 to 3.7 and the minimum and maximum values you wanted to use for the Both Channels slider was between .5 and 8 then the expression would look like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
ease(t, 1.5, 8, 1.5, 3.7)

Here is the analysis and setup workflow I usually use:

Screenshot_2020-04-08 13.15.17_ATKiCl.pngScreenshot_2020-04-08 13.19.20_xEKdZI.png

Fortunately most of the properties in the Glow Effect are arrays so all you need is one value. if you wanted to animate a property color you would have to use a 4 place array like this [red, green, blue, alpha] with all values ranging between 0 and 1. You would define a variable for each color using a different linear method for each. Having the Audio drive the color of Color A might look like this:

t = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
c = ease(t, 1.5, 8, 0, 1);
[value[0] + c, c, value[3]-c, 1]

In the array I'm adding the value c to the current value of value[0] which is red, using the value of c for green, subtracting the value of c from value[2] which is red and setting the value of the alpha channel to 1 so the colors will be visible]

 

I hope that makes some sense.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 08, 2020 0
New Here ,
Apr 16, 2020

Copy link to clipboard

Copied

This was exactly what i was looking for. Thank you so much for taking the time to write up a thorough answer!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 16, 2020 0