FORUMS: list search recent posts

Sound Keys Expression - Change Color

COW Forums : Trapcode

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
SaintJoshua
Sound Keys Expression - Change Color
on May 13, 2006 at 6:35:18 am

Hello,

I'm a newbie w/ Sound Keys, and have had a lot of fun with it so far. I am stuck at this point trying to change the color of Text, or a particle to the beat of the music. I can change other values fine, like scaling, opacity, etc, but having no luck w/ color. When linking to the Output I get an expression of:

temp= thisComp.layer("sk").effect("Sound Keys")("Output 1");
[temp, temp, temp, temp]

I would like to - for example have blue text, and when the beat hits, change the text to red.

Could this be used to change the color to more than one color?
I guess I'd have to see it in action, but would it change instantly, or blend to the new color?

thanks for any help,

Josh


Return to posts index

Mylenium
Re: Sound Keys Expression - Change Color
on May 13, 2006 at 5:39:35 pm

[SaintJoshua] "Could this be used to change the color to more than one color?
I guess I'd have to see it in action, but would it change instantly, or blend to the new color?"


That woulkd depend on what you are trying to do in particular... Colors are expressed as arrays like [R,G,B,A] with ranges between 0 and one, so red would for instance be [1,0,0,1]. By replacing the 1 with your variable you could use that value to get a smooth color change. However, in most situations it's more practical (and predictable) to do color transforms in HSV space using the rgbToHsv() method. If you can be more specific, I might be able to provide you with working expressions for the task at hand.

Mylenium



[Pour Myl


Return to posts index

SaintJoshua
Re: Sound Keys Expression - Change Color
on May 14, 2006 at 4:05:41 am

Mylenium,

Thanks for the help so far. I don't have a specific project, but just trying to play around with Sounds Keys. What I was trying to do was link the Output from Sounds Keys to Color. This could be color for text, or color for a particle, just having the color change of an "object" when the music beats.

Example - I have White text, and each beat I would like the text to change to blue.

-----------------------------

You mention R,G,B, A. Each having a value of 0 or 1. This I don't follow. I would think it would have a value of 0-255? And Alpha having a value of 0-100? This way I can target a specific color. Pardon my ignorance I'm a newbie remember.

------------------------------

Besides the expression - I don't understand how I would have to set Sound Keys Output min/max. to change a (R,G,B,A) value.

thanks for you help,

Josh



Return to posts index


Mylenium
Re: Sound Keys Expression - Change Color
on May 14, 2006 at 12:21:10 pm

[SaintJoshua] "You mention R,G,B, A. Each having a value of 0 or 1. This I don't follow. I would think it would have a value of 0-255? And Alpha having a value of 0-100? This way I can target a specific color. Pardon my ignorance I'm a newbie remember."

Nope. 0-255 is just a representation of the colors in 8 bit notation (2^8). In 16 bit notation it would be something like 0-32000. The same goeas for the Alpha. Internally, however, AE uses normalized float values between 0-1. The individual levels are then derived from those values e.g. 1/256 and rounded/ quantized.

[SaintJoshua] "
Besides the expression - I don't understand how I would have to set Sound Keys Output min/max. to change a (R,G,B,A) value."


You would have to remap those values using AE's expression syntax. So assuming you output ranges from 0-100% with Soundkeys, somethink like this might work:

sk=thisComp.layer("SK").effect("Soundkeys")("Output 1");

R=linear(sk,0,100,0,1);
G=linear(sk,0,100,0,1);
B=linear(sk,0,100,0,1);
A=1;

[R,G,B,A]


By assigning different ranges to each component, you would get different colors.

Mylenium



[Pour Myl


Return to posts index

Scott Green
Re: Sound Keys Expression - Change Color
on Feb 23, 2015 at 8:22:28 pm

Hi,

I can't seem to get my head around how to affect colours using sound keys and I hope you can help.

What I want to happen is:
I have a set color to start with which is R=141, G=165, B=255,

And then when my sound keys value changes, which is found at:
comp("Audio").layer("SK").effect("8")("Output 1")
I want the colour to change to any random color, or a set color, it doesn't matter which color really as long as it's bright and not black.

Any ideas?

Splurj Creative, Video Production, Motion Graphics & Animation in Manchester UK.


Return to posts index

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