MeasuredComplexBeam

class spannertools.MeasuredComplexBeam(direction=None, isolated_nib_direction=False, overrides=None, span_beam_count=1)

Measured complex beam.

>>> import abjad
>>> staff = abjad.Staff()
>>> staff.append(abjad.Measure((2, 16), "c'16 d'16"))
>>> staff.append(abjad.Measure((2, 16), "e'16 f'16"))
>>> abjad.setting(staff).auto_beaming = False
>>> show(staff) 
>>> beam = abjad.MeasuredComplexBeam()
>>> selector = abjad.select().by_leaf(flatten=True)
>>> leaves = selector(staff)
>>> abjad.attach(beam, leaves)
>>> show(staff) 

Beams leaves in spanner explicitly.

Groups leaves by measures.

Formats top-level span_beam_count beam between measures.

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.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_spannertools { graph [label=spannertools]; "abjad.tools.spannertools.Beam.Beam" [color=3, group=2, label=Beam, shape=box]; "abjad.tools.spannertools.ComplexBeam.ComplexBeam" [color=3, group=2, label=ComplexBeam, shape=box]; "abjad.tools.spannertools.MeasuredComplexBeam.MeasuredComplexBeam" [color=black, fontcolor=white, group=2, label=<<B>MeasuredComplexBeam</B>>, shape=box, style="filled, rounded"]; "abjad.tools.spannertools.Spanner.Spanner" [color=3, group=2, label=Spanner, shape=box]; "abjad.tools.spannertools.Beam.Beam" -> "abjad.tools.spannertools.ComplexBeam.ComplexBeam"; "abjad.tools.spannertools.ComplexBeam.ComplexBeam" -> "abjad.tools.spannertools.MeasuredComplexBeam.MeasuredComplexBeam"; "abjad.tools.spannertools.Spanner.Spanner" -> "abjad.tools.spannertools.Beam.Beam"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.spannertools.Spanner.Spanner"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

beam_rests Is true when beam should include rests and skips.
components Gets leaves in spanner.
direction Gets direction.
isolated_nib_direction Gets directed treatment to apply to lone nibs.
name Gets spanner name.
overrides Gets overrides.
span_beam_count Gets number of span beams between adjacent measures.
__contains__(argument) Is true when spanner contains argument.
__copy__(*arguments) Copies spanner.
__eq__(argument) Is true when ID of argument equals ID of Abjad object.
__format__([format_specification]) Formats Abjad object.
__getitem__(argument) Gets item or slice identified by argument.
__hash__() Hashes Abjad object.
__len__() Gets number of components in spanner.
__lt__(argument) Is true when spanner is less than argument.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

(ComplexBeam).beam_rests

Is true when beam should include rests and skips. Otherwise false.

Does not beam rests:

>>> staff = abjad.Staff("c'8 r r d'")
>>> beam = abjad.ComplexBeam(beam_rests=False)
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

This is default behavior.

Does beam rests:

>>> staff = abjad.Staff("c'8 r r d'")
>>> beam = abjad.ComplexBeam(beam_rests=True)
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Does not beam skips:

>>> staff = abjad.Staff("c'8 s s d'")
>>> beam = abjad.ComplexBeam(beam_rests=False)
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

This is default behavior.

Does beam skips:

>>> staff = abjad.Staff("c'8 s s d'")
>>> beam = abjad.ComplexBeam(beam_rests=True)
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Defaults to none.

Set to true, false or none.

Returns true, false or none.

(Spanner).components

Gets leaves in spanner.

Returns selection of leaves.

(Beam).direction

Gets direction.

Defaults to none.

Set to up, down or none.

Returns up, down or none.

(ComplexBeam).isolated_nib_direction

Gets directed treatment to apply to lone nibs.

Beams lone leaf and forces nib to the left:

>>> measure = abjad.Measure((1, 16), "c'16")
>>> beam = abjad.ComplexBeam(isolated_nib_direction=Left)
>>> abjad.attach(beam, measure[:])
>>> show(measure) 

Beams lone leaf and forces nib to the right:

>>> measure = abjad.Measure((1, 16), "c'16")
>>> beam = abjad.ComplexBeam(isolated_nib_direction=Right)
>>> abjad.attach(beam, measure[:])
>>> show(measure) 

Beams lone leaf and forces nibs both left and right:

>>> measure = abjad.Measure((1, 16), "c'16")
>>> beam = abjad.ComplexBeam(isolated_nib_direction=True)
>>> abjad.attach(beam, measure[:])
>>> show(measure) 

Does not beam isolated_nib_direction leaf:

>>> measure = abjad.Measure((1, 16), "c'16")
>>> beam = abjad.ComplexBeam(isolated_nib_direction=False)
>>> abjad.attach(beam, measure[:])
>>> show(measure) 

Set to left, right, true or false.

Ignores this setting when spanner contains more than one leaf.

(Spanner).name

Gets spanner name.

Returns string.

(Spanner).overrides

Gets overrides.

Returns dictionary.

MeasuredComplexBeam.span_beam_count

Gets number of span beams between adjacent measures.

Use one span beam between measures:

>>> staff = abjad.Staff()
>>> staff.append(abjad.Measure((2, 32), "c'32 d'32"))
>>> staff.append(abjad.Measure((2, 32), "e'32 f'32"))
>>> selector = abjad.select().by_leaf(flatten=True)
>>> leaves = selector(staff)
>>> beam = abjad.MeasuredComplexBeam(span_beam_count=1)
>>> abjad.attach(beam, leaves)
>>> show(staff) 
>>> beam.span_beam_count
1

Use two span beams between measures:

>>> staff = abjad.Staff()
>>> staff.append(abjad.Measure((2, 32), "c'32 d'32"))
>>> staff.append(abjad.Measure((2, 32), "e'32 f'32"))
>>> beam = abjad.MeasuredComplexBeam(span_beam_count=2)
>>> selector = abjad.select().by_leaf(flatten=True)
>>> leaves = selector(staff)
>>> abjad.attach(beam, leaves)
>>> show(staff) 
>>> beam.span_beam_count
2

Returns nonnegative integer or none.

Special methods

(Spanner).__contains__(argument)

Is true when spanner contains argument. Otherwise false.

Returns true or false.

(Spanner).__copy__(*arguments)

Copies spanner.

Does not copy spanner components.

Returns new spanner.

(AbjadObject).__eq__(argument)

Is true when ID of argument equals ID of Abjad object. Otherwise false.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

(Spanner).__getitem__(argument)

Gets item or slice identified by argument.

Returns component.

(AbjadObject).__hash__()

Hashes Abjad object.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

(Spanner).__len__()

Gets number of components in spanner.

Returns nonnegative integer.

(Spanner).__lt__(argument)

Is true when spanner is less than argument. Otherwise false.

Trivial comparison to allow doctests to work.

Returns true or false.

(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.