MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
4 #include <Settings/NamespaceSettings.hpp>
14 #include <Def/Channel.hpp>
27 PROGRAM_CHANGE = 0xC0,
28 CHANNEL_PRESSURE = 0xD0,
38 UNDEFINED_REALTIME_1 = 0xF9,
42 UNDEFINED_REALTIME_2 = 0xFD,
43 ACTIVE_SENSING = 0xFE,
49 MISC_FUNCTION_CODES = 0x0,
51 SYSTEM_COMMON_2B = 0x2,
52 SYSTEM_COMMON_3B = 0x3,
53 SYSEX_START_CONT = 0x4,
54 SYSTEM_COMMON_1B = 0x5,
64 CHANNEL_PRESSURE = 0xD,
91 return this->header == other.
header && this->data1 == other.
data1 &&
92 this->data2 == other.
data2 && this->CN == other.
CN;
117 header |=
static_cast<uint8_t
>(type) & 0xF0;
126 return type <= MIDIMessageType::CONTROL_CHANGE ||
127 type == MIDIMessageType::PITCH_BEND;
133 return type >= MIDIMessageType::NOTE_OFF &&
134 type <= MIDIMessageType::PITCH_BEND;
161 return this->length == other.
length &&
162 this->data == other.
data &&
163 this->CN == other.
CN;
193 return this->message == other.
message && this->CN == other.
CN;
bool operator==(SysExMessage other) const
A type-safe class for MIDI channels.
A type-safe class for MIDI USB Cable numbers.
bool hasValidHeader() const
Check whether the header is a valid header for a channel message.
bool operator!=(RealTimeMessage other) const
uint8_t CN
USB MIDI cable number;.
RealTimeMessage(MIDIMessageType message, uint8_t cn)
Constructor.
SysExMessage(const uint8_t *data, size_t length, Cable cable=CABLE_1)
Constructor.
#define BEGIN_CS_NAMESPACE
uint8_t header
MIDI status byte (message type and channel).
bool operator!=(SysExMessage other) const
RealTimeMessage(uint8_t message, Cable cable=CABLE_1)
Constructor.
#define AH_DIAGNOSTIC_POP()
RealTimeMessage(MIDIMessageType message, Cable cable=CABLE_1)
Constructor.
uint8_t data2
First MIDI data byte.
bool operator==(ChannelMessage other) const
Check for equality.
void setCable(Cable cable)
Set the MIDI USB cable number of the message.
SysExMessage()
Constructor.
bool hasTwoDataBytes() const
Check whether this message has one or two data bytes.
MIDICodeIndexNumber
See table 4-1 in https://usb.org/sites/default/files/midi10.pdf.
RealTimeMessage(uint8_t message, uint8_t cn)
Constructor.
ChannelMessage(MIDIMessageType type, Channel channel, uint8_t data1, uint8_t data2=0x00, Cable cable=CABLE_1)
Constructor.
void setChannel(Channel channel)
Set the MIDI channel of the message.
uint8_t data1
First MIDI data byte.
void setCable(Cable cable)
Set the MIDI USB cable number of the message.
Cable getCable() const
Get the MIDI USB cable number of the message.
MIDIMessageType getMessageType() const
Get the MIDI message type.
void setMessageType(MIDIMessageType type)
Set the MIDI message type.
bool operator==(RealTimeMessage other) const
Cable getCable() const
Get the MIDI USB cable number of the message.
void setCable(Cable cable)
Set the MIDI USB cable number of the message.
#define AH_DIAGNOSTIC_WERROR()
constexpr uint8_t getRaw() const
Get the channel as an integer.
bool operator!=(ChannelMessage other) const
Check for inequality.
Cable getCable() const
Get the MIDI USB cable number of the message.
constexpr uint8_t getRaw() const
Get the cable as an integer.
SysExMessage(const uint8_t *data, size_t length, uint8_t CN)
Constructor.
ChannelMessage(uint8_t header, uint8_t data1, uint8_t data2, uint8_t CN)
Constructor.
Channel getChannel() const
Get the MIDI channel of the message.