Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
SysCommonMessage Struct Reference

#include <MIDI_Parsers/MIDI_MessageTypes.hpp>

Detailed Description

Examples
MIDI-Input-Callback.ino, MIDI-Monitor-OLED.ino, MIDI_Pipes-Filter.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 263 of file MIDI_MessageTypes.hpp.

+ Inheritance diagram for SysCommonMessage:
+ Collaboration diagram for SysCommonMessage:

Public Member Functions

 SysCommonMessage (MIDIMessageType type, uint8_t data1=0x00, uint8_t data2=0x00, Cable cable=Cable_1)
 Constructor.
 
 SysCommonMessage (MIDIMessageType type, uint8_t data1, Cable cable)
 Constructor.
 
 SysCommonMessage (MIDIMessageType type, Cable cable)
 Constructor.
 
 SysCommonMessage (const MIDIMessage &msg)
 
MIDIMessageType getMessageType () const
 Get the MIDI message type.
 
uint8_t getNumberOfDataBytes () const
 Get the number of data bytes of this type of System Common message.
 
 MIDIMessage (uint8_t header, uint8_t data1, uint8_t data2, Cable cable=Cable_1)
 Constructor.
 
 MIDIMessage (MIDIMessageType header, uint8_t data1, uint8_t data2, Cable cable=Cable_1)
 Constructor.
 
bool operator== (MIDIMessage other) const
 Check for equality.
 
bool operator!= (MIDIMessage other) const
 Check for inequality.
 
void setMessageType (MIDIMessageType type)
 Set the MIDI message type.
 
uint8_t getData1 () const
 Get the first data byte.
 
uint8_t getData2 () const
 Get the second data byte.
 
void setData1 (uint8_t data)
 Set the first data byte.
 
void setData2 (uint8_t data)
 Set the second data byte.
 
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.
 
bool hasValidChannelMessageHeader () const
 Check whether the header is a valid header for a channel message.
 
bool hasValidSystemCommonHeader () const
 Check whether the header is a valid header for a System Common message.
 
uint16_t getData14bit () const
 If Data 1 and Data 2 represent a single 14-bit number, you can use this method to retrieve that number.
 
void setData14bit (uint16_t data)
 If Data 1 and Data 2 represent a single 14-bit number, you can use this method to set that number.
 
void sanitize ()
 Make sure that the status byte has the most significant bit set and the data bytes have the most significant bits cleared.
 

Public Attributes

uint8_t header
 MIDI status byte (message type and channel).
 
uint8_t data1
 First MIDI data byte.
 
uint8_t data2
 First MIDI data byte.
 
Cable cable
 USB MIDI cable number;.
 

Static Public Attributes

static constexpr auto MTCQuarterFrame = MIDIMessageType::MTCQuarterFrame
 
static constexpr auto SongPositionPointer
 
static constexpr auto SongSelect = MIDIMessageType::SongSelect
 
static constexpr auto UndefinedSysCommon1
 
static constexpr auto UndefinedSysCommon2
 
static constexpr auto TuneRequest = MIDIMessageType::TuneRequest
 

Constructor & Destructor Documentation

◆ SysCommonMessage() [1/4]

SysCommonMessage ( MIDIMessageType type,
uint8_t data1 = 0x00,
uint8_t data2 = 0x00,
Cable cable = Cable_1 )
inline

Constructor.

Definition at line 267 of file MIDI_MessageTypes.hpp.

◆ SysCommonMessage() [2/4]

SysCommonMessage ( MIDIMessageType type,
uint8_t data1,
Cable cable )
inline

Constructor.

Definition at line 271 of file MIDI_MessageTypes.hpp.

◆ SysCommonMessage() [3/4]

SysCommonMessage ( MIDIMessageType type,
Cable cable )
inline

Constructor.

Definition at line 274 of file MIDI_MessageTypes.hpp.

◆ SysCommonMessage() [4/4]

SysCommonMessage ( const MIDIMessage & msg)
inlineexplicit

Definition at line 277 of file MIDI_MessageTypes.hpp.

Member Function Documentation

◆ getMessageType()

MIDIMessageType getMessageType ( ) const
inline

Get the MIDI message type.

Examples
MIDI-Monitor-OLED.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 280 of file MIDI_MessageTypes.hpp.

◆ getNumberOfDataBytes()

uint8_t getNumberOfDataBytes ( ) const
inline

Get the number of data bytes of this type of System Common message.

Examples
MIDI-Monitor-OLED.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 285 of file MIDI_MessageTypes.hpp.

◆ MIDIMessage() [1/2]

MIDIMessage ( uint8_t header,
uint8_t data1,
uint8_t data2,
Cable cable = Cable_1 )
inline

Constructor.

Definition at line 117 of file MIDI_MessageTypes.hpp.

◆ MIDIMessage() [2/2]

MIDIMessage ( MIDIMessageType header,
uint8_t data1,
uint8_t data2,
Cable cable = Cable_1 )
inline

Constructor.

Definition at line 122 of file MIDI_MessageTypes.hpp.

◆ operator==()

bool operator== ( MIDIMessage other) const
inlineinherited

Check for equality.

Definition at line 133 of file MIDI_MessageTypes.hpp.

◆ operator!=()

bool operator!= ( MIDIMessage other) const
inlineinherited

Check for inequality.

Definition at line 138 of file MIDI_MessageTypes.hpp.

◆ setMessageType()

void setMessageType ( MIDIMessageType type)
inlineinherited

Set the MIDI message type.

Note
Do not use this version for Channel Messages, it doesn't correctly handle the channel.

Definition at line 151 of file MIDI_MessageTypes.hpp.

◆ getData1()

uint8_t getData1 ( ) const
inlineinherited

Get the first data byte.

Examples
MIDI-Monitor-OLED.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 156 of file MIDI_MessageTypes.hpp.

◆ getData2()

uint8_t getData2 ( ) const
inlineinherited

Get the second data byte.

Examples
MIDI-Monitor-OLED.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 158 of file MIDI_MessageTypes.hpp.

◆ setData1()

void setData1 ( uint8_t data)
inlineinherited

Set the first data byte.

Definition at line 160 of file MIDI_MessageTypes.hpp.

◆ setData2()

void setData2 ( uint8_t data)
inlineinherited

Set the second data byte.

Definition at line 162 of file MIDI_MessageTypes.hpp.

◆ getCable()

Cable getCable ( ) const
inlineinherited

Get the MIDI USB cable number of the message.

Examples
MIDI-Monitor-OLED.ino.

Definition at line 165 of file MIDI_MessageTypes.hpp.

◆ setCable()

void setCable ( Cable cable)
inlineinherited

Set the MIDI USB cable number of the message.

Definition at line 167 of file MIDI_MessageTypes.hpp.

◆ hasValidChannelMessageHeader()

bool hasValidChannelMessageHeader ( ) const
inlineinherited

Check whether the header is a valid header for a channel message.

Definition at line 170 of file MIDI_MessageTypes.hpp.

◆ hasValidSystemCommonHeader()

bool hasValidSystemCommonHeader ( ) const
inlineinherited

Check whether the header is a valid header for a System Common message.

Note
SysExEnd is considered a System Common message by the MIDI Standard, SysExStart is not.
Reserved System Common messages are also considered valid System Common messages.

Definition at line 180 of file MIDI_MessageTypes.hpp.

◆ getData14bit()

uint16_t getData14bit ( ) const
inlineinherited

If Data 1 and Data 2 represent a single 14-bit number, you can use this method to retrieve that number.

Examples
MIDI-Monitor-OLED.ino.

Definition at line 186 of file MIDI_MessageTypes.hpp.

◆ setData14bit()

void setData14bit ( uint16_t data)
inlineinherited

If Data 1 and Data 2 represent a single 14-bit number, you can use this method to set that number.

Definition at line 191 of file MIDI_MessageTypes.hpp.

◆ sanitize()

void sanitize ( )
inlineinherited

Make sure that the status byte has the most significant bit set and the data bytes have the most significant bits cleared.

Definition at line 198 of file MIDI_MessageTypes.hpp.

Member Data Documentation

◆ MTCQuarterFrame

constexpr auto MTCQuarterFrame = MIDIMessageType::MTCQuarterFrame
staticconstexpr

Definition at line 294 of file MIDI_MessageTypes.hpp.

◆ SongPositionPointer

constexpr auto SongPositionPointer
staticconstexpr
Initial value:
=
@ SongPositionPointer
Song Position Pointer System Common message (3B).

Definition at line 295 of file MIDI_MessageTypes.hpp.

◆ SongSelect

constexpr auto SongSelect = MIDIMessageType::SongSelect
staticconstexpr

Definition at line 297 of file MIDI_MessageTypes.hpp.

◆ UndefinedSysCommon1

constexpr auto UndefinedSysCommon1
staticconstexpr
Initial value:
=
@ UndefinedSysCommon1
Undefined System Common message 0xF4 (1B).

Definition at line 298 of file MIDI_MessageTypes.hpp.

◆ UndefinedSysCommon2

constexpr auto UndefinedSysCommon2
staticconstexpr
Initial value:
=
@ UndefinedSysCommon2
Undefined System Common message 0xF5 (1B).

Definition at line 300 of file MIDI_MessageTypes.hpp.

◆ TuneRequest

constexpr auto TuneRequest = MIDIMessageType::TuneRequest
staticconstexpr

Definition at line 302 of file MIDI_MessageTypes.hpp.

◆ header

uint8_t header
inherited

MIDI status byte (message type and channel).

Examples
MIDI-Input-Callback.ino, MIDI-Input.ino, MIDI-Monitor-OLED.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 126 of file MIDI_MessageTypes.hpp.

◆ data1

uint8_t data1
inherited

◆ data2

uint8_t data2
inherited

◆ cable

Cable cable
inherited

USB MIDI cable number;.

Examples
MIDI-Input-Callback.ino, MIDI-Input.ino, and Mackie-Control-Universal-Reverse-Engineering.ino.

Definition at line 130 of file MIDI_MessageTypes.hpp.


The documentation for this struct was generated from the following file: