Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects changing light colour to music with expressions

  • changing light colour to music with expressions

  • Theo Buchinskas

    May 31, 2020 at 12:07 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.

  • Graham Quince

    May 31, 2020 at 1:02 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

  • Ocean Byrne

    June 7, 2020 at 6:31 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

Viewing 1 - 3 of 3 posts

Log in to reply.

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