qtargetitems¶
Abstract Classes
Abstract class for QTargetBeat and QTargetMeasure. |
- abstract class abjadext.nauert.qtargetitems.QTargetItem[source]¶
Abstract class for QTargetBeat and QTargetMeasure.
Attributes Summary
Read-only properties
- duration_in_ms¶
- offset_in_ms¶
Classes
Q-target beat. |
|
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
Calls q-target beat.
Gets repr.
Beatspan of q-target beat.
Duration in milliseconds of the q-target beat.
Offset in milliseconds of q-target beat.
A list for storing
QEventProxy
instances.The
QGrid
instance selected by aHeuristic
.A tuple of
QGrids
generated by aQuantizationJob
.Search tree of q-target beat.
MetronomeMark of q-target beat.
Special methods
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 aHeuristic
.Used internally by the
quantize
function.
- q_grids¶
A tuple of
QGrids
generated by aQuantizationJob
.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
groupQTargetBeats
:>>> 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, theQTargetMeasure
will only ever contain a singleQTargetBeat
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
Gets repr.
Gets the tuple of
QTargetBeats
contained by theQTargetMeasure
.The duration in milliseconds of the
QTargetMeasure
:The offset in milliseconds of the
QTargetMeasure
:The search tree of the
QTargetMeasure
:The tempo of the
QTargetMeasure
:The time signature of the
QTargetMeasure
:The
use_full_measure
flag of theQTargetMeasure
:Special methods
Read-only properties
- beats¶
Gets the tuple of
QTargetBeats
contained by theQTargetMeasure
.>>> 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 theQTargetMeasure
:>>> 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