|
|
The MidiEvent is a special kind of event, since any MidiCommand_NoteOn that is sent must be ballanced by a matching MidiCommand_NoteOff to prevent 'hanging notes'.
To facilitate this, this class wraps two MidiCommand events together. The second is only used if the first is a MidiCommand_NoteOn and will always be a ballancing MidiCommand_NoteOff.
(The MidiEvent class contents are not Event<MidiCommand>s because the syntax becomes cumbersome.)
When you create a MidiEvent which contains a MidiCommand_NoteOn you will generally always want to fill in the second MidiCommand's details to be the matching MidiCommand_NoteOff. You will only not honour this in the case where there is no relevant matching note off. This is explained in more detail in the documentation for the PhraseEdit class.
See also: MidiCommand
MidiEvent ()
| MidiEvent |
MidiEvent (MidiCommand mc, Clock t)
| MidiEvent |
Creates a MidiEvent with the given MidiCommand and Clock. This should be used for non-note events.
Parameters:
mc | MidiCommand for this event; should not be a MidiCommand_NoteOn |
t | Time of this event |
MidiEvent (MidiCommand mc, Clock t, MidiCommand oc, Clock ot)
| MidiEvent |
Creates a MidiEvent for a note MidiCommand. Takes the MIDI note on MidiCommand and the related note off MidiCommand.
Parameters:
mc | MidiCommand for this event; should be a MidiCommand_NoteOn |
t | Time of this event |
oc | MidiCommand for the matching note off event; should be a MidiCommand_NoteOff |
ot | Time of the matching MidiCommand_NoteOff |
MidiEvent (MidiCommand mc, Clock t, int offVel, Clock ot)
| MidiEvent |
Creates a MidiEvent for a note MidiCommand. Takes the MIDI note on MidiCommand and the related off velocity of the note off MidiCommand. The note off MidiCommand is calculated from these values.
Parameters:
mc | MidiCommand for this event; should be a MidiCommand_NoteOn |
t | Time of this event |
offVel | The velocity of the matching note off. |
ot | Time of the matching MidiCommand_NoteOff |
MidiCommand data | data |
Clock time | time |
MidiCommand offData | offData |
Clock offTime | offTime |
int operator< (const MidiEvent &e)
| operator< |
[const]
The time of the matching MidiCommand_NoteOff (if there is one).
int operator<= (const MidiEvent &e)
| operator<= |
[const]
This comparison operator only compares event times, NOT the data contents.
int operator> (const MidiEvent &e)
| operator> |
[const]
int operator>= (const MidiEvent &e)
| operator>= |
[const]
This comparison operator only compares event times, NOT the data contents.
int operator== (const MidiEvent &e)
| operator== |
[const]
This comparison operator only compares event times, NOT the data contents.
int operator!= (const MidiEvent &e)
| operator!= |
[const]
This comparison operator only compares event times, NOT the data contents.
bool equals (const MidiEvent &e)
| equals |
[const]
Compares two Events for equality, checking both the times and the data.
equal_to (class) | equal_to |
This functor returns the value of operator==.
See also: equals