Slur

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.spanners" { graph [label="abjad.spanners"]; node [color=1]; "abjad.spanners.Slur.Slur" [URL="../api/abjad/spanners/Slur.html#abjad.spanners.Slur.Slur", color=black, fontcolor=white, label=Slur, target=_top]; "abjad.spanners.Spanner.Spanner" [URL="../api/abjad/spanners/Spanner.html#abjad.spanners.Spanner.Spanner", label=Spanner, target=_top]; "abjad.spanners.Spanner.Spanner" -> "abjad.spanners.Slur.Slur"; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/spanners/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.spanners.Spanner.Spanner"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.spanners.Slur.Slur(*, direction=None)

Slur.

Slurs four notes:

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Slur(), staff[:])
>>> abjad.show(staff) 

Tweaks slur color:

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> slur = abjad.Slur()
>>> abjad.tweak(slur).color = 'red'
>>> abjad.attach(slur, staff[:])
>>> abjad.show(staff) 

Raises exception on fewer than two leaves:

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Slur(), staff[:1])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/josiah/Source/github.com/Abjad/abjad/abjad/top/attach.py", line 243, in attach
    raise Exception(message)
Exception: Slur()._attachment_test_all():
  Requires at least two leaves.
  Not just Note("c'4").

Attributes Summary

direction Gets direction.

Special methods

(Spanner).__contains__(argument)

Is true when spanner contains argument.

Return type:bool
(Spanner).__copy__(*arguments)

Copies spanner.

Does not copy spanner leaves.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

(Spanner).__getitem__(argument)

Gets leaf or selection identified by argument.

Return type:Union[Leaf, Selection]
(Spanner).__iter__()

Iterates leaves in spanner.

Return type:Iterator[+T_co]
(Spanner).__len__()

Gets number of leaves in spanner.

Return type:int
(Spanner).__lt__(argument)

Is true when spanner is less than argument.

Trivial comparison to allow doctests to work.

Return type:bool
(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

direction

Gets direction.

Forces slur above staff:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> slur = abjad.Slur(direction=abjad.Up)
>>> abjad.attach(slur, staff[:])
>>> abjad.show(staff) 

Forces slur below staff:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> slur = abjad.Slur(direction=abjad.Down)
>>> abjad.attach(slur, staff[:])
>>> abjad.show(staff) 

Positions slur according to LilyPond defaults:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> slur = abjad.Slur(direction=None)
>>> abjad.attach(slur, staff[:])
>>> abjad.show(staff) 
Return type:Optional[String]
(Spanner).leaves

Gets leaves in spanner.

Return type:Selection
(Spanner).tweaks

Gets tweaks.

Return type:Optional[LilyPondTweakManager]