QTargetMeasure

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.QTargetMeasure.QTargetMeasure" [URL="../api/abjadext/nauert/QTargetMeasure.html#abjadext.nauert.QTargetMeasure.QTargetMeasure", color=black, fontcolor=white, label="QTarget\nMeasure", 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.QTargetMeasure.QTargetMeasure"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjadext.nauert.QTargetMeasure.QTargetMeasure(offset_in_ms=None, search_tree=None, time_signature=None, tempo=None, use_full_measure=False)

Q-target measure.

Represents a single measure in a measurewise quantization target.

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> abjad.f(q_target_measure)
abjadext.nauert.QTargetMeasure(
    offset_in_ms=abjad.Offset(1000, 1),
    search_tree=abjadext.nauert.UnweightedSearchTree(
        definition={   2: None,
            },
        ),
    time_signature=abjad.TimeSignature((4, 4)),
    tempo=abjad.MetronomeMark(
        reference_duration=abjad.Duration(1, 4),
        units_per_minute=60,
        ),
    use_full_measure=False,
    )

QTargetMeasures group QTargetBeats:

>>> for q_target_beat in q_target_measure.beats:
...     print(q_target_beat.offset_in_ms, q_target_beat.duration_in_ms)
1000 1000
2000 1000
3000 1000
4000 1000

If use_full_measure is set, the QTargetMeasure will only ever contain a single QTargetBeat instance:

>>> another_q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     use_full_measure=True,
...     )
>>> for q_target_beat in another_q_target_measure.beats:
...     print(q_target_beat.offset_in_ms, q_target_beat.duration_in_ms)
1000 4000

Not composer-safe.

Used internally by Quantizer.


Attributes Summary

__format__ Formats q-event.
beats Gets the tuple of QTargetBeats contained by the QTargetMeasure.
duration_in_ms The duration in milliseconds of the QTargetMeasure:
offset_in_ms The offset in milliseconds of the QTargetMeasure:
search_tree The search tree of the QTargetMeasure:
tempo The tempo of the QTargetMeasure:
time_signature The time signature of the QTargetMeasure:
use_full_measure The use_full_measure flag of the QTargetMeasure:

Special methods

__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

beats

Gets the tuple of QTargetBeats contained by the QTargetMeasure.

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> for q_target_beat in q_target_measure.beats:
...     abjad.f(q_target_beat)
...
abjadext.nauert.QTargetBeat(
    beatspan=abjad.Duration(1, 4),
    offset_in_ms=abjad.Offset(1000, 1),
    search_tree=abjadext.nauert.UnweightedSearchTree(
        definition={   2: None,
            },
        ),
    tempo=abjad.MetronomeMark(
        reference_duration=abjad.Duration(1, 4),
        units_per_minute=60,
        ),
    )
abjadext.nauert.QTargetBeat(
    beatspan=abjad.Duration(1, 4),
    offset_in_ms=abjad.Offset(2000, 1),
    search_tree=abjadext.nauert.UnweightedSearchTree(
        definition={   2: None,
            },
        ),
    tempo=abjad.MetronomeMark(
        reference_duration=abjad.Duration(1, 4),
        units_per_minute=60,
        ),
    )
abjadext.nauert.QTargetBeat(
    beatspan=abjad.Duration(1, 4),
    offset_in_ms=abjad.Offset(3000, 1),
    search_tree=abjadext.nauert.UnweightedSearchTree(
        definition={   2: None,
            },
        ),
    tempo=abjad.MetronomeMark(
        reference_duration=abjad.Duration(1, 4),
        units_per_minute=60,
        ),
    )
abjadext.nauert.QTargetBeat(
    beatspan=abjad.Duration(1, 4),
    offset_in_ms=abjad.Offset(4000, 1),
    search_tree=abjadext.nauert.UnweightedSearchTree(
        definition={   2: None,
            },
        ),
    tempo=abjad.MetronomeMark(
        reference_duration=abjad.Duration(1, 4),
        units_per_minute=60,
        ),
    )

Returns tuple.

duration_in_ms

The duration in milliseconds of the QTargetMeasure:

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> q_target_measure.duration_in_ms
Duration(4000, 1)

Returns duration.

offset_in_ms

The offset in milliseconds of the QTargetMeasure:

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> q_target_measure.offset_in_ms
Offset(1000, 1)

Returns offset.

search_tree

The search tree of the QTargetMeasure:

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> q_target_measure.search_tree
UnweightedSearchTree(definition={2: None})

Returns search tree.

tempo

The tempo of the QTargetMeasure:

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> q_target_measure.tempo
MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=60)

Returns metronome mark.

time_signature

The time signature of the QTargetMeasure:

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> q_target_measure.time_signature
TimeSignature((4, 4))

Returns time signature.

use_full_measure

The use_full_measure flag of the QTargetMeasure:

>>> search_tree = abjadext.nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark((1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = abjadext.nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
...     )
>>> q_target_measure.use_full_measure
False

Returns true or false.