+#include <Bounce2.h>
 #include "FastLED.h"
 
 /*

    3, 
    1
  );
  
  for (i=0;i<NUM_LEDS;i++){
      leds[i] = CHSV(hue, bufr[i], bufr[i]/brightnessFactor);
  }
  
  FastLED.show();

volatile boolean pulseBeatFound = false; // becomes true when Arduoino finds a beat.
volatile boolean hasPulse = false; // 

CRGB leds1[NUM_LEDS_CH1];
CRGB leds2[NUM_LEDS_CH2];

void setup() { 
      FastLED.addLeds<NEOPIXEL, LED_PIN_CH1>(leds1, NUM_LEDS_CH1);
      FastLED.addLeds<NEOPIXEL, LED_PIN_CH2>(leds2, NUM_LEDS_CH2);
      Serial.begin(BAUD_RATE);
      interruptSetup();

      pinMode(CTRL_LED_RED_PIN, OUTPUT);
      pinMode(CTRL_LED_GREEN_PIN, OUTPUT);
      pinMode(CTRL_LED_BLUE_PIN, OUTPUT);
      pinMode(BUTTON_PIN, INPUT_PULLUP);
      
      modeButton.attach(BUTTON_PIN);
      modeButton.interval(5);
}

void moveBuffer() {
  int i;
  byte c = (int) beat[offset] * 255 / beatLength;
  int midPoint = NUM_LEDS_CH1/2;

  // Move current beat intensity from middle to beginning of strip (backward in buffer)
  bufr[midPoint - 1] = c;
  for (i=0;i<midPoint - 1;i++){
    bufr[i] = bufr[i+1];
  }

  // Move current beat intensity from middle to end of strip (forward in buffer)
  bufr[midPoint] = c;
  for (i=NUM_LEDS_CH1 - 1;i>midPoint;i--){
    bufr[i] = bufr[i-1];
  }
}

