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

Class TimeSignatureEvent

source code

object --+        
         |        
     Event --+    
             |    
     MetaEvent --+
                 |
                TimeSignatureEvent

Expressed as 4 numbers: <numerator> <denominator> <metronome> <thirtyseconds>.

<numerator> and <denominator> represent the parts of the signature as notated on sheet music. The denominator must be a power of 2: 2 = quarter note, 3 = eighth, etc.

<metronome> expresses the number of MIDI clocks in a metronome click.

<thirtyseconds> expresses the number of notated 32nd notes in a MIDI quarter note (24 MIDI clocks).

This event allows a program to relate what MIDI thinks of as a quarter, to something entirely different.

Nested Classes [hide private]

Inherited from Event: __metaclass__

Instance Methods [hide private]
 
__str__(self)
str(x)
source code
 
decode_data(self)
Takes the data that's been read into data instance variable and sets instance attributes from the values in it.
source code
 
encode_data(self)
Produces byte data to represent this event on the basis of instance variables.
source code

Inherited from MetaEvent: decode, encode

Inherited from Event: __cmp__, __init__, adjust_msdelay, copy, encode_delta_tick

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

Class Methods [hide private]

Inherited from MetaEvent: is_event, is_meta_event

Class Variables [hide private]
  name = 'Time Signature'
  metacommand = 88
  order = 0
Sort order
  numerator = 4
Top part of the time signature.
  denominator = 4
Bottom part of the time signature (must be a power of 2).
  metronome = 24
Number of MIDI clocks in a metronome click.
  thirtyseconds = 8
Number of 32nd notes in 24 MIDI clocks.

Inherited from MetaEvent: allow_running, data, statusmsg

Inherited from Event: length

Instance Variables [hide private]

Inherited from Event: channel, msdelay, tick, track, type

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

decode_data(self)

source code 

Takes the data that's been read into data instance variable and sets instance attributes from the values in it. What this does is specific to the event type.

At the simplest, it could do nothing, just leaving the raw data in data, but more likely it will decode values from the data.

Overrides: Event.decode_data
(inherited documentation)

encode_data(self)

source code 

Produces byte data to represent this event on the basis of instance variables. This is the data that will be written to a MIDI stream (not including the tick and status message).

Returns:
byte data as a string
Overrides: Event.encode_data
(inherited documentation)