This module defines classes and functions for dealing with MIDI events in Python code, e.g. when using Process() or Call().
A MIDI event, as seen by Python code.
Each event has these attributes:
The event type, one of the Event Types constants.
The port number.
The channel number.
The first data byte, meaning depends on event type.
The second data byte, meaning depends on event type.
The following attributes are only valid for certain event types, and accessing them will raise an error otherwise:
The program number, stored in data2. Unlike data2, this attribute observes the data_offset setting.
SysEx data.
Several utility functions are defined to simplify the creation of event objects. Each of these functions returns a newly created object of type MidiEvent:
Create a new note-on event object.
Create a new note-off event object.
Create a new control change event object.
Create a new pitch bend event object.
Create a new aftertouch event object.
Create a new polyphonic aftertouch event object.
Create a new program change event object.
Create a new sysex event object.