Led color min/mid/max

Good day!

I’m a bit confused on how to use these functions.
Started with this in the init tab of an encoder knob, enc mode 2, setting the led values in a midi rx (0…127 feedback from DJ app), use case is an EQ control.

led_color_min(num, 2, 255, 0, 0)
led_color_mid(num, 2, 0, 255, 0)
led_color_max(num, 2, 255, 0, 0)

My first assumption was that the colors would be superimposed on the intensity, but it looks like by applying led_color_min you get high intensity with the min color applied on low values. Going from there I expected to get red on low values, green on mid values and again red on high values. But it is red on low values, green on high values and on mid values a mix of red/green.

It looks like mid color is applied on max intensity and max color is ignored. Or what am I missing?

Thanks, Bart

So I checked these functions and they work like so:

When these parameters are set, the led_value() function will now control colors instead of overall LED brightness.

But because usually the default intensity setup uses the default val variable for setting the LED intensity it will only range from 0-127.

To make the LED run the full spectrum of colors defined in the following function,

led_color_min(num, 2, 255, 0, 0)
led_color_mid(num, 2, 120, 120, 0)
led_color_max(num, 2, 0, 255, 0)

we either have to set the control element to a higher value range output (0-255) or double up its value in the intensity field.

I did the second one, and I can see the LED continually change from red to green while changing to yellow in the middle by setting up my LED intensity action like this under the control element’s event:

led_value(num,1,val*2)

Hope this helps explain it!

2 Likes

Yes, what fixed it is the val*2 in led_value, with my unchanged min/mid/max settings.
What I understand is that the min/mid/max map the colors based on a 0…255 range iso 0…127.

Next step now is to figure out if it is possible to set a lower default intensity while the min/mid/max colors still work, because this intensity is “sunglass intensity” for my eyes, especially in dark environment. But for that I need to RTFM myself first. :slight_smile:

Edit: What I did until now is mapping 127 to 70 and 0 to 5, like a custom beautifier, but with the color mapping that does not work.

Thanks!

Yeah, I was in the same boat when testing it.

There’s two ways you can go about this:

  • keep control over the LED brightness and colors;
  • forget about controlling the brightness dynamically.

You can do both in different ways, for example I have made a profile with a custom way to use colors as value feedback called “Alt colors” in the cloud for the EN16. It has a custom function that dynamically assigns color to the LEDs instead of changing brightness. This way you’d have control over every aspect.

The other way is to use the above functions on the control element event itself as well to dynamically adjust both brightness and color at the same time.

This method sadly suffers from the LED going completely dark when the val is 0, since these min, mid, max functions seemingly don’t have beautify implemented.

I think I will try your second option but more static. What triggered me with your second example is that you can implicitly set intensity through RGB. I will try to use min/mid/max with RGB’s that yield just a lower but still static intensity. I hope that will do it. Although I assumed a dynamic intensity initially, I don’t need it. The amount of information in one led is limited to begin with, so it will always be the computer display that provides the details.

1 Like

Yes, perfect for now! Thanks!

1 Like