A class for MIDI input elements that represent Mackie Control Universal VU meters.
More...
#include <MIDI_Inputs/MCU/VU.hpp>
|
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...
|
|
template<uint8_t NumBanks>
class MCU::Bankable::VU< NumBanks >
A class for MIDI input elements that represent Mackie Control Universal VU meters.
- 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 353 of file VU.hpp.
◆ VU() [1/2]
Construct a new Bankable VU object.
- Parameters
-
config | The bank configuration to use. |
track | The track of the VU meter. [1, 8] |
channelCN | The MIDI channel [CHANNEL_1, CHANNEL_16] and optional Cable Number [0, 15]. |
decayTime | The time in milliseconds it takes for the value to decay one step.
The MCU protocol uses 300 ms per division, and two steps per division, so the default is 150 ms per step.
Some software doesn't work if the VU meter decays automatically, in that case, you can set the decay time to zero to disable the decay. |
Definition at line 374 of file VU.hpp.
◆ VU() [2/2]
Construct a new Bankable VU object.
- Parameters
-
config | The bank configuration to use. |
track | The track of the VU meter. [1, 8] |
decayTime | The time in milliseconds it takes for the value to decay one step.
The MCU protocol uses 300 ms per division, and two steps per division, so the default is 150 ms per step.
Some software doesn't work if the VU meter decays automatically, in that case, you can set the decay time to zero to disable the decay. |
Definition at line 397 of file VU.hpp.
◆ 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 335 of file VU.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 340 of file VU.hpp.
◆ begin()
|
inlineoverridevirtualinherited |
◆ reset()
|
inlineoverridevirtualinherited |
◆ getValue() [1/2]
|
inlineoverridevirtualinherited |
Return the VU meter value as an integer in [0, 12].
Implements IVU.
Definition at line 95 of file VU.hpp.
◆ getValue() [2/2]
uint8_t getValue |
( |
uint8_t |
index | ) |
const |
|
inlineprivateinherited |
Get the VU meter value from the raw value.
Definition at line 161 of file VU.hpp.
◆ getOverload() [1/2]
|
inlineoverridevirtualinherited |
Return the overload status.
Implements IVU.
Definition at line 97 of file VU.hpp.
◆ getOverload() [2/2]
bool getOverload |
( |
uint8_t |
index | ) |
const |
|
inlineprivateinherited |
Get the overload status value from the raw value.
Definition at line 163 of file VU.hpp.
◆ update()
|
inlineoverridevirtualinherited |
Update is called periodically, it decays the meter if the time is right.
Reimplemented from MIDIInputElement.
Definition at line 100 of file VU.hpp.
◆ updateImpl()
|
inlineoverrideprivatevirtualinherited |
Called when an incoming MIDI message matches this element.
Implements MIDIInputElement.
Definition at line 110 of file VU.hpp.
◆ getTarget()
|
inlineoverrideprivatevirtualinherited |
◆ decay()
◆ setValue()
void setValue |
( |
uint8_t |
index, |
|
|
uint8_t |
newValue |
|
) |
| |
|
inlineprivateinherited |
Set the VU meter value.
Definition at line 151 of file VU.hpp.
◆ setOverload()
void setOverload |
( |
uint8_t |
index | ) |
|
|
inlineprivateinherited |
Set the overload status.
Definition at line 157 of file VU.hpp.
◆ clearOverload()
void clearOverload |
( |
uint8_t |
index | ) |
|
|
inlineprivateinherited |
Clear the overload status.
Definition at line 159 of file VU.hpp.
◆ beginAll()
◆ resetAll()
◆ updateAll()
static void updateAll |
( |
| ) |
|
|
inlinestaticinherited |
◆ 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 96 of file MIDIInputElementChannelPressure.hpp.
◆ updateWith()
◆ getFloatValue()
virtual float getFloatValue |
( |
| ) |
|
|
inlinevirtualinherited |
Get the VU meter value as a floating point number.
Reimplemented in AudioVU.
Definition at line 28 of file VU.hpp.
◆ getMax()
Get the maximum value that this VU meter can return.
Definition at line 30 of file VU.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 |
◆ decayTime
◆ prevDecayTime
unsigned long prevDecayTime |
|
privateinherited |
◆ callback
◆ elements
◆ address
◆ next [1/2]
◆ next [2/2]
◆ previous [1/2]
◆ previous [2/2]
◆ max
◆ bank
◆ type
The documentation for this class was generated from the following file: