QTargetBeat

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=1]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjadext/nauert/../../abjad/system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; } subgraph "cluster_abjadext.nauert" { graph [label="abjadext.nauert"]; node [color=2]; "abjadext.nauert.QTargetBeat.QTargetBeat" [URL="../api/abjadext/nauert/QTargetBeat.html#abjadext.nauert.QTargetBeat.QTargetBeat", color=black, fontcolor=white, label="QTarget\nBeat", target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadObject.AbjadObject" -> "abjadext.nauert.QTargetBeat.QTargetBeat"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

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

Q-target beat.

Represents a single beat in a quantization target.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = abjadext.nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark((1, 4), 56)
>>> q_target_beat = abjadext.nauert.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> abjad.f(q_target_beat)
abjadext.nauert.QTargetBeat(
    beatspan=abjad.Duration(1, 8),
    offset_in_ms=abjad.Offset(1500, 1),
    search_tree=abjadext.nauert.UnweightedSearchTree(
        definition={   3: None,
            },
        ),
    tempo=abjad.MetronomeMark(
        reference_duration=abjad.Duration(1, 4),
        units_per_minute=56,
        ),
    )

Not composer-safe.

Used internally by Quantizer.


Attributes Summary

__call__ Calls q-target beat.
__format__ Formats q-event.
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 MetronomeMark of q-target beat.

Special methods

__call__(job_id)

Calls q-target beat.

Returns quantization job.

__format__(format_specification='')

Formats q-event.

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

Returns string.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

beatspan

Beatspan of q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = abjadext.nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark((1, 4), 56)
>>> q_target_beat = abjadext.nauert.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> q_target_beat.beatspan
Duration(1, 8)

Returns duration.

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.

duration_in_ms

Duration in milliseconds of the q-targeg beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = abjadext.nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark((1, 4), 56)
>>> q_target_beat = abjadext.nauert.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> q_target_beat.duration_in_ms
Duration(3750, 7)

Returns duration.

offset_in_ms

Offset in milliseconds of q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = abjadext.nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark((1, 4), 56)
>>> q_target_beat = abjadext.nauert.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> q_target_beat.offset_in_ms
Offset(1500, 1)

Returns offset.

q_events

A list for storing QEventProxy instances.

Used internally by the Quantizer.

Returns list.

q_grid

The QGrid instance selected by a Heuristic.

Used internally by the Quantizer.

Returns QGrid instance.

q_grids

A tuple of QGrids generated by a QuantizationJob.

Used internally by the Quantizer.

Returns tuple.

search_tree

Search tree of q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = abjadext.nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark((1, 4), 56)
>>> q_target_beat = abjadext.nauert.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> q_target_beat.search_tree
UnweightedSearchTree(definition={3: None})

Returns search tree.

tempo

MetronomeMark of q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = abjadext.nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark((1, 4), 56)
>>> q_target_beat = abjadext.nauert.QTargetBeat(
...     beatspan=beatspan,
...     offset_in_ms=offset_in_ms,
...     search_tree=search_tree,
...     tempo=tempo,
...     )
>>> q_target_beat.tempo
MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=56)

Returns tempo.