QTargetBeat

class quantizationtools.QTargetBeat(beatspan=None, offset_in_ms=None, search_tree=None, tempo=None)

Representation of a single “beat” in a quantization target.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = quantizationtools.UnweightedSearchTree({3: None})
>>> tempo = Tempo((1, 4), 56)
>>> q_target_beat = quantizationtools.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> print(format(q_target_beat))
quantizationtools.QTargetBeat(
    beatspan=durationtools.Duration(1, 8),
    offset_in_ms=durationtools.Offset(1500, 1),
    search_tree=quantizationtools.UnweightedSearchTree(
        definition={   3: None,
            },
        ),
    tempo=indicatortools.Tempo(
        reference_duration=durationtools.Duration(1, 4),
        units_per_minute=56,
        ),
    )

Not composer-safe.

Used internally by Quantizer.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_quantizationtools { graph [label=quantizationtools]; "abjad.tools.quantizationtools.QTargetBeat.QTargetBeat" [color=black, fontcolor=white, group=2, label=<<B>QTargetBeat</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.quantizationtools.QTargetBeat.QTargetBeat"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

beatspan Beatspan of q-target beat.
distances A list of computed distances between the QEventProxies associated with a QTargetBeat instance, and each QGrid generated for that beat.
duration_in_ms Duration in milliseconds of the q-targeg beat.
offset_in_ms Offset in milliseconds of q-target beat.
q_events A list for storing QEventProxy instances.
q_grid The QGrid instance selected by a Heuristic.
q_grids A tuple of QGrids generated by a QuantizationJob.
search_tree Search tree of q-target beat.
tempo Tempo of q-target beat.
__call__(job_id) Calls q-target beat.
__eq__(expr) Is true when ID of expr equals ID of Abjad object.
__format__([format_specification]) Formats q-event.
__hash__() Hashes Abjad object.
__ne__(expr) Is true when Abjad object does not equal expr.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

QTargetBeat.beatspan

Beatspan of q-target beat.

>>> q_target_beat.beatspan
Duration(1, 8)

Returns duration.

QTargetBeat.distances

A list of computed distances between the QEventProxies associated with a QTargetBeat instance, and each QGrid generated for that beat.

Used internally by the Quantizer.

Returns tuple.

QTargetBeat.duration_in_ms

Duration in milliseconds of the q-targeg beat.

>>> q_target_beat.duration_in_ms
Duration(3750, 7)

Returns duration.

QTargetBeat.offset_in_ms

Offset in milliseconds of q-target beat.

>>> q_target_beat.offset_in_ms
Offset(1500, 1)

Returns offset.

QTargetBeat.q_events

A list for storing QEventProxy instances.

Used internally by the Quantizer.

Returns list.

QTargetBeat.q_grid

The QGrid instance selected by a Heuristic.

Used internally by the Quantizer.

Returns QGrid instance.

QTargetBeat.q_grids

A tuple of QGrids generated by a QuantizationJob.

Used internally by the Quantizer.

Returns tuple.

QTargetBeat.search_tree

Search tree of q-target beat.

>>> q_target_beat.search_tree
UnweightedSearchTree(definition={3: None})

Returns search tree.

QTargetBeat.tempo

Tempo of q-target beat.

>>> q_target_beat.tempo
Tempo(reference_duration=Duration(1, 4), units_per_minute=56)

Returns tempo.

Special methods

QTargetBeat.__call__(job_id)

Calls q-target beat.

Returns quantization job.

(AbjadObject).__eq__(expr)

Is true when ID of expr equals ID of Abjad object. Otherwise false.

Returns true or false.

QTargetBeat.__format__(format_specification='')

Formats q-event.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(AbjadObject).__hash__()

Hashes Abjad object.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

(AbjadObject).__ne__(expr)

Is true when Abjad object does not equal expr. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.