#include <midievent.h>
Public Types | |
enum | Type { noteOff = 0x80, noteOn = 0x90, afterTouch = 0xA0, controlChange = 0xB0, programChange = 0xC0, channelPressure = 0xD0, pitchBend = 0xE0 } |
Public Member Functions | |
MidiEvent ()=default | |
MidiEvent (Type aType, MidiValue number=MIDI_NUMBER_OMNI, MidiValue value=MIDI_VALUE_OMNI, MidiValue channel=MIDI_CHANNEL_OMNI, const std::string &port="") | |
MidiEvent (const std::vector< unsigned char > &data, const std::string &port) | |
virtual | ~MidiEvent ()=default |
bool | corresponds (const MidiEvent &b) const |
bool | operator== (const MidiEvent &rhs) const |
bool | operator> (const MidiEvent &rhs) const |
bool | operator< (const MidiEvent &rhs) const |
float | getPitchBendValue () const |
std::string | toString () const |
std::vector< unsigned char > | getData () const |
![]() | |
virtual | ~Event ()=default |
Event ()=default | |
Event (const Event &)=delete | |
Event & | operator= (const Event &)=delete |
Static Public Attributes | |
static constexpr MidiValue | MIDI_MAX_VALUE = 127 |
static constexpr MidiValue | MIDI_CONTROLLER_SUSTAIN = 64 |
static constexpr MidiValue | MIDI_VALUE_OMNI = -1 |
static constexpr MidiValue | MIDI_NUMBER_OMNI = MIDI_VALUE_OMNI |
static constexpr MidiValue | MIDI_CHANNEL_OMNI = MIDI_VALUE_OMNI |
static constexpr MidiValue | MIDI_NUMBER_NONE = 0 |
Event representation of a midi message Storing a readable representation of the raw midi message and optionally the port number through which it is sent.
|
strong |
|
default |
MidiEvent | ( | Type | aType, |
MidiValue | number = MIDI_NUMBER_OMNI , |
||
MidiValue | value = MIDI_VALUE_OMNI , |
||
MidiValue | channel = MIDI_CHANNEL_OMNI , |
||
const std::string & | port = "" |
||
) |
Constructor passing in values
MidiEvent | ( | const std::vector< unsigned char > & | data, |
const std::string & | port | ||
) |
Construct event from raw message data
|
virtualdefault |
bool corresponds | ( | const MidiEvent & | b | ) | const |
this method checks if the messages described with b correspond to this message (using the OMNI wildcards)
std::vector<unsigned char> getData | ( | ) | const |
Returns a raw data midi message that corresponds to the event and can be sent through midi output port.
float getPitchBendValue | ( | ) | const |
If a pitch bend event, this returns the pitchbend amount between -1 and 1.
bool operator< | ( | const MidiEvent & | rhs | ) | const |
bool operator== | ( | const MidiEvent & | rhs | ) | const |
bool operator> | ( | const MidiEvent & | rhs | ) | const |
std::string toString | ( | ) | const |
Returns the contents of the event as a formatted text string for logging
|
staticconstexpr |
Wildcard value for midi channels
|
staticconstexpr |
CC number for sustain pedal
|
staticconstexpr |
Maximum value of a midi byte
|
staticconstexpr |
|
staticconstexpr |
Wildcard value for midi numbers
|
staticconstexpr |
Wildcard value for midi values