Package midi :: Class EventFactory
[hide private]
[frames] | no frames]

Class EventFactory

source code

object --+
         |
        EventFactory

EventFactory is a factory for getting MIDI events out of a data stream.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
parse_midi_event(self, track)
Reads bytes out of a data stream and returns a representation of the next MIDI event.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
register_event(cls, event, bases) source code
Class Variables [hide private]
  EventRegistry = [<class 'midi.NoteOnEvent'>, <class 'midi.Note...
  MetaEventRegistry = [<class 'midi.SequenceNumberEvent'>, <clas...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

parse_midi_event(self, track)

source code 

Reads bytes out of a data stream and returns a representation of the next MIDI event. All events in a stream should be read in turn using the same EventFactory, which keeps track of things like running status.

Parameters:
  • track - data stream to read bytes from
Returns:
Event subclass instance for the next MIDI event in the track.

Class Variable Details [hide private]

EventRegistry

Value:
[<class 'midi.NoteOnEvent'>,
 <class 'midi.NoteOffEvent'>,
 <class 'midi.AfterTouchEvent'>,
 <class 'midi.ControlChangeEvent'>,
 <class 'midi.ProgramChangeEvent'>,
 <class 'midi.ChannelAfterTouchEvent'>,
 <class 'midi.PitchWheelEvent'>,
 <class 'midi.SysExEvent'>]

MetaEventRegistry

Value:
[<class 'midi.SequenceNumberEvent'>,
 <class 'midi.TextEvent'>,
 <class 'midi.CopyrightEvent'>,
 <class 'midi.TrackNameEvent'>,
 <class 'midi.InstrumentNameEvent'>,
 <class 'midi.LyricsEvent'>,
 <class 'midi.MarkerEvent'>,
 <class 'midi.CuePointEvent'>,
...