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 signature

  • quarterTempo (Fraction) – the tempo of the quarter note

  • beats (list[QuantizedBeat]) – a list of QuantizedBeats

  • quantprofile (QuantizationProfile) – the quantization profile used to generate this quantized measure. This is necessary to create a tree structure

  • subdivisions (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

beatBoundaries()

The beat offsets, including the end of the measure

beatDurations()

Returns a list with the durations (in quarterNotes) of the beats in this measure

beatOffsets()

Returns a list of the offsets of each beat within this measure

beatStructure()

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?

logicalTies()

rtype:

list[list[TreeLocation]]

measureIndex()

Return the measure index of this measure within the QuantizedPart

notations()

Returns a flat list of all notations in this measure

previousMeasure()

Returns the previous measure in the part

removeUnnecessaryGracenotes()

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

beatStructure()[source]
Return type:

list[BeatStructure]

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

check()[source]
dump(numindents=0, indent='  ', tree=True, stream=None)[source]
Return type:

None

duration()[source]

Duration of this measure, in quarter notes

Return type:

Fraction

Returns:

the duration of the measure in quarter notes

empty()[source]

Is this measure empty?

Return type:

bool

Returns:

True if empty

logicalTies()[source]
Return type:

list[list[TreeLocation]]

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

removeUnnecessaryGracenotes()[source]
Return type:

None