ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Color Expression with Audio

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrew Pientka
Color Expression with Audio
on Jan 31, 2008 at 4:48:58 pm

Dear Creative Cow,

I’m working on a project where I need to randomize color in text, to the beat of an audio track. The effect that I'm looking for, is that the color will "cut" or change immediately to a different pigment, with the beat of the music. Is there an expression that can do this for me? Thanks.



Return to posts index

Dan Ebberts
Re: Color Expression with Audio
on Jan 31, 2008 at 6:24:38 pm

Something like this should work:

threshold = 10.0;

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--
}

seedRandom(n,true);
random([1,1,1]) + [0,0,0,1];


You may have to adjust the value of "threshold".

Dan



Return to posts index

Andrew Pientka
Re: Color Expression with Audio
on Feb 5, 2008 at 2:47:34 pm

Hi Dan,

Just wanted to say thank you very much, the expression worked wonderfully.



Return to posts index


Rafael Cruz
Re: Color Expression with Audio
on Nov 21, 2008 at 5:32:36 pm

I tried using this expression on the hue setting of the Color Balance (HLS) effect and it didn't work. The problem seems to be that there are too many values in the code for the property (hue) that i'm trying to manipulate.

Is there another effect that I should apply this expression to in order to have random color change in time with music?



Return to posts index

Dan Ebberts
Re: Color Expression with Audio
on Nov 21, 2008 at 7:41:05 pm

Try changing the last line of the expression to this:

random(360)


Dan



Return to posts index

Rafael Cruz
Re: Color Expression with Audio
on Nov 22, 2008 at 1:49:49 am

Thanks Dan!

The change worked.
I had come to suspect that the problem was with the last line but I didn't know what to do to correct it.



Return to posts index


Deepak Kumar
Re: Color Expression with Audio
on Nov 14, 2018 at 6:24:52 am

Can Anyone Tell Me How This Expression Works. Why Color Reacts To That Value?


Return to posts index

Dan Ebberts
Re: Color Expression with Audio
on Nov 14, 2018 at 7:36:28 am

Which value are you talking about?

Dan



Return to posts index

Deepak Kumar
Re: Color Expression with Audio
on Dec 4, 2018 at 6:18:53 am

Value which is Evaluated by that expression. how we are telling AE to Change Value of Color tone. Why it reacting With Color Shade?


Return to posts index


Deepak Kumar
Re: Color Expression with Audio
on Dec 4, 2018 at 6:30:15 am

Value which is Evaluated by that expression. how we are telling AE to Change Value of Color tone. Why it reacting With Color Shade?


Return to posts index

Kalleheikki Kannisto
Re: Color Expression with Audio
on Dec 9, 2018 at 10:48:02 am

If the question is WHERE does this expression go, it would go to the color value either in the layer itself if it has one (such as in shape layer), or the color value of the fill effect, for instance, if you're using that to color something that doesn't have color option in it directly.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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