iPlug2 - C++ Audio Plug-in Framework
|
Encapsulates a MIDI message and provides helper functions. More...
#include <IPlugMidi.h>
Public Types | |
enum | EStatusMsg { kNone = 0, kNoteOff = 8, kNoteOn = 9, kPolyAftertouch = 10, kControlChange = 11, kProgramChange = 12, kChannelAftertouch = 13, kPitchWheel = 14 } |
Constants for the status byte of a MIDI message. | |
enum | EControlChangeMsg { kNoCC = -1, kModWheel = 1, kBreathController = 2, kUndefined003 = 3, kFootController = 4, kPortamentoTime = 5, kChannelVolume = 7, kBalance = 8, kUndefined009 = 9, kPan = 10, kExpressionController = 11, kEffectControl1 = 12, kEffectControl2 = 13, kUndefined014 = 14, kUndefined015 = 15, kGeneralPurposeController1 = 16, kGeneralPurposeController2 = 17, kGeneralPurposeController3 = 18, kGeneralPurposeController4 = 19, kUndefined020 = 20, kUndefined021 = 21, kUndefined022 = 22, kUndefined023 = 23, kUndefined024 = 24, kUndefined025 = 25, kUndefined026 = 26, kUndefined027 = 27, kUndefined028 = 28, kUndefined029 = 29, kUndefined030 = 30, kUndefined031 = 31, kSustainOnOff = 64, kPortamentoOnOff = 65, kSustenutoOnOff = 66, kSoftPedalOnOff = 67, kLegatoOnOff = 68, kHold2OnOff = 69, kSoundVariation = 70, kResonance = 71, kReleaseTime = 72, kAttackTime = 73, kCutoffFrequency = 74, kDecayTime = 75, kVibratoRate = 76, kVibratoDepth = 77, kVibratoDelay = 78, kSoundControllerUndefined = 79, kUndefined085 = 85, kUndefined086 = 86, kUndefined087 = 87, kUndefined088 = 88, kUndefined089 = 89, kUndefined090 = 90, kTremoloDepth = 92, kChorusDepth = 93, kPhaserDepth = 95, kUndefined102 = 102, kUndefined103 = 103, kUndefined104 = 104, kUndefined105 = 105, kUndefined106 = 106, kUndefined107 = 107, kUndefined108 = 108, kUndefined109 = 109, kUndefined110 = 110, kUndefined111 = 111, kUndefined112 = 112, kUndefined113 = 113, kUndefined114 = 114, kUndefined115 = 115, kUndefined116 = 116, kUndefined117 = 117, kUndefined118 = 118, kUndefined119 = 119, kAllNotesOff = 123 } |
Constants for MIDI CC messages. | |
Public Member Functions | |
IMidiMsg (int offset=0, uint8_t status=0, uint8_t data1=0, uint8_t data2=0) | |
Create an IMidiMsg, an abstraction for a MIDI message. More... | |
void | MakeNoteOnMsg (int noteNumber, int velocity, int offset, int channel=0) |
Make a Note On message. More... | |
void | MakeNoteOffMsg (int noteNumber, int offset, int channel=0) |
Make a Note Off message. More... | |
void | MakePitchWheelMsg (double value, int channel=0, int offset=0) |
Create a pitch wheel/bend message. More... | |
void | MakeControlChangeMsg (EControlChangeMsg idx, double value, int channel=0, int offset=0) |
Create a CC message. More... | |
void | MakeProgramChange (int program, int channel=0, int offset=0) |
Create a Program Change message. More... | |
void | MakeChannelATMsg (int pressure, int offset, int channel) |
Create a Channel AfterTouch message. More... | |
void | MakePolyATMsg (int noteNumber, int pressure, int offset, int channel) |
Create a Poly AfterTouch message. More... | |
int | Channel () const |
Gets the channel of a MIDI message. More... | |
EStatusMsg | StatusMsg () const |
Gets the MIDI Status message. More... | |
int | NoteNumber () const |
Gets the MIDI note number. More... | |
int | Velocity () const |
Get the velocity value of a NoteOn/NoteOff message. More... | |
int | PolyAfterTouch () const |
Get the Pressure value from a PolyAfterTouch message. More... | |
int | ChannelAfterTouch () const |
Get the Pressure value from an AfterTouch message. More... | |
int | Program () const |
Get the program index from a Program Change message. More... | |
double | PitchWheel () const |
Get the value from a Pitchwheel message. More... | |
EControlChangeMsg | ControlChangeIdx () const |
Gets the controller index of a CC message. More... | |
double | ControlChange (EControlChangeMsg idx) const |
Get the value of a CC message. More... | |
void | Clear () |
Clear the message. | |
void | LogMsg () |
Log a message (TRACER BUILDS) | |
void | PrintMsg () const |
Print a message (DEBUG BUILDS) | |
Static Public Member Functions | |
static bool | ControlChangeOnOff (double msgValue) |
Helper to get a boolean value from a CC messages. More... | |
static const char * | StatusMsgStr (EStatusMsg msg) |
Get the Status Message as a CString. More... | |
static const char * | CCNameStr (int idx) |
Get the CC name as a CString. More... | |
Public Attributes | |
int | mOffset |
uint8_t | mStatus |
uint8_t | mData1 |
uint8_t | mData2 |
Encapsulates a MIDI message and provides helper functions.
Definition at line 30 of file IPlugMidi.h.
|
inline |
Create an IMidiMsg, an abstraction for a MIDI message.
offset | Sample offset in block |
status | Status byte |
data1 | Data byte 1 |
data2 | Data byte 2 |
Definition at line 133 of file IPlugMidi.h.
|
inlinestatic |
Get the CC name as a CString.
idx | Index of the MIDI CC [0-127] |
Definition at line 386 of file IPlugMidi.h.
|
inline |
Gets the channel of a MIDI message.
Definition at line 236 of file IPlugMidi.h.
Referenced by LogMsg(), and PrintMsg().
|
inline |
Get the Pressure value from an AfterTouch message.
Definition at line 297 of file IPlugMidi.h.
References StatusMsg().
|
inline |
Get the value of a CC message.
Definition at line 340 of file IPlugMidi.h.
References ControlChangeIdx(), and StatusMsg().
Referenced by IWheelControl::OnMidi().
|
inline |
Gets the controller index of a CC message.
Definition at line 333 of file IPlugMidi.h.
Referenced by ControlChange(), IVKeyboardControl::OnMidi(), and IWheelControl::OnMidi().
|
inlinestatic |
Helper to get a boolean value from a CC messages.
msgValue | The normalized CC value [0, 1] |
true
= on Definition at line 352 of file IPlugMidi.h.
|
inline |
Create a Channel AfterTouch message.
pressure | Range [0, 127] |
offset | Sample offset in block |
channel | MIDI channel [0, 15] |
Definition at line 211 of file IPlugMidi.h.
References Clear().
|
inline |
Create a CC message.
idx | Controller index |
value | Range [0, 1] |
channel | MIDI channel [0, 15] |
offset | Sample offset in block |
Definition at line 186 of file IPlugMidi.h.
References Clear().
Referenced by IWheelControl::IWheelControl().
|
inline |
Make a Note Off message.
noteNumber | Note number |
offset | Sample offset in block |
channel | MIDI channel [0, 15] |
Definition at line 158 of file IPlugMidi.h.
References Clear().
Referenced by IVKeyboardControl::Draw(), and IGraphics::SetQwertyMidiKeyHandlerFunc().
|
inline |
Make a Note On message.
noteNumber | Note number |
velocity | Note on velocity |
offset | Sample offset in block |
channel | MIDI channel [0, 15] |
Definition at line 145 of file IPlugMidi.h.
References Clear().
Referenced by IVKeyboardControl::Draw(), and IGraphics::SetQwertyMidiKeyHandlerFunc().
|
inline |
Create a pitch wheel/bend message.
value | Range [-1, 1], converts to [0, 16384) where 8192 = no pitch change |
channel | MIDI channel [0, 15] |
offset | Sample offset in block |
Definition at line 170 of file IPlugMidi.h.
References Clear().
Referenced by IWheelControl::IWheelControl().
|
inline |
Create a Poly AfterTouch message.
noteNumber | Note number |
pressure | Range [0, 127] |
offset | Sample offset in block |
channel | MIDI channel [0, 15] |
Definition at line 225 of file IPlugMidi.h.
References Clear().
|
inline |
Create a Program Change message.
program | Program index |
channel | MIDI channel [0, 15] |
offset | Sample offset in block |
Definition at line 199 of file IPlugMidi.h.
References Clear().
|
inline |
Gets the MIDI note number.
Definition at line 255 of file IPlugMidi.h.
References StatusMsg().
Referenced by IVKeyboardControl::OnMidi().
|
inline |
Get the value from a Pitchwheel message.
Definition at line 321 of file IPlugMidi.h.
References StatusMsg().
Referenced by IWheelControl::OnMidi().
|
inline |
Get the Pressure value from a PolyAfterTouch message.
Definition at line 284 of file IPlugMidi.h.
References StatusMsg().
|
inline |
Get the program index from a Program Change message.
Definition at line 310 of file IPlugMidi.h.
References StatusMsg().
|
inline |
Gets the MIDI Status message.
Definition at line 243 of file IPlugMidi.h.
Referenced by ChannelAfterTouch(), ControlChange(), LogMsg(), NoteNumber(), IVKeyboardControl::OnMidi(), IWheelControl::OnMidi(), PitchWheel(), PolyAfterTouch(), PrintMsg(), Program(), and Velocity().
|
inlinestatic |
Get the Status Message as a CString.
msg | The Status Message |
Definition at line 367 of file IPlugMidi.h.
Referenced by LogMsg(), and PrintMsg().
|
inline |
Get the velocity value of a NoteOn/NoteOff message.
Definition at line 270 of file IPlugMidi.h.
References StatusMsg().
Referenced by IVKeyboardControl::OnMidi().