Package midi :: Module slice
[hide private]
[frames] | no frames]

Module slice

source code

Slice midi streams up.

Utilities for handling portions of a midi stream in various ways.

Classes [hide private]
  EventStreamSlice
Represents a portion of a midi stream (an EventStream).
Functions [hide private]
 
__repeat_all(x, y) source code
 
__only_latest(x, y) source code
Variables [hide private]
  SLICE_REPEAT_EVENTS = {AfterTouchEvent: lambda x, y: x.pitch==...
The event types that should be repeated at the beginning of a slice if they occurred prior to the start of the slice in the event stream.
  __package__ = 'midi'
Variables Details [hide private]

SLICE_REPEAT_EVENTS

The event types that should be repeated at the beginning of a slice if they occurred prior to the start of the slice in the event stream.

The repeat key function will be consulted to decide whether a later event overrides an earlier one of the same type on the same channel. The later event will be considered to have overridden the earlier if it returns True.

ChannelPrefixEvent has a special behaviour and doesn't fit into this framework.

Value:
{AfterTouchEvent: lambda x, y: x.pitch== y.pitch, ControlChangeEvent: \
lambda x, y: x.control== y.control, ProgramChangeEvent: __only_latest,\
 ChannelAfterTouchEvent: __only_latest, PitchWheelEvent: __only_latest\
, SysExEvent: __repeat_all, CopyrightEvent: __repeat_all, TrackNameEve\
nt: __repeat_all, InstrumentNameEvent: __only_latest, PortEvent: __onl\
y_latest, TimeSignatureEvent: __only_latest, KeySignatureEvent: __only\
_latest,}