Target a single switch and change it's color with a pad?

Discuss problems and solutions.
Post Reply
jbw
Newbie
Posts:21
Joined:06 Oct 2013 23:46
Target a single switch and change it's color with a pad?

Post by jbw » 18 Dec 2015 00:02

I have a project with a switch object, one row with twelve columns, and am looking for a way to change the color of a single switch by controlling it with a pad.

I'm hoping to set it up so that when you tap the pad it will cycle through three different colors for a specific switch, and not all twelve at once.

The only thing I've figured out so far is to set the attribute of the switch so that multiple colors show up. Yes, I am new to this. :lol:

Like I say, I'd like to be able to control the color change of just one switch, by tapping a pad that will cycle through three different colors.

Any help is appreciated! :)

jbw
Newbie
Posts:21
Joined:06 Oct 2013 23:46

Re: Target a single switch and change it's color with a pad?

Post by jbw » 18 Dec 2015 01:28

Got it so when I press a pad it changes the color of the switches. Did so by moving the "setattribute" script to the pad object rather than the switch object, and setting the script to run when the pad is pressed "On". Easy enough.

Now I just need two things:

1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.

jbw
Newbie
Posts:21
Joined:06 Oct 2013 23:46

Re: Target a single switch and change it's color with a pad?

Post by jbw » 18 Dec 2015 04:30

jbw wrote:Now I just need two things:

1. To be able to target just one of the 12 switches in the switch object (1 row of 12 columns), and not all 12.
2. The ability to cycle between 3 colors with each tap on the pad.
Came up with a solution for #2:

Create three separate pads, one for each color. So rather than cycling through colors with one pad, just tap one of the three to change the color.

Last thing needed:

The ability to target a specific switch, because right now it changes the color of all the 12 switches. Again, it's 1 row and 12 columns, and I want to be able to change the color of just 1 rather than all 12


Any help for this last one is appreciated! Hopefully there's a way to do this.

jbw
Newbie
Posts:21
Joined:06 Oct 2013 23:46

Re: Target a single switch and change it's color with a pad?

Post by jbw » 18 Dec 2015 04:34

Here's the code I have set to the 3 Pads (with the number different for each color):

Code: Select all

setattribute(Switches25,'colors',{8355711});
And for the "Switches25" I have the "Multicolor" box checked.

The answer is probably something relatively easy. I just haven't found it yet.

MrCorba
Regular
Posts:143
Joined:02 Sep 2013 20:17
Location:Netherlands

Re: Target a single switch and change it's color with a pad?

Post by MrCorba » 18 Dec 2015 14:50

I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)

O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ks ... .jzml?dl=0

Cheers!
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba

jbw
Newbie
Posts:21
Joined:06 Oct 2013 23:46

Re: Target a single switch and change it's color with a pad?

Post by jbw » 18 Dec 2015 20:59

MrCorba wrote:I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)

O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ks ... .jzml?dl=0

Cheers!
Thanks! 8-)

darrow
Newbie
Posts:5
Joined:16 Feb 2016 15:55

Re: Target a single switch and change it's color with a pad?

Post by darrow » 16 Feb 2016 18:15

MrCorba wrote:
I guess this is something you want. The color expression now holds 3 random colors, just change those values to the ones you want. Any questions, just ask;)

O wait the forum is full, so I'll just use dropbox...
https://www.dropbox.com/s/gdx6x4p2u12ks ... .jzml?dl=0
Link expired. Please repost.

MrCorba
Regular
Posts:143
Joined:02 Sep 2013 20:17
Location:Netherlands

Re: Target a single switch and change it's color with a pad?

Post by MrCorba » 17 Feb 2016 21:51

I actually deleted it and I didn't have it anymore so I tried to recreate it. It was something like this, maybe JBW has the original one.
Attachments
Switch.jzml
(4.75KiB)Downloaded 203 times
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba

darrow
Newbie
Posts:5
Joined:16 Feb 2016 15:55

Re: Target a single switch and change it's color with a pad?

Post by darrow » 20 Feb 2016 19:55

Thanks for the repost. Much appreciated.

Post Reply