Automatic change Text Color

Francesco Pasquale's icon

Hi guys!
I just want to change the comment font color in an automatic way (probably by using a swatch object.
I want a smooth color changing on the text. How can I achieve this result?
Bye

Source Audio's icon

First thing to do when facing such questions is to open
inspector of the object, or connect attrui to it to check
syntax and messages for the functions it can respond to.
That is almost allways leading to success.
You can try that yourself next time...

Max Patch
Copy patch and select New From Clipboard in Max.


Francesco Pasquale's icon

Thanks you for replying to me but how can I change the color automaticly? Can I use a message with a line(I don't know how to do that)?

Source Audio's icon

Did you look in swatch help file ?
Having examples on scrolling and automating color change ?

Peter Ostry's icon

You can use [line]
Consult the help file and/or the reference to learn about the object.
You may want to use a message box, there the syntax is:
[EndValue, StartValue Time]
For example:
[0., 1. 3000]
(this means: go to 0. from 1. within 3 seconds)

To set the text color of a comment object, the message is 'textcolor', as the [atttrui] object tells you. The color is in RGBA format, which means 4 floating values for Red, Green, Blue and Alpha.

See attached patcher.

Max Patch
Copy patch and select New From Clipboard in Max.



Source Audio's icon

add float argument to line object, otherwise
no scrolling floats
like line 0.

Peter Ostry's icon

Shouldn't it be [line 0. 0.] ?

However, it floats without an argument.
Maybe because 'floatoutput' defaults to 2:
2 = 'Auto' ( Floating-Point Output Auto )
Outputs float values if distance is <= 1, line does not have a float argument, and step size is < 0.4
.

But you are right, I should not provide an example that relies on a situation that accidently fits to a certain default behavior. I corrected the patcher above.

Source Audio's icon

I am not trying to correct everyone, i's just that for a beginner it
could be frustrating if things don't seem to work as expected.
And I keep forgetting that many things changed since max 6