qtargetitems

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_abc { graph [label=abc]; node [color=1]; "abc.ABC" [URL="https://docs.python.org/3.10/library/abc.html#abc.ABC", label=ABC, target=_top]; } subgraph "cluster_abjadext.nauert.qtargetitems" { graph [label="abjadext.nauert.qtargetitems"]; node [color=2]; "abjadext.nauert.qtargetitems.QTargetBeat" [URL="../api/abjadext/nauert/qtargetitems.html#abjadext.nauert.qtargetitems.QTargetBeat", color=black, fontcolor=white, label="QTarget\nBeat", target=_top]; "abjadext.nauert.qtargetitems.QTargetItem" [URL="../api/abjadext/nauert/qtargetitems.html#abjadext.nauert.qtargetitems.QTargetItem", color=black, fontcolor=white, label="QTarget\nItem", shape=oval, style="bold, filled", target=_top]; "abjadext.nauert.qtargetitems.QTargetMeasure" [URL="../api/abjadext/nauert/qtargetitems.html#abjadext.nauert.qtargetitems.QTargetMeasure", color=black, fontcolor=white, label="QTarget\nMeasure", target=_top]; "abjadext.nauert.qtargetitems.QTargetItem" -> "abjadext.nauert.qtargetitems.QTargetBeat"; "abjadext.nauert.qtargetitems.QTargetItem" -> "abjadext.nauert.qtargetitems.QTargetMeasure"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.10/library/functions.html#object", label=object, target=_top]; } "abc.ABC" -> "abjadext.nauert.qtargetitems.QTargetItem"; "builtins.object" -> "abc.ABC"; }


Abstract Classes

QTargetItem

Abstract class for QTargetBeat and QTargetMeasure.

abstract class abjadext.nauert.qtargetitems.QTargetItem[source]

Abstract class for QTargetBeat and QTargetMeasure.


Attributes Summary

duration_in_ms

offset_in_ms


Read-only properties

duration_in_ms
offset_in_ms

Classes

QTargetBeat

Q-target beat.

QTargetMeasure

Q-target measure.

class abjadext.nauert.qtargetitems.QTargetBeat(beatspan=None, offset_in_ms=None, search_tree=None, tempo=None)[source]

Q-target beat.

Represents a single beat in a quantization target.

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

Not composer-safe.

Used internally by the quantize function.


Attributes Summary

__call__

Calls q-target beat.

__repr__

Gets repr.

beatspan

Beatspan of q-target beat.

duration_in_ms

Duration in milliseconds of the q-target 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

overridden __call__(job_id)[source]

Calls q-target beat.

Returns quantization job.

Return type:

Optional[QuantizationJob]

overridden __repr__()[source]

Gets repr.


Read-only properties

beatspan

Beatspan of q-target beat.

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

Duration in milliseconds of the q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 56)
>>> q_target_beat = 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)
overridden offset_in_ms

Offset in milliseconds of q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 56)
>>> q_target_beat = 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))
q_events

A list for storing QEventProxy instances.

Used internally by the quantize function.

q_grid

The QGrid instance selected by a Heuristic.

Used internally by the quantize function.

q_grids

A tuple of QGrids generated by a QuantizationJob.

Used internally by the quantize function.

search_tree

Search tree of q-target beat.

>>> beatspan = (1, 8)
>>> offset_in_ms = 1500
>>> search_tree = nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 56)
>>> q_target_beat = 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 = nauert.UnweightedSearchTree({3: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 56)
>>> q_target_beat = 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, textual_indication=None, custom_markup=None, decimal=False, hide=False)
class abjadext.nauert.qtargetitems.QTargetMeasure(offset_in_ms=None, search_tree=None, time_signature=None, tempo=None, use_full_measure=False)[source]

Q-target measure.

Represents a single measure in a measurewise quantization target.

>>> search_tree = nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = nauert.QTargetMeasure(
...     offset_in_ms=1000,
...     search_tree=search_tree,
...     tempo=tempo,
...     time_signature=time_signature,
... )
>>> q_target_measure
QTargetMeasure(offset_in_ms=Offset((1000, 1)), search_tree=UnweightedSearchTree(definition={2: None}), tempo=MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=60, textual_indication=None, custom_markup=None, decimal=False, hide=False), 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 = 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 the quantize function.


Attributes Summary

__repr__

Gets repr.

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

overridden __repr__()[source]

Gets repr.


Read-only properties

beats

Gets the tuple of QTargetBeats contained by the QTargetMeasure.

>>> search_tree = nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = 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:
...     q_target_beat
... 
QTargetBeat(beatspan=Duration(1, 4), offset_in_ms=Offset((1000, 1)), search_tree=UnweightedSearchTree(definition={2: None}), tempo=MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=60, textual_indication=None, custom_markup=None, decimal=False, hide=False))
QTargetBeat(beatspan=Duration(1, 4), offset_in_ms=Offset((2000, 1)), search_tree=UnweightedSearchTree(definition={2: None}), tempo=MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=60, textual_indication=None, custom_markup=None, decimal=False, hide=False))
QTargetBeat(beatspan=Duration(1, 4), offset_in_ms=Offset((3000, 1)), search_tree=UnweightedSearchTree(definition={2: None}), tempo=MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=60, textual_indication=None, custom_markup=None, decimal=False, hide=False))
QTargetBeat(beatspan=Duration(1, 4), offset_in_ms=Offset((4000, 1)), search_tree=UnweightedSearchTree(definition={2: None}), tempo=MetronomeMark(reference_duration=Duration(1, 4), units_per_minute=60, textual_indication=None, custom_markup=None, decimal=False, hide=False))
overridden duration_in_ms

The duration in milliseconds of the QTargetMeasure:

>>> search_tree = nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = 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)
overridden offset_in_ms

The offset in milliseconds of the QTargetMeasure:

>>> search_tree = nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = 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))
search_tree

The search tree of the QTargetMeasure:

>>> search_tree = nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = 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})
tempo

The tempo of the QTargetMeasure:

>>> search_tree = nauert.UnweightedSearchTree({2: None})
>>> tempo = abjad.MetronomeMark(abjad.Duration(1, 4), 60)
>>> time_signature = abjad.TimeSignature((4, 4))
>>> q_target_measure = 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, textual_indication=None, custom_markup=None, decimal=False, hide=False)
time_signature

The time signature of the QTargetMeasure:

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

The use_full_measure flag of the QTargetMeasure:

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