MeasureDef¶
- class maelzel.scorestruct.MeasureDef(timesig, quarterTempo, parent, annotation='', timesigInherited=False, tempoInherited=False, barline='', rehearsalMark=None, keySignature=None, properties=None, maxEighthTempo=48, readonly=True)[source]¶
Bases:
object
A MeasureDef defines one Measure within a ScoreStruct (time signature, tempo, etc.)
Attributes Summary
Any text annotation for this measure
The barline style, or '' to use default
The duration of this measure in quarter-notes
The duration of this measure in seconds
If given, a key signature
The max.
The parent ScoreStruct of this measure, if any
User defined properties can be placed here.
The tempo relative to a quarternote
Is this measure definition read only?
If given, a RehearsalMark for this measure
Is the tempo of this measure inherited?
The time signature of this measure.
Is the time-signature of this measure inherited?
Methods Summary
The representation of this MeasureDef as a score line
Beat structure of this measure
copy
()- rtype:
Max.
Returns a list of the durations representing the subdivisions of this measure.
Returns a string representation of this measure's time signature
Attributes Documentation
- annotation¶
Any text annotation for this measure
- barline¶
The barline style, or ‘’ to use default
- durationQuarters¶
The duration of this measure in quarter-notes
- durationSecs¶
The duration of this measure in seconds
- keySignature¶
If given, a key signature
-
maxEighthTempo:
int
¶ The max. tempo at which an eighth note can be a beat of its own
- parent¶
The parent ScoreStruct of this measure, if any
- properties¶
User defined properties can be placed here. None by default
- quarterTempo¶
The tempo relative to a quarternote
- readonly¶
Is this measure definition read only?
- rehearsalMark¶
If given, a RehearsalMark for this measure
- tempoInherited¶
Is the tempo of this measure inherited?
- timesig¶
The time signature of this measure. Can be explicit or inherited
- timesigInherited¶
Is the time-signature of this measure inherited?
Methods Documentation
- beatStructure()[source]¶
Beat structure of this measure
- Returns:
F, beatDur: F, beatWeight: int) for each beat of this measure
- Return type:
a list of tuple with the form (beatOffset
- subdivisionStructure()[source]¶
Max. common denominator for subdivisions and the subdivisions as multiples of it
For example, for 3/4+3/8, returns (8, (2, 2, 2, 3))
- Return type:
tuple
[int
,tuple
[int
,...
]]- Returns:
a tuple (max. common denominator, subdivisions as multiples of common denominator)
- subdivisions()[source]¶
Returns a list of the durations representing the subdivisions of this measure.
A subdivision is a duration, in quarters.
- Return type:
list
[Fraction
]- Returns:
a list of durations which sum up to the duration of this measure
Example
>>> MeasureDef(timesig=TimeSignature((3, 4)), quarterTempo=60).subdivisions() [1, 1, 1] >>> MeasureDef(timesig=TimeSignature((3, 8)), quarterTempo=60).subdivisions() [0.5, 0.5, 0.5] >>> MeasureDef(timesig=TimeSignature((7, 8)), quarterTempo=40).subdivisions() [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] >>> MeasureDef(timesig=TimeSignature((7, 8)), quarterTempo=150).subdivisions() [1.0, 1.0, 1.5] >>> MeasureDef(TimeSignature((7, 8), subdivisionStruct=(2, 3, 2)), quarterTempo=150).subdivisions() [1, 1.5, 1]