Control Surface pin-t-adl
MIDI Control Surface library for Arduino
ManyAddresses/NoteButtonMatrix.hpp
Go to the documentation of this file.
1#pragma once
2
6
8
9namespace Bankable {
10namespace ManyAddresses {
11
32template <setting_t NumBanks, uint8_t NumRows, uint8_t NumCols>
34 : public MIDIButtonMatrix<ManyMatrixAddresses<NumBanks, NumRows, NumCols>,
35 DigitalNoteSender, NumRows, NumCols> {
36 public:
63 const Bank<NumBanks> &bank, const PinList<NumRows> &rowPins,
64 const PinList<NumCols> &colPins,
65 const Array<AddressMatrix<NumRows, NumCols>, NumBanks> &notes,
66 const Array<MIDIChannelCable, NumBanks> &channelCNs,
67 uint8_t velocity = 0x7F)
68 : MIDIButtonMatrix<ManyMatrixAddresses<NumBanks, NumRows, NumCols>,
69 DigitalNoteSender, NumRows, NumCols>{
70 {bank, notes, channelCNs},
71 rowPins,
72 colPins,
73 {velocity},
74 } {}
75
77 void setVelocity(uint8_t velocity) { this->sender.setVelocity(velocity); }
79 uint8_t getVelocity() const { return this->sender.getVelocity(); }
80};
81
82} // namespace ManyAddresses
83} // namespace Bankable
84
Array2D< uint8_t, NumRows, NumCols > AddressMatrix
Definition: Def.hpp:30
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class that groups Bankable MIDI Output Elements and Bankable MIDI Input Elements,...
Definition: Bank.hpp:91
A class of MIDIOutputElements that read the input from a matrix of momentary push buttons or switches...
void setVelocity(uint8_t velocity)
Set the velocity of the MIDI Note events.
uint8_t getVelocity() const
Get the velocity of the MIDI Note events.
NoteButtonMatrix(const Bank< NumBanks > &bank, const PinList< NumRows > &rowPins, const PinList< NumCols > &colPins, const Array< AddressMatrix< NumRows, NumCols >, NumBanks > &notes, const Array< MIDIChannelCable, NumBanks > &channelCNs, uint8_t velocity=0x7F)
Create a new Bankable NoteButtonMatrix object with the given pins, controller numbers and channel.
Class that sends MIDI note on and off messages.
void setVelocity(uint8_t velocity)
uint8_t getVelocity() const
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
An array wrapper for easy copying, comparing, and iterating.
Definition: Array.hpp:36