MIDI Control Surface library for Arduino
|
Go to the documentation of this file. 1 #if defined(ARDUINO) && defined(FASTLED_VERSION)
5 #include <Settings/NamespaceSettings.hpp>
15 #ifdef FASTLED_VERSION
16 explicit operator CRGB()
const {
return CRGB{
r,
g,
b}; }
29 #ifdef FASTLED_VERSION
40 template <
class ColorMapper>
85 uint8_t value = input.
getValue(index);
135 template <u
int8_t RangeLen,
class ColorMapper = DefaultColorMapper>
138 NoteCCFastLEDCallback<ColorMapper>> {
157 const ColorMapper &colormapper = {})
161 {leds.
data, colormapper},
181 const ColorMapper &colormapper = {})
190 this->
callback.setBrightness(brightness);
196 this->
callback.setLEDIndexPermuter(permuter);
200 template <
class ColorMapper = DefaultColorMapper>
203 NoteCCFastLEDCallback<ColorMapper>> {
206 const ColorMapper &colormapper = {})
215 this->
callback.setBrightness(brightness);
221 template <u
int8_t RangeLen,
class ColorMapper = DefaultColorMapper>
224 NoteCCFastLEDCallback<ColorMapper>> {
228 const ColorMapper &colormapper = {})
232 {leds.
data, colormapper},
236 const ColorMapper &colormapper = {})
245 this->
callback.setBrightness(brightness);
251 this->
callback.setLEDIndexPermuter(permuter);
255 template <
class ColorMapper = DefaultColorMapper>
258 NoteCCFastLEDCallback<ColorMapper>> {
261 const ColorMapper &colormapper = {})
270 this->
callback.setBrightness(brightness);
283 template <uint8_t RangeLen, uint8_t BankSize,
287 NoteCCFastLEDCallback<ColorMapper>> {
291 const ColorMapper &colormapper = {})
296 {leds.
data, colormapper},
301 const ColorMapper &colormapper = {})
311 this->
callback.setBrightness(brightness);
317 this->
callback.setLEDIndexPermuter(permuter);
321 template <u
int8_t BankSize,
class ColorMapper = DefaultColorMapper>
324 NoteCCFastLEDCallback<ColorMapper>> {
328 const ColorMapper &colormapper = {})
338 this->
callback.setBrightness(brightness);
344 template <uint8_t RangeLen, uint8_t BankSize,
348 NoteCCFastLEDCallback<ColorMapper>> {
352 const ColorMapper &colormapper = {})
357 {leds.
data, colormapper},
362 const ColorMapper &colormapper = {})
372 this->
callback.setBrightness(brightness);
378 this->
callback.setLEDIndexPermuter(permuter);
382 template <u
int8_t BankSize,
class ColorMapper = DefaultColorMapper>
385 NoteCCFastLEDCallback<ColorMapper>> {
389 const ColorMapper &colormapper = {})
399 this->
callback.setBrightness(brightness);
The default mapping from a 7-bit MIDI value to an RGB color.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
NoteRangeFastLED(Array< CRGB, RangeLen > &leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
Construct a new NoteRangeFastLED object.
void update(const INoteCCValue &input, uint8_t index) override
Update the given index: called when a new message is received for this index.
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
virtual void updateAll(const INoteCCValue ¬eccval)
Update all values: called when a bank change causes all values to (possibly) change,...
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
Interface for NoteCCValue objects: provides getters for the velocity or controller values.
void setLEDIndexPermuter(index_permuter_f permuter)
Change the mapping from the MIDI index to the LED index.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
Callback for Note or CC range or value input that displays the value to a FastLED strip.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
MIDI Input Element that listens for MIDI Note messages in a given range, and displays their values us...
A callback for NoteCCRange with an action that can be implemented by the user.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
uint8_t(*)(uint8_t) index_permuter_f
Function pointer type to permute indices.
#define BEGIN_CS_NAMESPACE
CCValueFastLED(BankConfig< BankSize > config, CRGB &led, MIDICNChannelAddress address, const ColorMapper &colormapper={})
void setLEDIndexPermuter(index_permuter_f permuter)
Change the mapping from the MIDI index to the LED index.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
void setLEDIndexPermuter(index_permuter_f permuter)
Change the mapping from the MIDI index to the LED index.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
NoteCCFastLEDCallback< ColorMapper > callback
Callback that is called when a value in the active bank changes.
NoteRangeFastLED(CRGB *leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
Construct a new NoteRangeFastLED object.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
An array wrapper for easy copying, comparing, and iterating.
CCRangeFastLED(Array< CRGB, RangeLen > &leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
NoteValueFastLED(CRGB &led, MIDICNChannelAddress address, const ColorMapper &colormapper={})
CCRangeFastLED(BankConfig< BankSize > config, Array< CRGB, RangeLen > &leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
NoteValueFastLED(BankConfig< BankSize > config, CRGB &led, MIDICNChannelAddress address, const ColorMapper &colormapper={})
Color operator()(uint8_t value, uint8_t index) const
Map from a 7-bit MIDI value to an RGB color.
index_permuter_f ledIndexPermuter
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
static uint8_t identityPermuter(uint8_t i)
CCValueFastLED(CRGB &led, MIDICNChannelAddress address, const ColorMapper &colormapper={})
virtual uint8_t getValue(uint8_t index) const =0
Get the velocity or controller value for the given index in the range.
void setLEDIndexPermuter(index_permuter_f permuter)
Change the mapping from the MIDI index to the LED index.
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
NoteRangeFastLED(BankConfig< BankSize > config, CRGB *leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
CCRangeFastLED(BankConfig< BankSize > config, CRGB *leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
A struct for selecting the bank of BankableMIDIInputs and the bank type.
void setLEDIndexPermuter(index_permuter_f permuter)
Change the mapping from the MIDI index to the LED index.
NoteRangeFastLED(BankConfig< BankSize > config, Array< CRGB, RangeLen > &leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
NoteCCFastLEDCallback(CRGB *ledcolors, const ColorMapper &colormapper, index_permuter_f index_permuter)
void begin(const INoteCCValue &input) override
Initialize: called once.
A structure for RGB colors.
CCRangeFastLED(CRGB *leds, MIDICNChannelAddress address, const ColorMapper &colormapper={})
NoteCCFastLEDCallback(CRGB *ledcolors, const ColorMapper &colormapper)
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.