hey. i’m controlling an LPD8806 via FastLED and the Arduino Midi library, where led[i] = midi note on[x] and r/g/b are controlled by 3 midi CCs. i am able to create chasers, cylons, etc and change their color.
however, i have been stumped by something that will probably be simple for you guys. once an LED has been turned on by a NOTEON, i don’t know how to update it with new RGB information. i see you guys using a lot of for(i++) loops, but i don’t know if that will work in my application.
in short, let’s say an LED is turned on and held: i want it to continue to reference my r, g, and b values and update accordingly.
here’s what happens when arduino receives a midi note on and a note off:
void handleNoteOn(byte channel, byte pitch, byte velocity)
{
if(pitch < NUM_LEDS){
leds[pitch].setRGB(ccR, ccG, ccB); //where ccX refers to 0-255 cc values
FastLED.show();
}
}
void handleNoteOff(byte channel, byte pitch, byte velocity)
{
if(pitch < NUM_LEDS){
leds[pitch] = CRGB::Black;
FastLED.show();
}
}
in this case, my LEDs are only changing color when a noteon is received. i want the LED to continue to reference ccX to get RGB info in between noteon and noteoff. how might i do this, when the contents of “void HandleNoteOn” seem to be triggered by a one-off event?
note that if i have my RGB values fluctuating via an LFO applied to each CC, AND a midi sequence programmed to behave like a “chaser” ala various examples, the LEDs DO update…but only because i am triggering new noteons.
thanks for your time, please let me know if i can clarify further.
