Jump to content

EVENT_RGBLED help


latigid on

Recommended Posts

I've been playing around with illuminated encoders and the results are nice (promise a video soon!). For the most part, the NG events work well to change the hsv colour, or brightness using dimmed=1.

I'm wondering about bipolar controls though -- e.g. where you might represent CC* values of 0-63 as negative and 64-127 as positive. I find it's okay to use range=MAP* as a hack to assign red to "negative" and green to "positive" values, and also to use a dimming function e.g.:

#hue map (red 0-49, yellow 50, green 51-100)
MAP1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \
0 0 0 0 0 0 0 0 0 0 0 0 60 120 120 120 120 120 120 120 120 120 120 120 120 120   \
120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120  \
120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120

#value (i.e. brightness) map (value 100-0-100)
MAP2 100 98 96 94 92 90 88 86 84 82 80 78 76 74 72 70 68 66 64 62 60 58 56 54 52 \
50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 14 12 10 8 6 4 2 0 2 4 6 8 \
10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 \
64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100

 

but it would be nice to combine the two. Thus you might have the LED off in the centre position, and fade up to full red or green depending on the direction. I can also think of other usecases e.g. a unipolar level control increasing in brightness from zero to green to yellow to red.

All of my efforts so far have failed, including trying to put conditional statements in the .NGC, running simple SET_HSV commands in .NGR, various arrangements of EVENTs etc. I assume (as well as being naive) that the RGBLED events are conflicting, and only the most recent one takes priority.

 

So, any ideas for controlling both the "h" and "v" parts of EVENT_RGBLED separately?

 

 

 

 

 

Link to comment
Share on other sites

1 minute ago, Psykhaze said:

sending 16 bits as 8bits H +8bits V concatenated and parse? idk if possible for real,just a naive guess.

Maybe for real coding, but this is MIOS so everything's a MIDI stream with limited parameters.

 

2 hours ago, Zam said:

Hi

Not sure to completely get it,

but did you try your encoder forwarding to a sender, with as many requested sender id (same hw_id sender) forwarding to led.

Best

Zam

I did play around with senders and multiple ids/hw_ids, but there's still the problem of one EVENT_RGBLED overwriting the other.

 

 

Eventually I could get it to work in a script, but it's pretty crude :doubt:

NGR:

if ^section == 0
  exec_meta RunSection:1
endif

#testing purposes, called at the same time as .NGC

if ^section == 1
  log "Section 1 called"

  if ENC:3 < 50
    set_hsv RGBLED:3 0:100:50
  elseif ENC:3 == 50
    set_hsv RGBLED:3 60:100:60
  else	
    set_hsv RGBLED:3 120:100:50
  endif
  
  delay_ms 100

  exec_meta RunSection:1

  exit
endif
               
#loops until "runstop" is entered into MIOS terminal :s               

 

NGC:

ENC n=3   sr=1 pins=5:4   type=detented1 enc_speed_mode=Fast:5
EVENT_ENC id=3 fwd_id=RGBLED:3   fwd_to_lcd=1  type=CC chn= 1 CC= 18  range=0:100 lcd_pos=11:1:1 label="ENC #%3i  %5d%B"
EVENT_RGBLED id=3 hsv=0:100:50 dimmed=1 range=MAP3

 

 

I hope there's a nicer way to implement it.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...