FORUMS: list search recent posts

changing light colour to music with expressions

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Theo Buchinskas
changing light colour to music with expressions
on May 31, 2020 at 12:07:36 am

I am trying to change light colors based on audio keyframes, but can't seem to make it work. I had found an expression that did what I was looking for on a fill layer :

threshold =20.0;

colors = [[255,0,0,255]/255,[0,255,0,255]/255, [0,0,255,255]/255];

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

above = false;
frame = Math.round(time / thisComp.frameDuration);
n = 0;
while (frame >= 0){
t = frame * thisComp.frameDuration;
if (above){
if (audioLev.valueAtTime(t) < threshold){
above = false;

}else if (audioLev.valueAtTime(t) >= threshold){
above = true;


But when I try to apply this to a light colour, it gives after effects a complete heart attack, and I can't preview any video until I remove the expression and re-load. I tried applying this effect to just a fill layer, and then linking the light color to it, but it just has the same effect. Works flawlessly when just on the fill layer...

What I am trying to achieve is a group of 4-5 lights following a null object along a path, inside a trapcode Tao 'tunnel' so the blinking lights affect the walls etc. I was hoping to have each light cycle between a few colors to different parts of the beat. The only thing I am having trouble doing is changing the light colors to the music - they just don't want to respond. Any insight woudl be appreciated.

Return to posts index

Graham Quince
Re: changing light colour to music with expressions
on May 31, 2020 at 1:02:41 pm

Whenever I have tried using audio amplitude with expressions, I have found the value of the amplitude is often too low and have to use a multiplier to get the result I want.

Try creating a text layer and linking the source text to your audio amplitude, that will show you what value is going into the expression. Threshold is set to 20, but it’s possible your audio is only as high as 5... or even 0.1 - Free FX for amateur films - FX blog

Return to posts index

Ocean Byrne
Re: changing light colour to music with expressions
on Jun 7, 2020 at 6:31:44 am

Sounds wiggy. Maybe, pre-compose or pre-render the working fill effect changing color, and then target the light color to that movie somehow?

Would like to see the results, sounds cool!

Ocean Byrne
Humble Pixel Farmer

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 All Rights Reserved