How do I setup LED color in EN16? led_color() gives me inconsistent results | Intech Studio
💬 general Grid

How do I setup LED color in EN16? led_color() gives me inconsistent results

0xdb
0xdb · · 49 replies

Hey all! I'm trying to get colors to switch automatically on my EN16 when I click on a track and I was hoping I could get some help with the last mile.

Replies (49)

0xdb 0xdb ·

I'm trying to send a MIDI message using a different command code (EN16 uses 176) with the color index of the track, a number between 0 and 70-ish

0xdb 0xdb ·

I created a setup function self.midirx_cb that receives encoder values and led intensity from the Intech remote script and updates then when you switch tracks

0xdb 0xdb ·

And I created my own remote script that can also send MIDI messages with encoder values using command 176, I can see them in the Editor debugger

0xdb 0xdb ·

But when I try using a different command value (let's say 111) on Ableton with self._send_midi, I get an error on the debugger

0xdb 0xdb ·

I noticed the values of the midi status byte and the command value are both 176 (0xB0)

0xdb 0xdb ·

I ended up using 0xB0 for CC with param = 100

0xdb 0xdb ·

I wrote a table with hex values to map the color indexes and a function to parse it into RBG

0xdb 0xdb ·

All that's working now, except I cannot change the led colors

0xdb 0xdb ·

I tried with led_color_min / mid / max, the functions from docs don't do anything

0xdb 0xdb ·

I switched to led_color(), for some reason it assigned the RGB to the dimmest value of some LEDs but not all of them and the intensity was inconsistent

goatbamf goatbamf ·

led_color_min/mid/max work for setting up a default state, but to change the color immediately you need led_value, not led_color

At least I think that might be the issue?

0xdb 0xdb ·

I'm already using led_value to update the intensity, it works - I read the current value when I switch to another track and update the intensity with that function, it's all part of the same loop just a different if block for my messages with param = 100

0xdb 0xdb ·

I have default blue layout and I attempt to switch to red. For those LEDs where the call works it gets mapped to zero, you have to turn the knob all the way to see the color and intensity at zero won't be consistent (some will be a dim red and other deep red)

0xdb 0xdb ·

Ideally I would like to change the color both immediately and as default so that when I turn the knob it stays on the right color

cecilnick cecilnick ·

I don't think 111 is a valid MIDI command value range?

cecilnick cecilnick ·
cecilnick cecilnick ·
cecilnick cecilnick ·

the MIDI implementation uses 176 as the command range for for all Control Change values.

0xdb 0xdb ·

Yes, I learned that everything in the lower half is treated as data and only the higher bits are valid

0xdb 0xdb ·

As I mentioned in a subsequent message I'm now using 176 (0xB0) with a param=100, or element number = 68

0xdb 0xdb ·

I think the simple color in the encoder element is what's interfering

0xdb 0xdb ·

I deleted it and got color working in a knob of I set the current color AND set min + mid + max

0xdb 0xdb ·

But I don't think I'll have enough code characters this way lol

cecilnick cecilnick ·

the Remote Script stuff is a little beyond me, but there's a forum post that seems like someone got something like this working?

0xdb 0xdb ·

Thanks, I looked at it at some point yesterday, I'm already beyond that point

0xdb 0xdb ·

It was the simple color settings after all

0xdb 0xdb ·

I simplified my code and I still ran out of memory when trying to implement the RGB lookup table

0xdb 0xdb ·

Now I'm pushing the table to the python remote script and I think that should be it 😄

0xdb 0xdb ·

Actually that won't work because I'm limited to 127 max value, which was the reason I was sending the color index in the first place...

0xdb 0xdb ·

I guess I need to either hack a way to send the 6 RGB hex values or use a sysex message at this point

cecilnick cecilnick ·

If you figure this out, you will be goated

0xdb 0xdb ·

I think I can use globals to parse six custom MIDI commands and check if all of them happened already

0xdb 0xdb ·

Another idea is using 3 midi messages instead of 6: divide each RGB / 2 on Ableton side, then RGB * 2 on grid

0xdb 0xdb ·

I tried sysex, it currently has a bug 🐛 🙁

0xdb 0xdb ·

Ufff, I finally got it working using 6 custom MIDI CCs, 100-105

0xdb 0xdb ·

Dropping all UI elements for ifs and vars and using a single code block instead gave me like 200 extra chars

0xdb 0xdb ·

Now I'm working on enabling color on button press, I had to get rid of it too to get the colors working properly

0xdb 0xdb ·
cecilnick cecilnick ·

The hero we deserve

cecilnick cecilnick ·

hey @user! I wanted to check out your track color profile, but I don't think it's set to public visibility?

0xdb 0xdb ·

Hmm maybe I didn't do it properly, let me take a look

0xdb 0xdb ·

@user ok, I opened the grid editor and the upload button was there, but I swear I had done these steps already...

0xdb 0xdb ·

grid-editor://?config-link=kIxQFouXLPmHWYolJhuz

0xdb 0xdb ·
  1. that's the link I pasted above
  2. AFAIU that means it's public
image.png
0xdb 0xdb ·

@user do you mind trying again? 🙂

cecilnick cecilnick ·

@user yes! thank you

0xdb 0xdb ·

For the record, I wrote this on my first two days. Now I understand I could have used my global vars as RGB values for the UI color elements. Their default values are -1 and I wrongly assumed this was some smart placeholder for whatever was the value stored in self. Instead, the UI in the enconder elements was setting it LEDs to blue while I was trying to set them to another color in system's MIDI RX. To change values on the fly you still need to call led_color and led_value, tho.

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →