Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

TSE3::MidiEvent Struct Reference

A MidiCommand with associated Clock scheduling time and possible ballancing MidiCommand_NoteOff. More...

#include <Midi.h>

Collaboration diagram for TSE3::MidiEvent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MidiEvent ()
 MidiEvent (MidiCommand mc, Clock t)
 MidiEvent (MidiCommand mc, Clock t, MidiCommand oc, Clock ot)
 MidiEvent (MidiCommand mc, Clock t, int offVel, Clock ot)
int operator< (const MidiEvent &e) const
int operator<= (const MidiEvent &e) const
int operator> (const MidiEvent &e) const
int operator>= (const MidiEvent &e) const
int operator== (const MidiEvent &e) const
int operator!= (const MidiEvent &e) const
bool equals (const MidiEvent &e) const

Public Attributes

MidiCommand data
Clock time
MidiCommand offData
Clock offTime

Detailed Description

A MidiCommand with associated Clock scheduling time and possible ballancing MidiCommand_NoteOff.

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.

Author:
Pete Goodliffe
Version:
3.01
See also:
MidiCommand


Constructor & Destructor Documentation

TSE3::MidiEvent::MidiEvent  )  [inline]
 

TSE3::MidiEvent::MidiEvent MidiCommand  mc,
Clock  t
[inline]
 

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

TSE3::MidiEvent::MidiEvent MidiCommand  mc,
Clock  t,
MidiCommand  oc,
Clock  ot
[inline]
 

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

TSE3::MidiEvent::MidiEvent MidiCommand  mc,
Clock  t,
int  offVel,
Clock  ot
[inline]
 

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


Member Function Documentation

int TSE3::MidiEvent::operator< const MidiEvent e  )  const [inline]
 

int TSE3::MidiEvent::operator<= const MidiEvent e  )  const [inline]
 

This comparison operator only compares event times, NOT the data contents.

int TSE3::MidiEvent::operator> const MidiEvent e  )  const [inline]
 

int TSE3::MidiEvent::operator>= const MidiEvent e  )  const [inline]
 

This comparison operator only compares event times, NOT the data contents.

int TSE3::MidiEvent::operator== const MidiEvent e  )  const [inline]
 

This comparison operator only compares event times, NOT the data contents.

int TSE3::MidiEvent::operator!= const MidiEvent e  )  const [inline]
 

This comparison operator only compares event times, NOT the data contents.

bool TSE3::MidiEvent::equals const MidiEvent e  )  const [inline]
 

Compares two Events for equality, checking both the times and the data.


Member Data Documentation

MidiCommand TSE3::MidiEvent::data
 

The event's MIDI command

Clock TSE3::MidiEvent::time
 

The event's Clock time.

MidiCommand TSE3::MidiEvent::offData
 

If data is a MidiCommand_NoteOn, this holds the matching MidiCommand_NoteOff that ballances it.

Clock TSE3::MidiEvent::offTime
 

The time of the matching MidiCommand_NoteOff (if there is one).


The documentation for this struct was generated from the following file:
Generated on Wed May 25 14:46:24 2005 for TSE3 by doxygen 1.3.2