QTargetMeasure¶
-
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
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 = 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 theQTargetMeasure
.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 theQTargetMeasure
: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 theQTargetMeasure
.>>> 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 theQTargetMeasure
:>>> 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.
-