Output highest CHOP value with channel


I have 3 channels (R,G,B) and always want to output the highest value with a name. So when there is more blue in the picture, the B value is higher. Then this should be output so that the blue lights are controlled.
I’m definitely stuck… I’ve been trying for an hour now, but I can’t get it

The easiest way I found is to get a Select CHOP and filter name using the maximum value from your channels.

The expression is as follow : max(op('constant1').chans(), key=lambda item: item.vals[0]).name

max_channel.toe (3.5 KB)

1 Like

yeah, thanks, it works until the RGB Data is controlled by exported Values. I just tried it with lfos.

Maybe send your 3 RGB channels to a Shuffle CHOP to put them all in one channel, then use Analyze CHOP to get the index of the largest value, which will be 0, 1 or 2, then send that to a Lookup CHOP that has 3 samples of 3 chans (your desired RGB outputs).

1 Like

seems to work. But now I quickly did it in such a way that the analyzer controls a switch to which the three values are connected. I think it should work. thanks (Y)