ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Colour that changes when the bass from the music hits

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jonathan SikkemaColour that changes when the bass from the music hits
by on Jul 27, 2015 at 2:50:37 pm

Hello people off the internet :)

I want to make something but i dont know how...
I will post a video link so you know what i mean:





I can make the spectrum and everyting else accept that color changing on the music. Can someone help me with that?? :) I have adobe after effects CS6


Have a great day and thanks in advance.


Return to posts index

Richard HerdRe: Colour that changes when the bass from the music hits
by on Jul 27, 2015 at 10:03:19 pm

That requires an expression from the math and design guru, Dan Ebberts.

By DAN EBBERTS
//change colors to the beat

threshold = 10.0;

colors = [[255,205,47,255]/255,[213,116,45,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;
n++;
}
frame--
}

colors[n%colors.length]


Return to posts index

Jonathan SikkemaRe: Colour that changes when the bass from the music hits
by on Jul 27, 2015 at 11:26:58 pm

Thanks for the reply!

I am trying to figure out how it works but till now i havent done that yet...
Can u say me what i need to do so i can get it to work??

Thanks in advance!


Return to posts index


John CuevasRe: Colour that changes when the bass from the music hits
by on Jul 28, 2015 at 2:51:29 pm

Seems to be a line missing from the expression that Dan originally posted. To use this expression, you need to select your audio layer, go the "Animation" drop down > Keyframe Assistant > Convert Audio to Keyframes. That will drive your color changes.

Then add a fill to your spectrum, alt + click the color stopwatch and add this expression. In my example I have it set to 3 colors, RGB, you can add more colors by adding a ", [0,0,255,255]/255]" to the end of the expression, just make sure you take the last bracket ] off the previous color.

threshold =10.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;
n++;
}
frame--
}

colors[n%colors.length]


Johnny Cuevas, Editor
ThinkCK

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index

John CuevasRe: Colour that changes when the bass from the music hits
by on Jul 28, 2015 at 2:54:38 pm

Here's a simple project(minus the audio) that shows how you place the effect and expression.

9088_audiobeatexrpession.aep.zip

Johnny Cuevas, Editor
ThinkCK

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]