Page 1 of 1
Set the color of individual ball in multiball
Posted: 08 Dec 2011 21:40
by misal
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.
Re: Set the color of individual ball in multiball
Posted: 09 Dec 2011 14:36
by marino_liine
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.
Re: Set the color of individual ball in multiball
Posted: 09 Dec 2011 14:40
by Anton
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.
Re: Set the color of individual ball in multiball
Posted: 09 Dec 2011 15:10
by mbncp
just guessing, but did you try:
Code: Select all
decl b;
b=getattribute(Multiball, 'color');
setattribute(Reverb, 'color', b[0]);
Re: Set the color of individual ball in multiball
Posted: 09 Dec 2011 15:11
by nick_liine
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);
Re: Set the color of individual ball in multiball
Posted: 09 Dec 2011 16:22
by Anton
hi Thanks,
So how do you get the color of a certain ball number?
Re: Set the color of individual ball in multiball
Posted: 09 Dec 2011 16:43
by misal
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.