A class for MIDI input elements that represent Mackie Control Universal V-Pots.
More...
#include <MIDI_Inputs/MCU/VPotRing.hpp>
|
static uint8_t | sanitizeValue (uint8_t value) |
| Make sure that the received value is valid and will not result in array out of bounds conditions. More...
|
|
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...
|
|
|
static uint8_t | getPosition (uint8_t value) |
| Extract the position from the raw value. More...
|
|
static bool | getCenterLed (uint8_t value) |
| Extract the center LED state from the raw value. More...
|
|
static uint8_t | getMode (uint8_t value) |
| Extract the mode from the raw value. More...
|
|
template<uint8_t NumBanks>
class MCU::Bankable::VPotRing< NumBanks >
A class for MIDI input elements that represent Mackie Control Universal V-Pots.
This version can be banked.
- Template Parameters
-
NumBanks | The number of banks. |
- Examples
- MCU-OLED-SSD1306-MEGA.ino, MCU-OLED-SSD1306-x2.ino, and MCU-OLED-SSD1306.ino.
Definition at line 213 of file VPotRing.hpp.
◆ VPotRing()
◆ getSelection()
|
inlineoverrideprivatevirtualinherited |
◆ getBankIndex() [1/2]
|
inlineoverrideprivatevirtualinherited |
◆ getBankIndex() [2/2]
Calculate the bank setting of a given MIDI address, relative to a base address.
- Parameters
-
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.
◆ match()
|
inlineoverrideprivatevirtualinherited |
Check if the address of the incoming MIDI message is in one of the banks of this element.
Reimplemented from MIDIInputElement.
Definition at line 196 of file VPotRing.hpp.
◆ onBankSettingChange()
void onBankSettingChange |
( |
| ) |
|
|
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 201 of file VPotRing.hpp.
◆ begin()
|
inlineoverridevirtualinherited |
◆ reset()
|
inlineoverridevirtualinherited |
◆ sanitizeValue()
static uint8_t sanitizeValue |
( |
uint8_t |
value | ) |
|
|
inlinestaticprotectedinherited |
Make sure that the received value is valid and will not result in array out of bounds conditions.
Definition at line 105 of file VPotRing.hpp.
◆ updateImpl()
|
inlineoverrideprivatevirtualinherited |
◆ getValue()
uint8_t getValue |
( |
| ) |
const |
|
inlineoverrideprivatevirtualinherited |
◆ beginAll()
◆ updateAll()
static void updateAll |
( |
| ) |
|
|
inlinestaticinherited |
◆ resetAll()
◆ updateAllWith()
◆ moveDown()
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 92 of file MIDIInputElementCC.hpp.
◆ update()
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.
◆ updateWith()
◆ getTarget()
|
inlineprivatevirtualinherited |
Extract the target address from a MIDI message.
- Note
- This base version of the function is only valid for messages that use data1 as an address (i.e. Note On, Note Off, Polyphonic Key Pressure and Control Change), because it assumes that the target address consists of the address (data 1), the MIDI channel and the cable number.
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.
◆ getPosition() [1/2]
uint8_t getPosition |
( |
| ) |
const |
|
inlineinherited |
Return the position of the V-Pot ring. [0, 11].
Definition at line 32 of file VPotRing.hpp.
◆ getPosition() [2/2]
static uint8_t getPosition |
( |
uint8_t |
value | ) |
|
|
inlinestaticprivateinherited |
Extract the position from the raw value.
Definition at line 72 of file VPotRing.hpp.
◆ getCenterLed() [1/2]
bool getCenterLed |
( |
| ) |
const |
|
inlineinherited |
Return the status of the center LED of the V-Pot ring.
Definition at line 34 of file VPotRing.hpp.
◆ getCenterLed() [2/2]
static bool getCenterLed |
( |
uint8_t |
value | ) |
|
|
inlinestaticprivateinherited |
Extract the center LED state from the raw value.
Definition at line 77 of file VPotRing.hpp.
◆ getMode() [1/2]
uint8_t getMode |
( |
| ) |
const |
|
inlineinherited |
Return the mode of the V-Pot ring: 0 = single dot, 1 = boost/cut, 2 = wrap, 3 = spread.
Definition at line 37 of file VPotRing.hpp.
◆ getMode() [2/2]
static uint8_t getMode |
( |
uint8_t |
value | ) |
|
|
inlinestaticprivateinherited |
Extract the mode from the raw value.
Definition at line 79 of file VPotRing.hpp.
◆ getStartOn()
uint8_t getStartOn |
( |
| ) |
const |
|
inlineinherited |
Get the first segment that should be on.
Definition at line 40 of file VPotRing.hpp.
◆ getStartOff()
uint8_t getStartOff |
( |
| ) |
const |
|
inlineinherited |
Get the first segment that should be off.
Definition at line 56 of file VPotRing.hpp.
◆ matchBankable() [1/2]
bool matchBankable |
( |
uint8_t |
toMatch, |
|
|
uint8_t |
base |
|
) |
| const |
|
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.
0 1 2 3 4 5 6 7 8 9 10 11 12 ...
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).
- Parameters
-
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
- Note
- Equivalent to
matchBankableInRange(toMatch, base, 1)
.
Definition at line 113 of file BankableMIDIInput.hpp.
◆ matchBankable() [2/2]
Check whether a given address is part of the bank relative to the base address.
- Parameters
-
toMatch | The address to check. |
base | The base address (the address of bank setting 0). |
Definition at line 175 of file BankableMIDIInput.hpp.
◆ matchBankableInRange()
bool matchBankableInRange |
( |
uint8_t |
toMatch, |
|
|
uint8_t |
base, |
|
|
uint8_t |
length |
|
) |
| const |
|
inlineprotectedinherited |
Check if the given address is part of the bank relative to the base address.
- Todo:
- This is very hard to explain without a specific example ...
- Parameters
-
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.
◆ getRangeIndex()
If matchBankableAddressInRange returned true, get the index of the message in the range.
Definition at line 143 of file BankableMIDIInput.hpp.
◆ inRange()
static bool inRange |
( |
uint8_t |
toMatch, |
|
|
uint8_t |
base, |
|
|
uint8_t |
length |
|
) |
| |
|
inlinestaticprotectedinherited |
Check whether a given address is within a range of given length starting from the given base address.
- Parameters
-
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.
◆ matchBankableAddressInRange()
Check whether a given address is part of the bank relative to the base address and within a range with a given length.
- Parameters
-
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.
◆ values
Array<uint8_t, NumValues> values |
|
privateinherited |
◆ callback
◆ elements
◆ address
◆ next [1/2]
◆ next [2/2]
◆ previous [1/2]
◆ previous [2/2]
◆ bank
◆ type
The documentation for this class was generated from the following file: