1#if defined(ARDUINO) && defined(FASTLED_VERSION)
5#include <AH/STL/type_traits>
6#include <Settings/NamespaceSettings.hpp>
60template <MIDIMessageType Type, u
int8_t RangeLen,
class ColorMapper>
90 template <
class ColorMapper_ = ColorMapper>
92 typename std::enable_if<std::is_default_constructible<
98 template <
class ColorMapper_ = ColorMapper>
101 typename std::enable_if<std::is_default_constructible<
202template <u
int8_t RangeLen,
class ColorMapper = DefaultColorMapper>
220template <
class ColorMapper = DefaultColorMapper>
240template <u
int8_t RangeLen,
class ColorMapper = DefaultColorMapper>
259template <
class ColorMapper = DefaultColorMapper>
279template <u
int8_t RangeLen,
class ColorMapper = DefaultColorMapper>
297template <
class ColorMapper = DefaultColorMapper>
366 template <
class ColorMapper_ = ColorMapper>
369 typename std::enable_if<std::is_default_constructible<
373 template <
class ColorMapper_ = ColorMapper>
377 typename std::enable_if<std::is_default_constructible<
406 bool newdirty = Parent::handleUpdateImpl(match);
408 updateLED(match.bankIndex, match.index, match.value);
409 this->
dirty |= newdirty;
436 Parent::onBankSettingChange();
479template <u
int8_t BankSize,
class ColorMapper = DefaultColorMapper>
489template <u
int8_t BankSize,
class ColorMapper = DefaultColorMapper>
499template <u
int8_t BankSize,
class ColorMapper = DefaultColorMapper>
MIDIMessageType
All possible MIDI status byte values (without channel).
@ KeyPressure
Key Pressure Channel Voice message (3B).
@ NoteOn
Note On Channel Voice message (3B).
@ ControlChange
Control Change Channel Voice message (3B).
Color velocityToNovationColor(uint8_t value)
The default mapping from a 7-bit MIDI value to an RGB color, using the Novation Launchpad mapping.
Color velocityToNovationColor(uint8_t value)
The default mapping from a 7-bit MIDI value to an RGB color, using the Novation Launchpad mapping.
#define BEGIN_CS_NAMESPACE
Generic base class for classes that listen for MIDI Note, Control Change and Key Pressure events on a...
void setBrightness(uint8_t brightness)
Set the maximum brightness of the LEDs.
NoteCCKPRangeFastLED(BankConfig< BankSize > config, AH::Array< CRGB, RangeLen > &ledcolors, MIDIAddress address, const ColorMapper &colormapper)
void setLEDIndexPermuter(index_permuter_f permuter)
Change the mapping from the MIDI index to the LED index.
NoteCCKPRangeFastLED(BankConfig< BankSize > config, AH::Array< CRGB, RangeLen > &ledcolors, MIDIAddress address, const ColorMapper &colormapper, index_permuter_f index_permuter)
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
void updateLED(uint8_t bankIndex, uint8_t index, uint8_t value)
void onBankSettingChange() override
A function to be executed each time the bank setting changes.
void begin() override
Initialize the input element.
NoteCCKPRangeFastLED(BankConfig< BankSize > config, AH::Array< CRGB, RangeLen > &ledcolors, MIDIAddress address, typename std::enable_if< std::is_default_constructible< ColorMapper_ >::value >::type *=nullptr)
NoteCCKPRangeFastLED(BankConfig< BankSize > config, CRGB *ledcolors, MIDIAddress address, typename std::enable_if< std::is_default_constructible< ColorMapper_ >::value >::type *=nullptr)
index_permuter_f ledIndexPermuter
static uint8_t identityPermuter(uint8_t i)
NoteCCKPRangeFastLED(BankConfig< BankSize > config, CRGB *ledcolors, MIDIAddress address, const ColorMapper &colormapper)
void handleUpdate(typename Matcher::Result match) override
typename Parent::Matcher Matcher
NoteCCKPRangeFastLED(BankConfig< BankSize > config, CRGB *ledcolors, MIDIAddress address, const ColorMapper &colormapper, index_permuter_f index_permuter)
void reset() override
Reset all values to zero.
Generic base class for classes that listen for MIDI Note, Control Change and Key Pressure events on a...
uint8_t getValue(uint8_t index) const
Get the most recent MIDI value that was received for the active bank.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Generic base class for classes that listen for MIDI Note, Control Change and Key Pressure events on a...
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.
NoteCCKPRangeFastLED(CRGB *ledcolors, MIDIAddress address, const ColorMapper &colormapper, index_permuter_f index_permuter)
NoteCCKPRangeFastLED(AH::Array< CRGB, RangeLen > &ledcolors, MIDIAddress address, const ColorMapper &colormapper)
NoteCCKPRangeFastLED(AH::Array< CRGB, RangeLen > &ledcolors, MIDIAddress address, typename std::enable_if< std::is_default_constructible< ColorMapper_ >::value >::type *=nullptr)
uint8_t getBrightness() const
Get the maximum brightness of the LEDs.
bool getDirty() const
Check if the colors changed since the last time the dirty flag was cleared.
NoteCCKPRangeFastLED(CRGB *ledcolors, MIDIAddress address, const ColorMapper &colormapper)
void begin() override
Initialize the input element.
NoteCCKPRangeFastLED(CRGB *ledcolors, MIDIAddress address, typename std::enable_if< std::is_default_constructible< ColorMapper_ >::value >::type *=nullptr)
index_permuter_f ledIndexPermuter
NoteCCKPRangeFastLED(AH::Array< CRGB, RangeLen > &ledcolors, MIDIAddress address, const ColorMapper &colormapper, index_permuter_f index_permuter)
static uint8_t identityPermuter(uint8_t i)
void handleUpdate(typename Matcher::Result match) override
void reset() override
Reset the input element to its initial state.
void clearDirty()
Clear the dirty flag.
void updateLED(uint8_t index, uint8_t value)
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
An array wrapper for easy copying, comparing, and iterating.
The default mapping from a 7-bit MIDI value to an RGB color, using the Novation Launchpad mapping.
CRGB operator()(uint8_t value, uint8_t bankIndex, uint8_t index) const
Map from a 7-bit MIDI value to an RGB color, using the Novation Launchpad mapping.
A structure for RGB colors.
The default mapping from a 7-bit MIDI value to an RGB color, using the Novation Launchpad mapping.
CRGB operator()(uint8_t value, uint8_t index) const
Map from a 7-bit MIDI value to an RGB color, using the Novation Launchpad mapping.
Matcher for MIDI messages with 2 data bytes, such as Note On/Off, Control Change, Key Pressure (but n...