QuantizedMeasure¶
- class maelzel.scoring.quant.QuantizedMeasure(timesig, quarterTempo, beats, quantprofile, subdivisions=None, parent=None)[source]¶
Bases:
object
A QuantizedMeasure holds a quantized tree
If given a list of QuantizedBeats, these are merged together in a recursive structure to generate a tree of Nodes. See
QuantizedMeasure.asTree()
- Parameters:
timesig (
TimeSignature
) – the time signaturequarterTempo (
Fraction
) – the tempo of the quarter notebeats (
list
[QuantizedBeat
]) – a list of QuantizedBeatsquantprofile (
QuantizationProfile
) – the quantization profile used to generate this quantized measure. This is necessary to create a tree structuresubdivisions (
Optional
[tuple
[int
,...
]]) – a list of integers corresponding to the number of units of the denominator of the fused time signature. This can override the subdivision structure defined in the time signature itself. For example, for a 7/8 measure with subdivisions of 2+3+2, this parameter should be (2, 3, 2)parent (
Optional
[QuantizedPart
]) – the QuantizedPart this measure belongs to
Methods Summary
The beat offsets, including the end of the measure
Returns a list with the durations (in quarterNotes) of the beats in this measure
Returns a list of the offsets of each beat within this measure
- rtype:
list
[BeatStructure
]
breakSyncopations
([level])Break notes extended over beat boundaries, in place
check
()dump
([numindents, indent, tree, stream])- rtype:
None
duration
()Duration of this measure, in quarter notes
empty
()Is this measure empty?
- rtype:
list
[list
[TreeLocation
]]
Return the measure index of this measure within the QuantizedPart
Returns a flat list of all notations in this measure
Returns the previous measure in the part
- rtype:
None
Methods Documentation
- beatBoundaries()[source]¶
The beat offsets, including the end of the measure
- Return type:
list
[Fraction
]- Returns:
the boundaries of the beats, which is the offsets plus the end of the measure
- beatDurations()[source]¶
Returns a list with the durations (in quarterNotes) of the beats in this measure
- Return type:
list
[Fraction
]
- beatOffsets()[source]¶
Returns a list of the offsets of each beat within this measure
- Return type:
list
[Fraction
]- Returns:
the offset of each beat. The first offset is always 0
- breakSyncopations(level='weak')[source]¶
Break notes extended over beat boundaries, in place
The level indicates which syncopations to break. ‘all’ will split any notations extending over any beat; ‘weak’ will only break syncopations over secondary beats (for example, the 3rd quarter-note in a 4/4 measure); ‘strong’ will only break syncopations over strong beats (the 4th quarternote in a 6/4 measure with the form 3+3, or the 3rd quarternote in a 7/8 measure with the form 2+2+3)
- Parameters:
level – one of ‘all’, ‘weak’, ‘strong’
- Return type:
None
- duration()[source]¶
Duration of this measure, in quarter notes
- Return type:
Fraction
- Returns:
the duration of the measure in quarter notes
- measureIndex()[source]¶
Return the measure index of this measure within the QuantizedPart
- Return type:
int
|None
- notations()[source]¶
Returns a flat list of all notations in this measure
- Return type:
list
[Notation
]- Returns:
a list of Notations in this measure
- previousMeasure()[source]¶
Returns the previous measure in the part
- Return type:
QuantizedMeasure
|None