//Color Frizzles
//Stepko

#include "FastLED.h"

// Matrix size
#define WIDTH 16
#define HEIGHT 16
#define NUM_LEDS HEIGHT * WIDTH
// LEDs pin
#define DATA_PIN 3
// LED brightness
#define BRIGHTNESS 255
// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  FastLED.setBrightness(BRIGHTNESS);
}

void loop() {
  for(byte i=8;i--;)leds[XY(beatsin8(12+i,0,WIDTH-1),beatsin8(15-i,0,HEIGHT-1))]=CHSV(beatsin8(12,0,255),255,255);
  blur2d(leds,WIDTH,HEIGHT,16);
  FastLED.show();
} //loop


uint16_t XY (uint8_t x, uint8_t y) {
  return (y * WIDTH + x);
}