LogicalMeasureSelectorCallback

class selectortools.LogicalMeasureSelectorCallback

Logical measure selector callback.

>>> import abjad

Score for examples 1 - 3:

>>> staff = abjad.Staff("c'8 d' e' f' g' a' b' c''")
>>> abjad.attach(abjad.TimeSignature((2, 8)), staff[0])
>>> abjad.attach(abjad.TimeSignature((3, 8)), staff[4])
>>> abjad.attach(abjad.TimeSignature((1, 8)), staff[7])
>>> show(staff) 

Selects the leaves of every logical measure:

>>> selector = abjad.select()
>>> selector = selector.by_leaf()
>>> selector = selector.by_logical_measure()
>>> for selection in selector(staff):
...     selection
...
Selection([Note("c'8"), Note("d'8")])
Selection([Note("e'8"), Note("f'8")])
Selection([Note("g'8"), Note("a'8"), Note("b'8")])
Selection([Note("c''8")])

Selects the first leaf of every logical measure:

>>> selector = abjad.select()
>>> selector = selector.by_leaf()
>>> selector = selector.by_logical_measure()
>>> selector = selector[0]
>>> selector(staff)
Selection([Note("c'8"), Note("e'8"), Note("g'8"), Note("c''8")])

Selects the last leaf of every logical measure:

>>> selector = abjad.select()
>>> selector = selector.by_leaf()
>>> selector = selector.by_logical_measure()
>>> selector = selector[-1]
>>> selector(staff)
Selection([Note("d'8"), Note("f'8"), Note("b'8"), Note("c''8")])

Works with implicit time signatures:

>>> staff = abjad.Staff("c'4 d' e' f' g' a' b' c''")
>>> score = abjad.Score([staff])
>>> scheme = abjad.SchemeMoment((1, 16))
>>> abjad.setting(score).proportional_notation_duration = scheme
>>> show(score) 
>>> selector = abjad.select()
>>> selector = selector.by_leaf()
>>> selector = selector.by_logical_measure()
>>> for selection in selector(score):
...     selection
...
Selection([Note("c'4"), Note("d'4"), Note("e'4"), Note("f'4")])
Selection([Note("g'4"), Note("a'4"), Note("b'4"), Note("c''4")])

Groups components by the logical measure of component start offset.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_selectortools { graph [label=selectortools]; "abjad.tools.selectortools.LogicalMeasureSelectorCallback.LogicalMeasureSelectorCallback" [color=black, fontcolor=white, group=2, label=<<B>LogicalMeasureSelectorCallback</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.selectortools.LogicalMeasureSelectorCallback.LogicalMeasureSelectorCallback"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

__call__(argument[, rotation]) Iterates argument.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when all initialization values of Abjad value object equal the initialization values of argument.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad value object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Special methods

LogicalMeasureSelectorCallback.__call__(argument, rotation=None)

Iterates argument.

Returns tuple of selections.

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.