A library to send and receive MIDI messages over USB using the default USB-MIDI drivers on Win/Mac

Dependents:   USBMIDI_HelloWorld USBMIDI_DrumExample USBMIDI_MonoSynth MIDI_Interface_ver_1 ... more

Embed: (wiki syntax)

« Back to documentation index

MIDIMessage Class Reference

A MIDI message container. More...

#include <MIDIMessage.h>

Public Types

enum  MIDIMessageType
 

MIDI Message Types.

More...

Public Member Functions

MIDIMessageType type ()
 Read the message type.
int channel ()
 Read the channel number.
int key ()
 Read the key ID.
int velocity ()
 Read the velocity.
int value ()
 Read the controller value.
int pressure ()
 Read the aftertouch pressure.
int controller ()
 Read the controller number.
int program ()
 Read the program number.
int pitch ()
 Read the pitch value.

Static Public Member Functions

static MIDIMessage NoteOff (int key, int velocity=127, int channel=0)
 Create a NoteOff message.
static MIDIMessage NoteOn (int key, int velocity=127, int channel=0)
 Create a NoteOn message.
static MIDIMessage PolyphonicAftertouch (int key, int pressure, int channel=0)
 Create a PolyPhonic Aftertouch message.
static MIDIMessage ControlChange (int control, int value, int channel=0)
 Create a Control Change message.
static MIDIMessage ProgramChange (int program, int channel=0)
 Create a Program Change message.
static MIDIMessage ChannelAftertouch (int pressure, int channel=0)
 Create a Channel Aftertouch message.
static MIDIMessage PitchWheel (int pitch=0, int channel=0)
 Create a Pitch Wheel message.
static MIDIMessage AllNotesOff (int channel=0)
 Create an All Notes Off message.

Detailed Description

A MIDI message container.

Definition at line 47 of file MIDIMessage.h.


Member Enumeration Documentation

MIDI Message Types.

Definition at line 171 of file MIDIMessage.h.


Member Function Documentation

static MIDIMessage AllNotesOff ( int  channel = 0 ) [static]

Create an All Notes Off message.

Parameters:
channelChannel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 164 of file MIDIMessage.h.

int channel (  )

Read the channel number.

Definition at line 207 of file MIDIMessage.h.

static MIDIMessage ChannelAftertouch ( int  pressure,
int  channel = 0 
) [static]

Create a Channel Aftertouch message.

Parameters:
pressurePressure
channelKey channel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 136 of file MIDIMessage.h.

static MIDIMessage ControlChange ( int  control,
int  value,
int  channel = 0 
) [static]

Create a Control Change message.

Parameters:
controlController ID
valueController value (0-127)
channelController channel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 108 of file MIDIMessage.h.

int controller (  )

Read the controller number.

Definition at line 236 of file MIDIMessage.h.

int key (  )

Read the key ID.

Definition at line 212 of file MIDIMessage.h.

static MIDIMessage NoteOff ( int  key,
int  velocity = 127,
int  channel = 0 
) [static]

Create a NoteOff message.

Parameters:
keyKey ID
velocityKey velocity (0-127, default = 127)
channelKey channel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 63 of file MIDIMessage.h.

static MIDIMessage NoteOn ( int  key,
int  velocity = 127,
int  channel = 0 
) [static]

Create a NoteOn message.

Parameters:
keyKey ID
velocityKey velocity (0-127, default = 127)
channelKey channel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 78 of file MIDIMessage.h.

int pitch (  )

Read the pitch value.

Definition at line 246 of file MIDIMessage.h.

static MIDIMessage PitchWheel ( int  pitch = 0,
int  channel = 0 
) [static]

Create a Pitch Wheel message.

Parameters:
pitchPitch (-8192 - 8191, default = 0)
channelChannel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 150 of file MIDIMessage.h.

static MIDIMessage PolyphonicAftertouch ( int  key,
int  pressure,
int  channel = 0 
) [static]

Create a PolyPhonic Aftertouch message.

Parameters:
keyKey ID
pressureAftertouch pressure (0-127)
channelKey channel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 93 of file MIDIMessage.h.

int pressure (  )

Read the aftertouch pressure.

Definition at line 227 of file MIDIMessage.h.

int program (  )

Read the program number.

Definition at line 241 of file MIDIMessage.h.

static MIDIMessage ProgramChange ( int  program,
int  channel = 0 
) [static]

Create a Program Change message.

Parameters:
programProgram ID
channelChannel (0-15, default 0)
Returns:
A MIDIMessage

Definition at line 122 of file MIDIMessage.h.

MIDIMessageType type (  )

Read the message type.

Returns:
MIDIMessageType

Definition at line 186 of file MIDIMessage.h.

int value (  )

Read the controller value.

Definition at line 222 of file MIDIMessage.h.

int velocity (  )

Read the velocity.

Definition at line 217 of file MIDIMessage.h.