Combining a transposer and a bank to switch between different scales.
namespace ManyAddresses {
template <uint8_t NumAddr>
class ManyAddressBank {
public:
ManyAddressBank(const ManyAddresses<NumAddr> &manyaddresses,
: manyaddresses(manyaddresses), bank(bank) {}
void lock() { manyaddresses.lock(), bank.lock(); }
void unlock() { manyaddresses.unlock(), bank.unlock(); }
return manyaddresses.getActiveAddress() + bank.getAddressOffset();
}
private:
ManyAddresses<NumAddr> manyaddresses;
};
template <uint8_t NumAddr>
class ManyAddressBankNoteButton
:
public MIDIButton<ManyAddressBank<NumAddr>, DigitalNoteSender> {
public:
ManyAddressBankNoteButton(const ManyAddresses<NumAddr> &manyaddresses,
{manyaddresses, bank}, pin, sender) {}
};
}
}
The main header file that includes all Control-Surface header files.
#define BEGIN_CS_NAMESPACE
A struct for selecting the bank of BankableMIDIOutputs and the bank type.
Class that sends MIDI note on and off messages.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
A base class for all MIDIOutputElements that can be banked.
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
#include "ManyAddressBankNoteButton.hpp"
transposer,
{A0, A1},
};
scaleBank,
{A2, A3},
};
Bankable::ManyAddresses::ManyAddressBankNoteButton<2> buttons[] {
{
transposer,
2,
},
{
transposer,
3,
},
{
transposer,
4,
},
};
void setup() {
}
void loop() {
}
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
@ Clamp
When the maximum (minimum) setting is reached, clamp to the maximum (minimum) setting.
A class that groups Bankable MIDI Output Elements and Bankable MIDI Input Elements,...
void begin()
Initialize the Control_Surface.
void loop()
Update all MIDI elements, send MIDI events and read MIDI input.
Selector with two buttons (one to increment, one to decrement).
Class for transposing the address of NoteButton and other MIDI elements.
A class for debug MIDI interfaces sending and receiving human-readable MIDI messages over the USB CDC...
constexpr Note Db
C♯, D♭ (Do sharp, Re flat)
constexpr Note Gb
F♯, G♭ (Fa sharp, Sol flat)
constexpr Note Ab
G♯, A♭ (Sol sharp, La flat)