It's all working great now!
Thanks again Delta_G.
I've attached the updated code.
(I tried using a for loop to list the cases and whatToDo variables in the MyNoteOnFunction but couldn't get it to work, so for now they're just listed out)
Here's the important part:
#include <MIDI.h> // Add Midi Library
#include <FastLED.h> //include LED library
#define NUM_STRIPS 2
#define NUM_LEDS_DOWNSTAIRS 400
#define NUM_LEDS_UPSTAIRS 276
#define NUM_LEDS NUM_LEDS_UPSTAIRS+NUM_LEDS_DOWNSTAIRS
#define DATA_PIN_DOWNSTAIRS 8
#define DATA_PIN_UPSTAIRS 7
#define LED_TYPE WS2811
#define COLOR_ORDER BRG
#define MASTER_BRIGHTNESS 255
#define FRAMES_PER_SECOND 120
#define STARTING_BRIGHTNESS 64
#define FADE_IN_SPEED 32
#define FADE_OUT_SPEED 20
#define DENSITY 255
MIDI_CREATE_DEFAULT_INSTANCE();
int whatToDo;
CRGB leds[NUM_LEDS];
void setup() {
MIDI.begin(1); //initialize the MIDI library
MIDI.setHandleNoteOn(MyNoteOnFunction); // This command tells the MIDI Library
// the function you want to call when a NoteOn command is received.
FastLED.addLeds<LED_TYPE, DATA_PIN_DOWNSTAIRS, COLOR_ORDER>(leds, 0, NUM_LEDS_DOWNSTAIRS); //for correct LED strips
FastLED.addLeds<LED_TYPE, DATA_PIN_UPSTAIRS, COLOR_ORDER>(leds, NUM_LEDS_DOWNSTAIRS, NUM_LEDS_UPSTAIRS);
setupStripedPalette( CRGB::Red, CRGB::Red, CHSV(20, 200, 255), CHSV(20, 200, 255), CRGB::Green, CRGB::Green);
//above is palette for redGreenWhiteChaser
}
void loop()
{
MIDI.read(); // Continuously check if Midi data has been received.
sequenceChooser();
}
void MyNoteOnFunction(byte channel, byte number, byte value)
{
switch (number)
{
case 0: whatToDo = 0;
break;
case 1: whatToDo = 1;
break;
case 2: whatToDo = 2;
break;
case 3: whatToDo = 3;
break;
case 4: whatToDo = 4;
break;
case 5: whatToDo = 5;
break;
case 6: whatToDo = 6;
break;
case 7: whatToDo = 7;
break;
case 8: whatToDo = 8;
break;
case 9: whatToDo = 9;
break;
case 10: whatToDo = 10;
break;
case 11: whatToDo = 11;
break;
case 12: whatToDo = 12;
break;
case 13: whatToDo = 13;
break;
case 14: whatToDo = 14;
break;
case 15: whatToDo = 15;
break;
case 16: whatToDo = 16;
break;
case 17: whatToDo = 17;
break;
case 18: whatToDo = 18;
break;
case 19: whatToDo = 19;
break;
case 20: whatToDo = 20;
break;
case 21: whatToDo = 21;
break;
case 22: whatToDo = 22;
break;
case 23: whatToDo = 23;
break;
case 24: whatToDo = 24;
break;
case 25: whatToDo = 25;
break;
case 26: whatToDo = 26;
break;
case 27: whatToDo = 27;
break;
case 28: whatToDo = 28;
break;
case 29: whatToDo = 29;
break;
case 30: whatToDo = 30;
break;
case 31: whatToDo = 31;
break;
case 32: whatToDo = 32;
break;
case 33: whatToDo = 33;
break;
case 34: whatToDo = 34;
break;
case 35: whatToDo = 35;
break;
case 36: whatToDo = 36;
break;
case 37: whatToDo = 37;
break;
case 38: whatToDo = 38;
break;
case 39: whatToDo = 39;
break;
case 40: whatToDo = 40;
break;
}
}
void sequenceChooser()
{
switch (whatToDo)
{
case 0:
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
break;
case 1:
fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
break;
case 2:
fill_solid(leds, NUM_LEDS, CRGB::Green);
FastLED.show();
break;
case 3:
fill_solid(leds, NUM_LEDS, CRGB::Blue);
FastLED.show();
break;
case 4:
fill_solid(leds, NUM_LEDS, CRGB::Orange);
FastLED.show();
break;
case 5:
fill_solid(leds, NUM_LEDS, CRGB::Cyan);
FastLED.show();
break;
case 6:
fill_solid(leds, NUM_LEDS, CRGB::Purple);
FastLED.show();
break;
case 7:
fill_solid(leds, NUM_LEDS, CRGB::White);
FastLED.show();
break;
case 8:
fill_solid(leds, NUM_LEDS, CHSV(20, 200, 255));
FastLED.show();
break;
case 9:
break;
case 10:
break;
case 11:
break;
case 12:
FastLED.setBrightness(150); //use to dim existing scene
break;
case 13:
fill_solid(leds, NUM_LEDS, CRGB(100, 0, 255));
FastLED.show();
break;
case 14:
break;
case 15:
break;
case 16:
break;
case 17:
break;
case 18:
break;
case 19:
break;
case 20:
rainbow();
break;
case 21:
rainbowWithGlitter();
FastLED.show();
break;
case 22:
confetti();
FastLED.show();
break;
case 23:
bpm();
FastLED.show();
break;
case 24:
juggle();
FastLED.show();
break;
case 25:
sinelon();
FastLED.show();
break;
case 26:
chooseColorPalette();
colortwinkles();
FastLED.show();
break;
case 27:
redGreenWhiteChaser();
FastLED.show();
break;
case 28:
snowColorPalette();
colortwinkles();
FastLED.show();
break;
case 29:
rgwPalette();
colortwinkles();
FastLED.show();
break;
case 30:
blueWhitePalette();
colortwinkles();
FastLED.show();
break;
case 31:
Sparkle();
FastLED.show();
break;
case 32:
hotSpotsBlue();
FastLED.show();
break;
case 33:
poinsettiasRed();
FastLED.show();
break;
case 34:
fill_solid(leds, NUM_LEDS, CRGB::Black);
poinsettiasPoles();
FastLED.show();
break;
case 35:
angelsBlue();
FastLED.show();
break;
case 36:
classicChristmas();
FastLED.show();
break;
case 37:
fill_solid(leds, NUM_LEDS, CRGB::Black);
poleAngelRotatingHue();
FastLED.show();
break;
}
}
Christmas_2015_Beta_3.ino (17 KB)