QuantizedBeat

class maelzel.scoring.quant.QuantizedBeat(divisions, assignedSlots, notations, beatDuration, beatOffset=Fraction(0, 1), quantizationError=0.0, quantizationInfo='', weight=0)[source]

Bases: object

A QuantizedBeat holds notations inside a beat filling the beat

Parameters:
  • divisions (tuple[int, ...]) – The division of this beat

  • assignedSlots (list[int]) – Which slots are assigned to notations in this beat

  • notations (list[Notation]) – The notations in this beat. They are cropped to fit

  • beatDuration (Fraction) – The duration of the beat in quarter notes

  • beatOffset (Fraction) – The offset of the beat in relation to the measure

  • quantizationError (float) – The error calculated during quantization. The higher the error, the less accurate the quantization

  • quantizationInfo (str) – Info collected during quantization

  • weight (int) – The weight of this beat within the measure. 2=strong, 1=weak, 0=no weight

Attributes Summary

assignedSlots

Which slots are assigned to notations in this beat

divisions

The division of this beat

duration

The duration of the beat in quarter notes

end

The end of this beat in quarternotes

notations

The notations in this beat.

offset

The offset of the beat in relation to the measure

quantizationError

The error calculated during quantization.

quantizationInfo

Info collected during quantization

weight

The weight of this beat within the measure.

Methods Summary

asTree()

Returns the notations in this beat as a tree

dump([indents, indent, stream])

Dump this beat

Attributes Documentation

assignedSlots: list[int]

Which slots are assigned to notations in this beat

divisions: tuple[int, ...]

The division of this beat

duration: Fraction

The duration of the beat in quarter notes

end

The end of this beat in quarternotes

notations: list[Notation]

The notations in this beat. They are cropped to fit

offset: Fraction

The offset of the beat in relation to the measure

quantizationError: float

The error calculated during quantization. The higher the error, the less accurate the quantization

quantizationInfo: str

Info collected during quantization

weight: int

The weight of this beat within the measure. 2=strong, 1=weak, 0=no weight

Methods Documentation

asTree()[source]

Returns the notations in this beat as a tree

Return type:

Node

Returns:

a Node which is the root of a tree representing the notations in this beat (grouped by their duration ratio)

dump(indents=0, indent='  ', stream=None)[source]

Dump this beat