DuratedComplexBeam

class spannertools.DuratedComplexBeam(beam_rests=None, direction=None, durations=None, isolated_nib_direction=False, nibs_towards_nonbeamable_components=True, overrides=None, span_beam_count=1)

Durated complex beam.

>>> import abjad

Two groups:

>>> staff = abjad.Staff("c'16 d'16 e'16 f'16 g'16")
>>> abjad.setting(staff).auto_beaming = False
>>> durations = [(2, 16), (3, 16)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     span_beam_count=1,
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Two different groups:

>>> staff = abjad.Staff("c'16 d'16 e'16 f'16 g'16")
>>> abjad.setting(staff).auto_beaming = False
>>> durations = [(3, 16), (2, 16)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     span_beam_count=1,
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Groups leaves in spanner according to durations.

Spans leaves between groups according to span_beam_count.

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.DuratedComplexBeam.DuratedComplexBeam" [color=black, fontcolor=white, group=2, label=<<B>DuratedComplexBeam</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.DuratedComplexBeam.DuratedComplexBeam"; "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.
durations Gets durations.
isolated_nib_direction Gets directed treatment to apply to lone nibs.
name Gets spanner name.
nibs_towards_nonbeamable_components Is true when when spanner should render nibs pointing towards nonbeamable components included in spanner.
overrides Gets overrides.
span_beam_count Gets span beam count.
__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

DuratedComplexBeam.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.DuratedComplexBeam(beam_rests=False)
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

This is default behavior.

Beams rests:

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

Beams skips:

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

This is default behavior.

Beams skips:

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

Beams large skip with skip at end:

>>> string = "c'8 s4 d'8 s8"
>>> staff = abjad.Staff(string)
>>> beam = abjad.DuratedComplexBeam(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.

DuratedComplexBeam.durations

Gets durations.

Two groups:

>>> staff = abjad.Staff("c'16 d'16 e'16 f'16")
>>> durations = [(1, 8), (1, 8)]
>>> beam = abjad.DuratedComplexBeam(durations=durations)
>>> abjad.attach(beam, staff[:])
>>> show(staff) 
>>> beam.durations
(Duration(1, 8), Duration(1, 8))

Three groups:

>>> staff = abjad.Staff("c'16 d'16 e'8 f'16 c'16")
>>> abjad.setting(staff).auto_beaming = False
>>> durations = [(1, 8), (1, 8), (1, 8)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     span_beam_count=1,
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Test ensures that leaf groups format correctly when they contain only one leaf.

Defaults to none.

Set to durations or none.

Returns tuple of durations 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.

DuratedComplexBeam.nibs_towards_nonbeamable_components

Is true when when spanner should render nibs pointing towards nonbeamable components included in spanner. Otherwise false.

Does not draw nibs towards nonbeamable components:

>>> staff = abjad.Staff("c'16 d'16 r4 e'16 f'16")
>>> durations = [(1, 8), (1, 4), (1, 8)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     nibs_towards_nonbeamable_components=False
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Draws nibs towards nonbeamable components:

>>> staff = abjad.Staff("c'16 d'16 r4 e'16 f'16")
>>> durations = [(1, 8), (1, 4), (1, 8)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     nibs_towards_nonbeamable_components=True
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 

Defaults to true.

Set to true or false.

Returns true or false.

(Spanner).overrides

Gets overrides.

Returns dictionary.

DuratedComplexBeam.span_beam_count

Gets span beam count.

Creates a single span beam between adjacent groups in spanner:

>>> staff = abjad.Staff("c'32 d'32 e'32 f'32")
>>> durations = [(1, 16), (1, 16)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     span_beam_count=1,
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 
>>> beam.span_beam_count
1

Creates a double span beam between adjacent groups in spanner:

>>> staff = abjad.Staff("c'32 d'32 e'32 f'32")
>>> durations = [(1, 16), (1, 16)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     span_beam_count=2,
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 
>>> beam.span_beam_count
2

Creates no span beam between adjacent groups in spanner:

>>> staff = abjad.Staff("c'32 d'32 e'32 f'32")
>>> durations = [(1, 16), (1, 16)]
>>> beam = abjad.DuratedComplexBeam(
...     durations=durations,
...     span_beam_count=0,
...     )
>>> abjad.attach(beam, staff[:])
>>> show(staff) 
>>> beam.span_beam_count
0

Defaults to 1.

Set to nonnegative integer.

Returns nonnegative integer.

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.