This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Basic MIDI Visualizer | |
* by David Madison © 2017 | |
* www.partsnotincluded.com | |
* | |
* This is a basic MIDI visualizer using addressable LEDs, to demonstrate how | |
* Arduino's MIDI library works. Playing a note turns an LED on, stopping a note | |
* turns the LED off. Continuous controllers 21, 22, and 23 adjust the RGB color. | |
* | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Slightly modified Adalight protocol implementation that uses FastLED | |
// library (http://fastled.io) for driving WS2811/WS2812 led stripe | |
// Was tested only with Prismatik software from Lightpack project | |
#include "FastLED.h" | |
#define NUM_LEDS 114 // Max LED count | |
#define LED_PIN 6 // arduino output pin | |
#define GROUND_PIN 10 | |
#define BRIGHTNESS 255 // maximum brightness |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t blendRGB(uint32_t c1, uint32_t c2, uint8_t p){ | |
/* Blends two RGB color values using a linear algorithm | |
* in the form of y = mx + b. | |
* | |
* Where y is the resultant blended color (per channel), m | |
* is the slope of the color change divided by the number of steps, | |
* x is the current step, and b is the initial channel value. | |
* | |
* This implementation uses a single byte for gradation, giving steps from 0-255. | |
*/ |