Lightworks Generator + FastLED RGBW Fork Tips?

Could anyone point me in the right direction to getting Hohmbody's Lightworks pattern generator working with the FastLED RGBW fork?

I've attached the code generated from the homepage example from Lightworks. I'm able to get simple non-pattern illuminations by changing the 'currentFrame*pixels' and 'pixelIndex' from 3 to 4 and by adding another 'pgm_read_byte_near(data+index+n)' argument, but the generator obviously kicks out RGB sequences in sets of 3 so that doesn't get me far in terms of using the generator for what it's great at.

So instead is there anyway I can adjust the generated code to adapt to the FastLED RGBW fork that combines 'common' LED values to illuminate the 4th White element in my RGBW SK6812 LEDs? Thank you in advance for anyone willing to set me on the right path here!

NewLightwork.ino (1.5 KB)

If all you are trying to do is replace the white element when red==green==blue, you can do that after reading in your data

void loop() {
    for (int i=0; i<LENGTH; i++) {
        int pixelIndex = i % pixels;
        int index = currentFrame*pixels*3 + pixelIndex*3;
        int r,g,b,w;

        r = pgm_read_byte_near(data+index);
        g = pgm_read_byte_near(data+index+1);
        b = pgm_read_byte_near(data+index+2);

        if ( r == g && g == b ) {
          w = r;
          r = g = b = 0;
        }
        else {
          w = 0;
        }

        //Note: We're using pgm_read_byte_near to read bytes out of the data array stored in PROGMEM. These functions are not required for all configurations
        //strip.setPixelColor(i,pgm_read_byte_near(data+index),pgm_read_byte_near(data+index+1),pgm_read_byte_near(data+index+2));
        strip.setPixelColor( r,g,b,w );
    }
    strip.show();
    currentFrame ++;
    if (currentFrame >= frames) currentFrame = 0;
    delay(1000/fps);
}

That would definitely work for me. I unfortunately can't get it to work. I know my LED order is actually GRBW, and I've adjusted the length to 21 (the number of leds I have), but I can't get it to crunch. Right now it's just blinking one red pixel every couple of seconds.

The sequence should look like this.

#include <Adafruit_NeoPixel.h>

//IMPORTANT: Update the pin and length to match your LED strip!
#define PIN 7
#define LENGTH 21

Adafruit_NeoPixel strip = Adafruit_NeoPixel(LENGTH, PIN, NEO_GRBW + NEO_KHZ800);
int pixels = 7;
int frames = 7;
int fps = 3;

//This data array is a R, G, B values in sequence. The pixels from the first frame are first, followed by the next frame, etc..
//We're storing this in PROGMEM (see note below) to save space in RAM which is normally more constrained
const byte data[] PROGMEM = {0,0,0,0,0,0,0,0,0,251,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,251,255,0,255,170,0,251,255,0,0,0,0,0,0,0,0,0,0,251,255,0,255,170,0,255,0,0,255,170,0,251,255,0,0,0,0,251,255,0,255,170,0,255,0,0,255,255,255,255,0,0,255,170,0,251,255,0,0,0,0,251,255,0,255,170,0,255,0,0,255,170,0,251,255,0,0,0,0,0,0,0,0,0,0,251,255,0,255,170,0,251,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,251,255,0,0,0,0,0,0,0,0,0,0};

void setup() {
    strip.begin();
    strip.show();
}

int currentFrame = 0;
void loop() {
    for (int i=0; i<LENGTH; i++) {
        int pixelIndex = i % pixels;
        int index = currentFrame*pixels*3 + pixelIndex*3;
        int g,r,b,w;

        r = pgm_read_byte_near(data+index);
        g = pgm_read_byte_near(data+index+1);
        b = pgm_read_byte_near(data+index+2);

        if ( r == g && g == b ) {
          w = r;
          r = g = b = 0;
        }
        else {
          w = 0;
        }

        //Note: We're using pgm_read_byte_near to read bytes out of the data array stored in PROGMEM. These functions are not required for all configurations
        //strip.setPixelColor(i,pgm_read_byte_near(data+index),pgm_read_byte_near(data+index+1),pgm_read_byte_near(data+index+2));
        strip.setPixelColor( g,r,b,w );
    }
    strip.show();
    currentFrame ++;
    if (currentFrame >= frames) currentFrame = 0;
    delay(1000/fps);
}

H3CwXj0B4l.png

Try changing

 strip.setPixelColor( g, r, b, w );

to

 strip.setPixelColor( i, g, r, b, w );

david_2018:
Try changing

 strip.setPixelColor( g, r, b, w );

to

 strip.setPixelColor( i, g, r, b, w );

That's the ticket, it works!! Thank you both so much!!