Set the color of individual ball in multiball

Discuss Lemur and share techniques.
Post Reply
misal
Newbie
Posts:11
Joined:08 Dec 2011 21:35
Set the color of individual ball in multiball

Post by misal » 08 Dec 2011 21:40

How can i set the individual colors of all the balls in a multiball-object by scripting?

i tried

Code: Select all

setattribute(Multiball[0], 'color', 5000);
But this just sets the frame color of the multiball-object.

marino_liine
Regular
Posts:121
Joined:26 Apr 2011 09:05

Re: Set the color of individual ball in multiball

Post by marino_liine » 09 Dec 2011 14:36

Hi misal,

An easy way to set the color of ball 8 for example (assuming you have a global variable called multiball_colors.. see the attached example jzml)

Code: Select all

decl color = RGB(1.0,0.0,0.0);
multiball_colors[7] = color;
setattribute(MultiBall, 'colors',multiball_colors;
that will set the 8th ball to bright red.

I have attached an example patch which uses faders to mix between the RGB scale. There are three faders for each ball which control the mix of Red, Green and Blue.
If you need more info don't hesitate to ask.
Attachments
Multiball_Colors.jzml.zip
Example of multiball color scripts
(3.53KiB)Downloaded 240 times

Anton
Regular
Posts:75
Joined:08 Dec 2011 12:36

Re: Set the color of individual ball in multiball

Post by Anton » 09 Dec 2011 14:40

what if I wanted to set the color of a monitor to the color of a ball. how do i get the color of an individual ball?

I treid something like

Code: Select all

decl b;
b=getattribute(Multiball[0], 'color');
setattribute(Reverb, 'color', b);
where Reverb was the name of the monitor this script lived in.

mbncp
Regular
Posts:87
Joined:08 Dec 2011 07:25

Re: Set the color of individual ball in multiball

Post by mbncp » 09 Dec 2011 15:10

just guessing, but did you try:

Code: Select all

decl b;
b=getattribute(Multiball, 'color');
setattribute(Reverb, 'color', b[0]);

nick_liine
Liine Staff
Posts:340
Joined:01 Oct 2010 11:06

Re: Set the color of individual ball in multiball

Post by nick_liine » 09 Dec 2011 15:11

Anton wrote:what if I wanted to set the color of a monitor to the color of a ball. how do i get the color of an individual ball?

I treid something like

Code: Select all

decl b;
b=getattribute(Multiball[0], 'color');
setattribute(Reverb, 'color', b);
where Reverb was the name of the monitor this script lived in.

If you want to get the colors of the balls, first make sure the Multicolor checkbox is ticked. The attribute for the balls is 'colors', not 'color' (that's for the frame).

Code: Select all

decl b;
b = getattribute(Multiball, 'colors');
setattribute(Reverb,'color',b);

Anton
Regular
Posts:75
Joined:08 Dec 2011 12:36

Re: Set the color of individual ball in multiball

Post by Anton » 09 Dec 2011 16:22

hi Thanks,
So how do you get the color of a certain ball number?

misal
Newbie
Posts:11
Joined:08 Dec 2011 21:35

Re: Set the color of individual ball in multiball

Post by misal » 09 Dec 2011 16:43

Thanks for your answers.
What i actually want is to set the touched ball to a different color. Then, if i press a hold button, the touched ball stays touched. So i think i need to get the number of the touched ball as well?
Thanks for any help.

Post Reply