Functions | |
bool | inRange (uint8_t tgt, uint8_t base, uint8_t length) |
Check whether a given address is within a range of given length starting from the given base address. | |
template<uint8_t BankSize> | |
bool | matchBankable (uint8_t tgt, uint8_t base, const Bank< BankSize > &bank) |
Check if the given address is part of the bank relative to the base address. | |
template<uint8_t BankSize> | |
bool | matchBankableInRange (uint8_t tgt, uint8_t base, const Bank< BankSize > &bank, uint8_t rangeLen) |
template<uint8_t BankSize> | |
uint8_t | getRangeIndex (uint8_t tgt, uint8_t base, const Bank< BankSize > &bank) |
template<uint8_t BankSize> | |
uint8_t | getBankIndex (uint8_t tgt, uint8_t base, const Bank< BankSize > &bank) |
template<uint8_t BankSize> | |
bool | matchBankable (MIDIAddress tgt, MIDIAddress base, BaseBankConfig< BankSize > config) |
Check whether a given address is part of the bank relative to the base address. | |
template<uint8_t BankSize> | |
bool | matchBankableInRange (MIDIAddress tgt, MIDIAddress base, BaseBankConfig< BankSize > config, uint8_t length) |
Check whether a given address is part of the bank relative to the base address and within a range with a given length. | |
template<uint8_t BankSize> | |
uint8_t | getBankIndex (MIDIAddress target, MIDIAddress base, BaseBankConfig< BankSize > config) |
Calculate the bank setting of a given MIDI address, relative to a base address. | |
template<uint8_t BankSize> | |
uint8_t | getRangeIndex (MIDIAddress tgt, MIDIAddress base, BaseBankConfig< BankSize > config) |
Calculate the index in the address range of a given MIDI address, relative to a base address. | |
|
inline |
Check whether a given address is within a range of given length starting from the given base address.
tgt | The address to check |
base | The base address, start of the range. |
length | The length of the range. |
Definition at line 22 of file BankableMIDIMatcherHelpers.hpp.
bool matchBankable | ( | uint8_t | tgt, |
uint8_t | base, | ||
const Bank< BankSize > & | bank ) |
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).
tgt | The address to check. |
base | The base address (the address of bank setting 0). |
bank | The bank to match the address in. |
matchBankableInRange(toMatch, base, 1)
. Definition at line 54 of file BankableMIDIMatcherHelpers.hpp.
bool matchBankableInRange | ( | uint8_t | tgt, |
uint8_t | base, | ||
const Bank< BankSize > & | bank, | ||
uint8_t | rangeLen ) |
Definition at line 68 of file BankableMIDIMatcherHelpers.hpp.
uint8_t getRangeIndex | ( | uint8_t | tgt, |
uint8_t | base, | ||
const Bank< BankSize > & | bank ) |
Definition at line 84 of file BankableMIDIMatcherHelpers.hpp.
uint8_t getBankIndex | ( | uint8_t | tgt, |
uint8_t | base, | ||
const Bank< BankSize > & | bank ) |
Definition at line 95 of file BankableMIDIMatcherHelpers.hpp.
bool matchBankable | ( | MIDIAddress | tgt, |
MIDIAddress | base, | ||
BaseBankConfig< BankSize > | config ) |
Check whether a given address is part of the bank relative to the base address.
tgt | The address to check. |
base | The base address (the address of bank setting 0). |
config | The bank configuration. |
Definition at line 116 of file BankableMIDIMatcherHelpers.hpp.
bool matchBankableInRange | ( | MIDIAddress | tgt, |
MIDIAddress | base, | ||
BaseBankConfig< BankSize > | config, | ||
uint8_t | length ) |
Check whether a given address is part of the bank relative to the base address and within a range with a given length.
tgt | The address to check. |
base | The base address (the address of bank setting 0). |
config | The bank configuration. |
length | The length of the range. |
Definition at line 157 of file BankableMIDIMatcherHelpers.hpp.
uint8_t getBankIndex | ( | MIDIAddress | target, |
MIDIAddress | base, | ||
BaseBankConfig< BankSize > | config ) |
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). |
config | The bank configuration to determine the index. |
Definition at line 193 of file BankableMIDIMatcherHelpers.hpp.
uint8_t getRangeIndex | ( | MIDIAddress | tgt, |
MIDIAddress | base, | ||
BaseBankConfig< BankSize > | config ) |
Calculate the index in the address range of a given MIDI address, relative to a base address.
tgt | The MIDI address to calculate the bank setting of. |
base | The base address to compare it to (beginning of the range for bank setting 0). |
config | The bank configuration to determine the index. |
Definition at line 222 of file BankableMIDIMatcherHelpers.hpp.