EN16 - code to switch midi channel from button press - but leds not working | Intech Studio
💬 general Grid

EN16 - code to switch midi channel from button press - but leds not working

Andy79 · · 14 replies

The vibe code below works to switch midi channel n from button/knob n press (for all encoders in layer), but I get errors when I want to have the led of the active midi channel always on, and the rest off.

Could anybody give a hand? Thanks

for i=0,15 do e=ele[i]
 if e then
  e.bc=function(s)
   if (s:button_value() or 0)>0 then G=i end
   return 1
  end
  e.ec=function(s,v)
   midi_send(G,176,B+i,(v or s:encoder_value() or 0))
  end
 end
end```

Replies (14)

kkerti kkerti ·

I don't see any led_color functions called nor led_value. Thats an issue for sure while setting colors/intensity programmatically

Andy79 ·

I know this code doesn't, all the ones that did returned such errors

Screenshots_2025-11-24-19-33-26.png
Andy79 ·

This does:

Andy79 ·
for i=0,15 do e=ele[i]
 e.bc=function(s)
  if (s:button_value() or 0)>0 then
   ele[P]:led_color_min(0,0,0);ele[P]:led_color_max(0,0,0)
   G=i;P=i
   s:led_color_min(127,127,127);s:led_color_max(127,127,127)
  end
  return 1
 end
 e.ec=function(s,v)
  midi_send(G,176,B+i,(v or s:encoder_value() or 0))
 end
end
ele[0]:led_color_min(127,127,127);ele[0]:led_color_max(127,127,127) ```
kkerti kkerti ·

Can you wrap your code around triple ``` symbols to get code formatting? That way it's easier to consume!

Andy79 ·

Done, thanks

kkerti kkerti ·

hmm. this looks like it has been vibe coded a bit too hard 😛

kkerti kkerti ·

You want to press a button 0-15, to change that to the active channel for all encoders right?

kkerti kkerti ·

I think the profiles for this are nicely covered, I recommend checking out: 256CTRL by Echomatter and 64CTRL added by intech to profile cloud.

kkerti kkerti ·

Those profiles might give good back-and-forth for vibe coding as well.

Andy79 ·

Yes, one led only, for the active knob/ channel. And to be 4 distinct colors for the 4 layers, to know on which layer I am 🙂

Andy79 ·

So 1024CTRL 🙂

Andy79 ·

This is a nice setup, one knob push for 16 DAW instruments, with max 64 parameters for each instrument

narayb narayb ·

You could do a kind of 1024CTRL if you have different local MIDI Channels on each module and you allow Remote Control.

Discord

View on Discord

This post is from the Intech Studio Discord community.

Open thread →