Contents
. 2. Midithing Objects  
Previous 2.4. Part
 
Next 2.5.1. MIDI Events

2.5. Event

The Event object is the common container for all MIDI messages. The message details are accessible through data attributes of the Event object. For example a note event will have a note attribute that you can modify.

MIDI messages are transmitted on the MIDI wire as a sequence of bytes, the first of which indicates the event type and channel; this status byte is reflected in the status member of the Event object or in the type and channel members. Modifying either translates into a modification of the other; the rule is status = type | channel.

The first exception to this rule is the SysEx event (system exclusive data) which has no channel because it rather applies to a specific device. This MIDI message consists of a block of raw data that is made up of a header that denotes the device ID, the data payload, and a terminating byte (0xF7).

Some events are never sent over the MIDI wire; they are used by the sequencer only. These are called Meta Events. For example, Meta events are used to indicate which time and tempo signatures to use, or what the name of a Part might be etc. Meta events are the second exception to the above rule.

Both SysEx and Meta events have a data member through which you can access the data chunk in the exact form in which it is written or read.

Beyond the data the original MIDI message contains, midithing stores a tick and a port with all Events. The tick tells when the Event is to be sent - or when it was received - with respect to the start of the Song, which is always at tick 0. The port tells which port the sequencer sends this Event to, or from which it was received.

NB The port attribute is stored per Part rather than per Event in standard MIDI files, although midithing honors Event.port as long as the Part the Event is in does not override this via its own port attribute.

Changing the status of an event is supported with the exception of changing it to or from Meta.

MIDI Events
Meta Events

midithing 0.3.22 documentation © Tim Goetze Nov. 06 2001