#include <MIDI_Inputs/LEDs/NoteCCRangeLEDs.hpp>
Public Member Functions | |
NoteRangeLEDsPWM (const BankConfig< BankSize > &config, const PinList< RangeLen > &ledPins, const MIDICNChannelAddress &address) | |
uint8_t | getBankIndex (const MIDICNChannelAddress &target, const MIDICNChannelAddress &base) const |
Calculate the bank setting of a given MIDI address, relative to a base address. More... | |
uint8_t | getValue (uint8_t index) const final override |
virtual uint8_t | getValue (uint8_t index) const =0 |
Get the velocity or controller value for the given index in the range. More... | |
uint8_t | getValue () const |
Get the velocity or controller value of the first or only note or controller. More... | |
uint8_t | getValue () const |
Get the velocity or controller value of the first or only note or controller. More... | |
void | begin () override |
Initialize. More... | |
void | reset () override |
Reset all values to zero. More... | |
uint8_t | length () const |
Get the length of the range of note/CC addresses. More... | |
virtual void | update () |
Update the value of the input element. Used for decaying VU meters etc. More... | |
bool | updateWith (const ChannelMessageMatcher &midimsg) |
Receive a new MIDI message and update the internal state. More... | |
Static Public Member Functions | |
constexpr static uint8_t | length () |
Get the length of the range. More... | |
static void | beginAll () |
Initialize all MIDIInputElementNote elements. More... | |
static void | updateAll () |
Update all MIDIInputElementNote elements. More... | |
static void | resetAll () |
Reset all MIDIInputElementNote elements to their initial state. More... | |
static void | updateAllWith (const ChannelMessageMatcher &midimsg) |
Update all MIDIInputElementNote elements with a new MIDI message. More... | |
Public Attributes | |
NoteCCLEDPWM< RangeLen > | callback |
Callback that is called when a value in the active bank changes. More... | |
Protected Member Functions | |
uint8_t | getRangeIndex (MIDICNChannelAddress target, MIDICNChannelAddress base) const |
If matchBankableAddressInRange returned true, get the index of the message in the range. More... | |
bool | matchBankable (uint8_t toMatch, uint8_t base) const |
Check if the given address is part of the bank relative to the base address. More... | |
bool | matchBankable (const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base) const |
Check whether a given address is part of the bank relative to the base address. More... | |
bool | matchBankableInRange (uint8_t toMatch, uint8_t base, uint8_t length) const |
Check if the given address is part of the bank relative to the base address. More... | |
bool | matchBankableAddressInRange (const MIDICNChannelAddress &toMatch, const MIDICNChannelAddress &base, uint8_t length) const |
Check whether a given address is part of the bank relative to the base address and within a range with a given length. More... | |
Static Protected Member Functions | |
static bool | inRange (uint8_t toMatch, uint8_t base, uint8_t length) |
Check whether a given address is within a range of given length starting from the given base address. More... | |
Protected Attributes | |
const MIDICNChannelAddress | address |
MIDIInputElementNote * | next |
BankableMIDIInput< N > * | next |
MIDIInputElementNote * | previous |
BankableMIDIInput< N > * | previous |
Private Member Functions | |
bool | match (const MIDICNChannelAddress &target) const override |
Check if the address of the incoming MIDI message is within the range of addresses and in one of the banks of this element. More... | |
setting_t | getSelection () const override |
Get the active bank selection. More... | |
uint8_t | getBankIndex (MIDICNChannelAddress target) const override |
Get the bank index from a MIDI address. More... | |
uint8_t | getRangeIndex (MIDICNChannelAddress target) const override |
Get the index of the given MIDI address in the range. More... | |
void | onBankSettingChange () override |
A function to be executed each time the bank setting changes. More... | |
bool | updateImpl (const ChannelMessageMatcher &midimsg, const MIDICNChannelAddress &target) override |
void | moveDown () |
Move down this element in the linked list of elements. More... | |
virtual MIDICNChannelAddress | getTarget (const ChannelMessageMatcher &midimsg) const |
Extract the target address from a MIDI message. More... | |
Static Private Member Functions | |
static uint8_t | getValueFromMIDIMessage (const ChannelMessageMatcher &midimsg) |
Extract the "value" from a MIDI Note or Control Change message. More... | |
Private Attributes | |
Array< Array< uint8_t, RangeLen >, NumBanks > | values |
A 2D array for saving all values of the range, for all banks. More... | |
uint8_t | rangeLength |
Bank< N > & | bank |
const BankType | type |
Static Private Attributes | |
static DoublyLinkedList< MIDIInputElementNote > | elements |
Definition at line 385 of file NoteCCRangeLEDs.hpp.
|
inline |
Definition at line 388 of file NoteCCRangeLEDs.hpp.
|
inlineoverrideprivatevirtualinherited |
Check if the address of the incoming MIDI message is within the range of addresses and in one of the banks of this element.
Reimplemented from MIDIInputElement.
Definition at line 262 of file NoteCCRange.hpp.
|
inlineoverrideprivatevirtualinherited |
Get the active bank selection.
Reimplemented from NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >.
Definition at line 267 of file NoteCCRange.hpp.
|
inlineoverrideprivatevirtualinherited |
Get the bank index from a MIDI address.
Reimplemented from NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >.
Definition at line 271 of file NoteCCRange.hpp.
|
inlineinherited |
Calculate the bank setting of a given MIDI address, relative to a base address.
target | The MIDI address to calculate the bank setting of. |
base | The base address to compare it to (the address of bank setting 0). |
Definition at line 71 of file BankableMIDIInput.hpp.
|
inlineoverrideprivatevirtualinherited |
Get the index of the given MIDI address in the range.
Reimplemented from NoteCCRange< MIDIInputElementNote, RangeLen, NumBanks, NoteCCLEDPWM< RangeLen > >.
Definition at line 275 of file NoteCCRange.hpp.
|
inlineprotectedinherited |
If matchBankableAddressInRange returned true, get the index of the message in the range.
Definition at line 143 of file BankableMIDIInput.hpp.
|
inlineoverrideprivatevirtualinherited |
A function to be executed each time the bank setting changes.
Think of an LED that indicates whether a track is muted or not. If this LED is bankable, let's say with 4 tracks per bank, 2 banks, and a base address of 3, then this LED object keeps the state of tracks 3 and 7. When the bank setting is 0, the LED displays the state of track 3, when the bank setting is 1, the LED displays the state of track 7.
To know when to update the LED, this callback is used.
Reimplemented from BankableMIDIInput< NumBanks >.
Definition at line 280 of file NoteCCRange.hpp.
|
inlinefinaloverridevirtualinherited |
|
inherited |
Get the velocity or controller value for the given index in the range.
|
inlineinherited |
Get the velocity or controller value of the first or only note or controller.
Definition at line 24 of file NoteCCRange.hpp.
|
inlineinherited |
Get the velocity or controller value of the first or only note or controller.
Definition at line 24 of file NoteCCRange.hpp.
|
inlineoverridevirtualinherited |
|
inlineoverridevirtualinherited |
Reset all values to zero.
Reimplemented from MIDIInputElement.
Definition at line 87 of file NoteCCRange.hpp.
|
inlineoverrideprivatevirtualinherited |
Implements MIDIInputElement.
Definition at line 95 of file NoteCCRange.hpp.
|
inlinestaticprivateinherited |
Extract the "value" from a MIDI Note or Control Change message.
For Note On and Control Change, this is simply the second data byte, for Note Off, it's zero.
Definition at line 120 of file NoteCCRange.hpp.
|
inlinestaticconstexprinherited |
Get the length of the range.
Definition at line 148 of file NoteCCRange.hpp.
|
inlineinherited |
Get the length of the range of note/CC addresses.
Definition at line 19 of file NoteCCRange.hpp.
|
inlinestaticinherited |
Initialize all MIDIInputElementNote elements.
Definition at line 48 of file MIDIInputElementNote.hpp.
|
inlinestaticinherited |
Update all MIDIInputElementNote elements.
Definition at line 59 of file MIDIInputElementNote.hpp.
|
inlinestaticinherited |
Reset all MIDIInputElementNote elements to their initial state.
Definition at line 70 of file MIDIInputElementNote.hpp.
|
inlinestaticinherited |
Update all MIDIInputElementNote elements with a new MIDI message.
Definition at line 82 of file MIDIInputElementNote.hpp.
|
inlineprivateinherited |
Move down this element in the linked list of elements.
This means that the element will be checked earlier on the next iteration.
Definition at line 100 of file MIDIInputElementNote.hpp.
|
inlinevirtualinherited |
Update the value of the input element. Used for decaying VU meters etc.
Reimplemented in VU_Base< NumValues, Callback >, VU_Base< NumBanks, Callback >, VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, VU_Base< NumBanks, VUEmptyCallback >, VU_Base< 1, VUEmptyCallback >, VU_Base< 1, VULEDsCallback< NumLEDs > >, and VU_Base< 1, Callback >.
Definition at line 36 of file MIDIInputElement.hpp.
|
inlineinherited |
Receive a new MIDI message and update the internal state.
Definition at line 39 of file MIDIInputElement.hpp.
|
inlineprivatevirtualinherited |
Extract the target address from a MIDI message.
Reimplemented in VU_Base< NumValues, Callback >, VU_Base< NumBanks, Callback >, VU_Base< NumBanks, VULEDsCallback< NumLEDs > >, VU_Base< NumBanks, VUEmptyCallback >, VU_Base< 1, VUEmptyCallback >, VU_Base< 1, VULEDsCallback< NumLEDs > >, VU_Base< 1, Callback >, MIDIInputElementChannelPressure, and MIDIInputElementPC.
Definition at line 64 of file MIDIInputElement.hpp.
|
inlineprotectedinherited |
Check if the given address is part of the bank relative to the base address.
Consider the following example:
A Bank with 4 tracks per bank (T), 2 bank settings (N), and a base address of 3.
Addresses before the base adddress are not matched (0, 1, 2).
Addresses after N * T are not matched (8, 9, 10, 11, 12).
Addresses with a distance to the base address that is not a multiple of N are not matched (4, 5, 6).
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
matchBankableInRange(toMatch, base, 1)
. Definition at line 113 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
Check whether a given address is part of the bank relative to the base address.
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
Definition at line 175 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
Check if the given address is part of the bank relative to the base address.
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
length | The length of the range. |
Definition at line 132 of file BankableMIDIInput.hpp.
|
inlinestaticprotectedinherited |
Check whether a given address is within a range of given length starting from the given base address.
toMatch | The address to check |
base | The base address, start of the range. |
length | The length of the range. |
Definition at line 162 of file BankableMIDIInput.hpp.
|
inlineprotectedinherited |
Check whether a given address is part of the bank relative to the base address and within a range with a given length.
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
length | The length of the range. |
Definition at line 212 of file BankableMIDIInput.hpp.
A 2D array for saving all values of the range, for all banks.
Definition at line 142 of file NoteCCRange.hpp.
|
inherited |
Callback that is called when a value in the active bank changes.
Definition at line 146 of file NoteCCRange.hpp.
|
staticprivateinherited |
Definition at line 105 of file MIDIInputElementNote.hpp.
|
protectedinherited |
Definition at line 80 of file MIDIInputElement.hpp.
|
protectedinherited |
Definition at line 305 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 305 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 306 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 306 of file LinkedList.hpp.
|
privateinherited |
Definition at line 27 of file NoteCCRange.hpp.
|
privateinherited |
Definition at line 242 of file BankableMIDIInput.hpp.
|
privateinherited |
Definition at line 243 of file BankableMIDIInput.hpp.