TrillSpanner

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.Spanner.Spanner" [URL="../api/abjad/spanners/Spanner.html#abjad.spanners.Spanner.Spanner", label=Spanner, target=_top]; "abjad.spanners.TrillSpanner.TrillSpanner" [URL="../api/abjad/spanners/TrillSpanner.html#abjad.spanners.TrillSpanner.TrillSpanner", color=black, fontcolor=white, label="Trill\nSpanner", target=_top]; "abjad.spanners.Spanner.Spanner" -> "abjad.spanners.TrillSpanner.TrillSpanner"; } 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.TrillSpanner.TrillSpanner(*, interval=None, is_harmonic=None, left_broken=None, pitch=None, right_broken=None)

Trill spanner.

Attaches unpitched trill spanner to all notes in staff:

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

Attaches pitched trill spanner to all notes in staff:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> trill = abjad.TrillSpanner(pitch=abjad.NamedPitch("cs'"))
>>> abjad.attach(trill, staff[:])
>>> abjad.show(staff) 

REGRESSION. Pitched trill spanner must appear after markup to avoid hiding markup in graphic output:

>>> staff = abjad.Staff("c'4 d' e' r")
>>> markup = abjad.Markup('Allegro', direction=abjad.Up)
>>> abjad.attach(markup, staff[0])
>>> trill_spanner = abjad.TrillSpanner(pitch='Db4')
>>> abjad.attach(trill_spanner, staff[:])
>>> abjad.show(staff) 

Attributes Summary

cross_segment_examples Cross-segment examples.
interval Gets interval of trill.
is_harmonic Is true when trill pitch note-head is harmonic.
left_broken Is true when spanner is left-broken.
pitch Gets pitch.
right_broken Is true when spanner is right-broken.
written_pitch Gets written pitch of trill spanner.

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

cross_segment_examples

Cross-segment examples.

Cross-segment example #1 (one-to-one):

>>> segment_1 = abjad.Voice("c'4 d' e' f'", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(right_broken=True)
>>> abjad.attach(trill_spanner, segment_1[-1:])
>>> abjad.show(segment_1, strict=50) 
>>> segment_2 = abjad.Voice("g'4 f'2 r4", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(left_broken=True)
>>> abjad.attach(trill_spanner, segment_2[:1])
>>> abjad.show(segment_2, strict=50) 
>>> container = abjad.Container([segment_1, segment_2])
>>> text = format(container, 'lilypond')
>>> text = abjad.LilyPondFormatManager.left_shift_tags(text, 50)
>>> job = abjad.Job.join_broken_spanners(text)
>>> text = job()
>>> lines = text.split('\n')
>>> lilypond_file = abjad.LilyPondFile.new(lines)
>>> abjad.show(lilypond_file, strict=50) 

Cross-segment example #2 (one-to-many):

>>> segment_1 = abjad.Voice("c'4 d' e' f'", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(right_broken=True)
>>> abjad.attach(trill_spanner, segment_1[-1:])
>>> abjad.show(segment_1, strict=50) 
>>> segment_2 = abjad.Voice("g'4 f'2 r4", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(left_broken=True)
>>> abjad.attach(trill_spanner, segment_2[:])
>>> abjad.show(segment_2, strict=50) 
>>> container = abjad.Container([segment_1, segment_2])
>>> text = format(container, 'lilypond')
>>> text = abjad.LilyPondFormatManager.left_shift_tags(text, 50)
>>> job = abjad.Job.join_broken_spanners(text)
>>> text = job()
>>> lines = text.split('\n')
>>> lilypond_file = abjad.LilyPondFile.new(lines)
>>> abjad.show(lilypond_file, strict=50) 

Cross-segment example #3 (many-to-one):

>>> segment_1 = abjad.Voice("c'4 d' e' f'", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(right_broken=True)
>>> abjad.attach(trill_spanner, segment_1[:])
>>> abjad.show(segment_1, strict=50) 
>>> segment_2 = abjad.Voice("g'4 f'2 r4", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(left_broken=True)
>>> abjad.attach(trill_spanner, segment_2[:1])
>>> abjad.show(segment_2, strict=50) 
>>> container = abjad.Container([segment_1, segment_2])
>>> text = format(container, 'lilypond')
>>> text = abjad.LilyPondFormatManager.left_shift_tags(text, 50)
>>> job = abjad.Job.join_broken_spanners(text)
>>> text = job()
>>> lines = text.split('\n')
>>> lilypond_file = abjad.LilyPondFile.new(lines)
>>> abjad.show(lilypond_file, strict=50) 

Cross-segment example #4 (many-to-many):

>>> segment_1 = abjad.Voice("c'4 d' e' f'", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(right_broken=True)
>>> abjad.attach(trill_spanner, segment_1[:])
>>> abjad.show(segment_1, strict=50) 
>>> segment_2 = abjad.Voice("g'4 f'2 r4", name='MainVoice')
>>> trill_spanner = abjad.TrillSpanner(left_broken=True)
>>> abjad.attach(trill_spanner, segment_2[:])
>>> abjad.show(segment_2, strict=50) 
>>> container = abjad.Container([segment_1, segment_2])
>>> text = format(container, 'lilypond')
>>> text = abjad.LilyPondFormatManager.left_shift_tags(text, 50)
>>> job = abjad.Job.join_broken_spanners(text)
>>> text = job()
>>> lines = text.split('\n')
>>> lilypond_file = abjad.LilyPondFile.new(lines)
>>> abjad.show(lilypond_file, strict=50) 
interval

Gets interval of trill.

Attaches semitone trill:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> trill = abjad.TrillSpanner(
...     interval=abjad.NamedInterval('m2'),
...     )
>>> abjad.attach(trill, staff[:])
>>> abjad.show(staff) 

Attaches whole tone trill:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> trill = abjad.TrillSpanner(
...     interval=abjad.NamedInterval('M2'),
...     )
>>> abjad.attach(trill, staff[:])
>>> abjad.show(staff) 

Defaults to none.

Set to interval or none.

Returns interval or none.

Return type:Optional[NamedInterval]
is_harmonic

Is true when trill pitch note-head is harmonic.

Attaches harmonic trill:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> trill = abjad.TrillSpanner(
...     is_harmonic=True,
...     pitch=abjad.NamedPitch("d'"),
...     )
>>> abjad.attach(trill, staff[:])
>>> abjad.show(staff) 

Defaults to false.

Set to true or false.

Returns true or false.

Return type:Optional[bool]
(Spanner).leaves

Gets leaves in spanner.

Return type:Selection
left_broken

Is true when spanner is left-broken.

Return type:Optional[bool]
pitch

Gets pitch.

Returns pitch when trill spanner is pitched:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> pitch = abjad.NamedPitch('C#4')
>>> trill = abjad.TrillSpanner(pitch=pitch)
>>> abjad.attach(trill, staff[:2])
>>> abjad.show(staff) 
>>> trill.pitch
NamedPitch("cs'")

Returns none when trill spanner is unpitched:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> trill = abjad.TrillSpanner()
>>> abjad.attach(trill, staff[:2])
>>> abjad.show(staff) 
>>> trill.pitch is None
True

Formats LilyPond \pitchedTrill command on first leaf in spanner.

Defaults to none.

Set to named pitch or none.

Returns named pitch or none.

Return type:Optional[NamedPitch]
right_broken

Is true when spanner is right-broken.

Return type:Optional[bool]
(Spanner).tweaks

Gets tweaks.

Return type:Optional[LilyPondTweakManager]
written_pitch

Gets written pitch of trill spanner.

Returns pitch when trill spanner is pitched:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> pitch = abjad.NamedPitch('C#4')
>>> trill = abjad.TrillSpanner(pitch=pitch)
>>> abjad.attach(trill, staff[:2])
>>> abjad.show(staff) 
>>> trill.written_pitch
NamedPitch("cs'")

Returns none when trill spanner is unpitched:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> trill = abjad.TrillSpanner()
>>> abjad.attach(trill, staff[:2])
>>> abjad.show(staff) 
>>> trill.written_pitch is None
True

Alias defined equal to pitch of trill spanner.

Defaults to none.

Property can not be set.

Returns named pitch or none.

Return type:Optional[NamedPitch]