![]() |
wxMidi - A MIDI interface based on PortMidi
|
Abstract class representing a MIDI message. More...
#include <wxMidi.h>
Public Member Functions | |
wxMidiMessage () | |
Constructor. | |
virtual | ~wxMidiMessage () |
Destructor. | |
virtual void | SetTimestamp (wxMidiTimestamp timestamp)=0 |
Set the message timestamp value. More... | |
virtual wxMidiTimestamp | GetTimestamp ()=0 |
wxMidiMsgType | GetType () |
Returns either wxMIDI_SHORT_MSG, or wxMIDI_SYSEX_MSG, identifying the type of the message object. More... | |
virtual wxByte | GetStatus ()=0 |
Returns the status byte of the message. More... | |
Protected Attributes | |
wxMidiMsgType | m_type |
Abstract class representing a MIDI message.
In wxMidi, messages are represented by a wxMidiMessage object. It is an abstract class from which the specific Midi messages derive. It contains information about the type and status byte of the MIDI message. In addition, it provides a timestamp value that is used by devices dealing with MIDI timing, such as sequencers.
|
pure virtual |
Returns the status byte of the message.
For a wxSysExMessage status byte is always 0xF0 but the end of sysex message (0xF7) is also included in the message data. According MIDI standard the most significant bit of the status byte is always 1 so the range of status values goes from 0x80 to 0xFF.
Values lower than 0xF0 identify channel messages, with the four lower bits specifying the channel (0-15); for example, status byte 0x93 is a NoteOn for channel 3:
Message | Status byte |
---|---|
Note-Off Event | 0x8n |
Note-On Event | 0x9n |
Polyphonic Key Pressure | 0xAn |
Control Change | 0xBn |
Program Change | 0xCn |
Channel Pressure | 0xDn |
Pitch Bend | 0xEn |
Values 0xF0 to 0xFF are for system messages and are no intended for a specific channel:
Message | Status byte |
---|---|
Begin System Exclusive | 0xF0 |
MIDI Time Code | 0xF1 |
Song Position Pointer | 0xF2 |
Song Select | 0xF3 |
Tune Request | 0xF6 |
End System Exclusive | 0xF7 |
Real-time Clock | 0xF8 |
Undefined | 0xF9 |
Start | 0xFA |
Continue | 0xFB |
Stop | 0xFC |
Undefined | 0xFD |
Active Sensing | 0xFE |
System Reset | 0xFF |
Implemented in wxMidiSysExMessage, and wxMidiShortMessage.
|
inline |
Returns either wxMIDI_SHORT_MSG, or wxMIDI_SYSEX_MSG, identifying the type of the message object.
|
pure virtual |
Set the message timestamp value.
On output to a wxMidiOutDevice opened with non-zero latency, the timestamp will determine the time to begin sending the message. If the wxMidiOutDevice was opened with a latency value of zero, timestamps will be ignored and messages will be delivered inmediatelly.
timestamp | The timestamp value. It is milliseconds elapsed since the wxMidi package initialization. Current time can be obtained by calling wxMidi::GetTime(). |
Implemented in wxMidiSysExMessage, and wxMidiShortMessage.