Label

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.core" { graph [label="abjad.core"]; node [color=1]; "abjad.core.Label.Label" [URL="../api/abjad/core/Label.html#abjad.core.Label.Label", color=black, fontcolor=white, label=Label, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/core/../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.core.Label.Label"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.core.Label.Label(client=None, deactivate=None, tag=None)

Label.

Labels pitch names:

>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> abjad.label(staff).with_pitches(locale='us')
>>> abjad.show(staff) 
>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> expression = abjad.label().with_pitches(locale='us')
>>> abjad.f(expression)
abjad.Expression(
    callbacks=[
        abjad.Expression(
            evaluation_template='abjad.core.Label',
            is_initializer=True,
            keywords={
                'tag': None,
                },
            ),
        abjad.Expression(
            evaluation_template="{}.with_pitches(locale='us')",
            qualified_method_name='abjad.core.Label.with_pitches',
            ),
        ],
    proxy_class=abjad.Label,
    )
>>> expression(staff)
>>> abjad.show(staff) 

Labels durations:

>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> abjad.label(staff).with_durations()
>>> abjad.show(staff) 
>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> expression = abjad.label().with_durations()
>>> abjad.f(expression)
abjad.Expression(
    callbacks=[
        abjad.Expression(
            evaluation_template='abjad.core.Label',
            is_initializer=True,
            keywords={
                'tag': None,
                },
            ),
        abjad.Expression(
            evaluation_template='{}.with_durations()',
            qualified_method_name='abjad.core.Label.with_durations',
            ),
        ],
    proxy_class=abjad.Label,
    )
>>> expression(staff)
>>> abjad.show(staff) 

Attributes Summary

client Gets client of label.
color_container Colors contents of container.
color_leaves Colors leaves.
color_note_heads Colors note note-heads.
deactivate Is true when deactivated label attaches to leaf.
remove_markup Removes markup from leaves.
tag Gets tag.
vertical_moments Labels vertical moments.
with_durations Labels logical ties with durations.
with_indices Labels logical ties with indices.
with_intervals Labels consecutive notes with intervals.
with_pitches Labels logical ties with pitches.
with_set_classes Labels items in client with set-classes.
with_start_offsets Labels logical ties with start offsets.

Special methods

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Methods

color_container(color='red')

Colors contents of container.

Colors measure:

>>> measure = abjad.Measure((2, 8), "c'8 d'8")
>>> abjad.label(measure).color_container('red')
>>> abjad.show(measure) 
>>> measure = abjad.Measure((2, 8), "c'8 d'8")
>>> expression = abjad.label().color_container('red')
>>> expression(measure)
>>> abjad.show(measure) 

Returns none.

color_leaves(color='red')

Colors leaves.

Colors leaves red:

>>> staff = abjad.Staff("cs'8. r8. s8. <c' cs' a'>8.")
>>> beam = abjad.Beam(beam_rests=True)
>>> abjad.attach(beam, staff[:])
>>> abjad.label(staff).color_leaves('red')
>>> abjad.show(staff) 
>>> staff = abjad.Staff("cs'8. r8. s8. <c' cs' a'>8.")
>>> beam = abjad.Beam(beam_rests=True)
>>> abjad.attach(beam, staff[:])
>>> expression = abjad.label().color_leaves('red')
>>> expression(staff)
>>> abjad.show(staff) 

Returns none.

color_note_heads(color_map=None)

Colors note note-heads.

Colors chord note-heads:

>>> chord = abjad.Chord([12, 14, 18, 21, 23], (1, 4))
>>> pitches = [[-12, -10, 4], [-2, 8, 11, 17], [19, 27, 30, 33, 37]]
>>> colors = ['red', 'blue', 'green']
>>> color_map = abjad.ColorMap(colors=colors, pitch_iterables=pitches)
>>> abjad.label(chord).color_note_heads(color_map)
>>> abjad.show(chord) 
>>> chord = abjad.Chord([12, 14, 18, 21, 23], (1, 4))
>>> pitches = [[-12, -10, 4], [-2, 8, 11, 17], [19, 27, 30, 33, 37]]
>>> colors = ['red', 'blue', 'green']
>>> color_map = abjad.ColorMap(colors=colors, pitch_iterables=pitches)
>>> expression = abjad.label().color_note_heads(color_map)
>>> expression(chord)
>>> abjad.show(chord) 

Colors note note-head:

>>> note = abjad.Note("c'4")
>>> abjad.label(note).color_note_heads(color_map)
>>> abjad.show(note) 
>>> note = abjad.Note("c'4")
>>> expression = abjad.label().color_note_heads(color_map)
>>> expression(note)
>>> abjad.show(note) 

Colors nothing:

>>> staff = abjad.Staff()
>>> abjad.label(staff).color_note_heads(color_map)
>>> staff = abjad.Staff()
>>> expression = abjad.label().color_note_heads(color_map)
>>> expression(staff)

Colors note-heads:

>>> staff = abjad.Staff("c'8 cs'8 d'8 ds'8 e'8 f'8 fs'8 g'8 gs'8 a'8 as'8 b'8 c''8")
>>> abjad.label(staff).color_note_heads()
>>> abjad.show(staff) 
>>> staff = abjad.Staff("c'8 cs'8 d'8 ds'8 e'8 f'8 fs'8 g'8 gs'8 a'8 as'8 b'8 c''8")
>>> expression = abjad.label().color_note_heads()
>>> expression(staff)
>>> abjad.show(staff) 

Returns none.

remove_markup()

Removes markup from leaves.

Removes markup:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> abjad.label(staff).with_pitches()
>>> abjad.show(staff) 
>>> abjad.label(staff).remove_markup()
>>> abjad.show(staff) 
>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> expression = abjad.label().with_pitches()
>>> expression(staff)
>>> abjad.show(staff) 
>>> expression = abjad.label().remove_markup()
>>> expression(staff)
>>> abjad.show(staff) 

Returns none.

vertical_moments(direction=Up, prototype=None)

Labels vertical moments.

Labels indices:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> abjad.label(staff_group).vertical_moments()
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> expression = abjad.label().vertical_moments()
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Labels pitch numbers:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> abjad.label(staff_group).vertical_moments(
...     prototype=abjad.NumberedPitch,
...     )
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedPitch
>>> expression = abjad.label().vertical_moments(prototype=prototype)
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Labels pitch-class numbers:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedPitchClass
>>> abjad.label(staff_group).vertical_moments(prototype=prototype)
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedPitchClass
>>> expression = abjad.label().vertical_moments(prototype=prototype)
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Labels interval numbers:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedInterval
>>> abjad.label(staff_group).vertical_moments(prototype=prototype)
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedInterval
>>> expression = abjad.label().vertical_moments(prototype=prototype)
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Labels interval-class numbers:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedIntervalClass
>>> abjad.label(staff_group).vertical_moments(prototype=prototype)
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.NumberedIntervalClass
>>> expression = abjad.label().vertical_moments(prototype=prototype)
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Labels interval-class vectors:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.IntervalClassVector
>>> abjad.label(staff_group).vertical_moments(prototype=prototype)
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.IntervalClassVector
>>> expression = abjad.label().vertical_moments(prototype=prototype)
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Labels set-classes:

>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.SetClass()
>>> abjad.label(staff_group).vertical_moments(prototype=prototype)
>>> abjad.show(staff_group) 
>>> staff_group = abjad.StaffGroup([])
>>> staff = abjad.Staff("c'8 d'4 e'16 f'16")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "alto" g4 f4""")
>>> staff_group.append(staff)
>>> staff = abjad.Staff(r"""\clef "bass" c,2""")
>>> staff_group.append(staff)
>>> prototype = abjad.SetClass()
>>> expression = abjad.label().vertical_moments(prototype=prototype)
>>> expression(staff_group)
>>> abjad.show(staff_group) 

Set prototype to one of the classes shown above.

Returns none.

with_durations(direction=Up, denominator=None)

Labels logical ties with durations.

Labels logical tie durations:

>>> staff = abjad.Staff(r"c'4. d'8 ~ d'4. e'16 [ ef'16 ]")
>>> abjad.label(staff).with_durations()
>>> abjad.show(staff) 
>>> staff = abjad.Staff(r"c'4. d'8 ~ d'4. e'16 [ ef'16 ]")
>>> expression = abjad.label().with_durations()
>>> expression(staff)
>>> abjad.show(staff) 

Labels logical ties with preferred denominator:

>>> staff = abjad.Staff(r"c'4. d'8 ~ d'4. e'16 [ ef'16 ]")
>>> abjad.label(staff).with_durations(denominator=16)
>>> abjad.show(staff) 
>>> staff = abjad.Staff(r"c'4. d'8 ~ d'4. e'16 [ ef'16 ]")
>>> expression = abjad.label().with_durations(denominator=16)
>>> expression(staff)
>>> abjad.show(staff) 

Returns none.

with_indices(direction=Up, prototype=None)

Labels logical ties with indices.

Labels logical tie indices:

>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> abjad.label(staff).with_indices()
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> expression = abjad.label().with_indices()
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 

Labels note indices:

>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> abjad.label(staff).with_indices(prototype=abjad.Note)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> expression = abjad.label().with_indices(
...     prototype=abjad.Note,
...     )
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 

Labels chord indices:

>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> abjad.label(staff).with_indices(prototype=abjad.Chord)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> expression = abjad.label().with_indices(
...     prototype=abjad.Chord,
...     )
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 

Labels leaf indices:

>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> abjad.label(staff).with_indices(prototype=abjad.Leaf)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<c' bf'>8 <g' a'>4 af'8 ~ af'8 gf'8 ~ gf'4")
>>> expression = abjad.label().with_indices(
...     prototype=abjad.Leaf,
...     )
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 

Labels tuplet indices:

>>> tuplet = abjad.Tuplet((2, 3), "c'8 [ d'8 e'8 ]")
>>> staff = abjad.Staff(4 * tuplet)
>>> abjad.label(staff).with_indices(prototype=abjad.Tuplet)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 
>>> tuplet = abjad.Tuplet((2, 3), "c'8 [ d'8 e'8 ]")
>>> staff = abjad.Staff(4 * tuplet)
>>> expression = abjad.label().with_indices(
...     prototype=abjad.Tuplet,
...     )
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 2
>>> abjad.show(staff) 

Returns none.

with_intervals(direction=Up, prototype=None)

Labels consecutive notes with intervals.

Labels consecutive notes with interval names:

>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> abjad.label(staff).with_intervals(prototype=None)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> expression = abjad.label().with_intervals(prototype=None)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels consecutive notes with interval-class names:

>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NamedIntervalClass
>>> abjad.label(staff).with_intervals(prototype=prototype)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NamedIntervalClass
>>> expression = abjad.label().with_intervals(prototype=prototype)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels consecutive notes with interval numbers:

>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NumberedInterval
>>> abjad.label(staff).with_intervals(prototype=prototype)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NumberedInterval
>>> expression = abjad.label().with_intervals(prototype=prototype)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels consecutive notes with interval-class numbers:

>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NumberedIntervalClass
>>> abjad.label(staff).with_intervals(prototype=prototype)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NumberedIntervalClass
>>> expression = abjad.label().with_intervals(prototype=prototype)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels consecutive notes with inversion-equivalent interval-class numbers:

>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NumberedInversionEquivalentIntervalClass
>>> abjad.label(staff).with_intervals(prototype=prototype)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> maker = abjad.NoteMaker()
>>> pitch_numbers = [0, 25, 11, -4, -14, -13, 9, 10]
>>> notes = maker(pitch_numbers, [(1, 4)])
>>> staff = abjad.Staff(notes)
>>> prototype = abjad.NumberedInversionEquivalentIntervalClass
>>> expression = abjad.label().with_intervals(prototype=prototype)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Returns none.

with_pitches(direction=Up, locale=None, prototype=None)

Labels logical ties with pitches.

Labels logical ties with pitch names:

>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> abjad.label(staff).with_pitches(prototype=None)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> expression = abjad.label().with_pitches(prototype=None)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels logical ties with American pitch names:

>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> abjad.label(staff).with_pitches(locale='us', prototype=None)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> expression = abjad.label().with_pitches(locale='us', prototype=None)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels logical ties with pitch numbers:

>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> prototype = abjad.NumberedPitch
>>> abjad.label(staff).with_pitches(prototype=prototype)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> prototype = abjad.NumberedPitch
>>> expression = abjad.label().with_pitches(prototype=prototype)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels logical ties with pitch-class numbers:

>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> prototype = abjad.NumberedPitchClass
>>> abjad.label(staff).with_pitches(prototype=prototype)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 
>>> staff = abjad.Staff("<a d' fs'>4 g'4 ~ g'8 r8 fs''4")
>>> prototype = abjad.NumberedPitchClass
>>> expression = abjad.label().with_pitches(prototype=prototype)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.show(staff) 

Labels logical ties with pitch names (filtered by selection):

>>> voice = abjad.Voice("df''4 c''4 f'4 fs'4 d''4 ds''4")
>>> string = 'Horizontal_bracket_engraver'
>>> voice.consists_commands.append(string)
>>> selections = [voice[:2], voice[-2:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> abjad.label(selections).with_pitches()
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 
>>> voice = abjad.Voice("df''4 c''4 f'4 fs'4 d''4 ds''4")
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:2], voice[-2:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> expression = abjad.label().with_pitches()
>>> expression(selections)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 

Labels logical ties with pitch numbers (filtered by selection):

>>> voice = abjad.Voice("df''4 c''4 f'4 fs'4 d''4 ds''4")
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:2], voice[-2:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.NumberedPitch
>>> abjad.label(selections).with_pitches(prototype=prototype)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 
>>> voice = abjad.Voice("df''4 c''4 f'4 fs'4 d''4 ds''4")
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:2], voice[-2:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.NumberedPitch
>>> expression = abjad.label().with_pitches(prototype=prototype)
>>> expression(selections)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 

Labels logical ties with pitch-class numbers (filtered by selection):

>>> voice = abjad.Voice("df''4 c''4 f'4 fs'4 d''4 ds''4")
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:2], voice[-2:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.NumberedPitchClass
>>> abjad.label(selections).with_pitches(prototype=prototype)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 
>>> voice = abjad.Voice("df''4 c''4 f'4 fs'4 d''4 ds''4")
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:2], voice[-2:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.NumberedPitchClass
>>> expression = abjad.label().with_pitches(prototype=prototype)
>>> expression(selections)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 

Returns none.

with_set_classes(direction=Up, prototype=None)

Labels items in client with set-classes.

Labels selections with Forte-ranked transposition-inversion set-classes:

>>> string = "df''8 c''8 bf'8 a'8 f'4. fs'8 g'8 b'8 d''2."
>>> voice = abjad.Voice(string)
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:4], voice[-4:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> abjad.label(selections).with_set_classes()
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 
>>> string = "df''8 c''8 bf'8 a'8 f'4. fs'8 g'8 b'8 d''2."
>>> voice = abjad.Voice(string)
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:4], voice[-4:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> expression = abjad.label().with_set_classes()
>>> expression(selections)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 

Labels selections with lex-ranked transposition-inversion set-classes:

>>> string = "df''8 c''8 bf'8 a'8 f'4. fs'8 g'8 b'8 d''2."
>>> voice = abjad.Voice(string)
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:4], voice[-4:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.SetClass(lex_rank=True)
>>> abjad.label(selections).with_set_classes(prototype=prototype)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 
>>> string = "df''8 c''8 bf'8 a'8 f'4. fs'8 g'8 b'8 d''2."
>>> voice = abjad.Voice(string)
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:4], voice[-4:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.SetClass(lex_rank=True)
>>> expression = abjad.label().with_set_classes(prototype=prototype)
>>> expression(selections)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 

Labels selections with transposition-only set-classes:

>>> string = "df''8 c''8 bf'8 a'8 f'4. fs'8 g'8 b'8 d''2."
>>> voice = abjad.Voice(string)
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:4], voice[-4:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.SetClass(transposition_only=True)
>>> abjad.label(selections).with_set_classes(prototype=prototype)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 
>>> string = "df''8 c''8 bf'8 a'8 f'4. fs'8 g'8 b'8 d''2."
>>> voice = abjad.Voice(string)
>>> voice.consists_commands.append('Horizontal_bracket_engraver')
>>> selections = [voice[:4], voice[-4:]]
>>> for selection in selections:
...     spanner = abjad.HorizontalBracket()
...     abjad.attach(spanner, selection)
... 
>>> prototype = abjad.SetClass(transposition_only=True)
>>> expression = abjad.label().with_set_classes(prototype=prototype)
>>> expression(selections)
>>> abjad.override(voice).horizontal_bracket.staff_padding = 3
>>> abjad.override(voice).text_script.staff_padding = 2
>>> abjad.show(voice) 

Returns none.

with_start_offsets(brackets=None, clock_time=None, direction=None, global_offset=None, markup_command=None)

Labels logical ties with start offsets.

Labels logical tie start offsets:

>>> string = r"\times 2/3 { c'4 d'4 e'4 ~ } e'4 ef'4"
>>> staff = abjad.Staff(string)
>>> abjad.label(staff).with_start_offsets(direction=abjad.Up)
Duration(1, 1)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> abjad.show(staff) 
>>> string = r"\times 2/3 { c'4 d'4 e'4 ~ } e'4 ef'4"
>>> staff = abjad.Staff(string)
>>> expression = abjad.label().with_start_offsets()
>>> expression(staff)
Duration(1, 1)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> abjad.show(staff) 

Labels logical tie start offsets with clock time:

>>> staff = abjad.Staff(r"c'2 d' e' f'")
>>> score = abjad.Score([staff])
>>> mark = abjad.MetronomeMark((1, 4), 60)
>>> abjad.attach(mark, staff[0])
>>> abjad.label(staff).with_start_offsets(clock_time=True)
Duration(8, 1)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> abjad.show(score) 
>>> staff = abjad.Staff(r"c'2 d' e' f'")
>>> score = abjad.Score([staff])
>>> mark = abjad.MetronomeMark((1, 4), 60)
>>> abjad.attach(mark, staff[0])
>>> expression = abjad.label().with_start_offsets(clock_time=True)
>>> expression(staff)
Duration(8, 1)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> abjad.show(score) 

Labels logical tie start offsets with clock time and custom markup command:

>>> staff = abjad.Staff(r"c'2 d' e' f'")
>>> score = abjad.Score([staff])
>>> mark = abjad.MetronomeMark((1, 4), 60)
>>> abjad.attach(mark, staff[0])
>>> abjad.label(staff).with_start_offsets(
...     clock_time=True,
...     markup_command=r'\make-dark-cyan',
...     )
Duration(8, 1)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> abjad.show(score) 
>>> abjad.f(score)
\new Score
<<
    \new Staff
    \with
    {
        \override TextScript.staff-padding = #4
        \override TupletBracket.staff-padding = #0
    }
    {
        \tempo 4=60
        c'2
        ^ \markup \make-dark-cyan "0'00''"
        d'2
        ^ \markup \make-dark-cyan "0'02''"
        e'2
        ^ \markup \make-dark-cyan "0'04''"
        f'2
        ^ \markup \make-dark-cyan "0'06''"
    }
>>
>>> staff = abjad.Staff(r"c'2 d' e' f'")
>>> score = abjad.Score([staff])
>>> mark = abjad.MetronomeMark((1, 4), 60)
>>> abjad.attach(mark, staff[0])
>>> expression = abjad.label().with_start_offsets(
...     clock_time=True,
...     markup_command='make-dark-cyan',
...     )
>>> expression(staff)
Duration(8, 1)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> abjad.show(score) 
>>> abjad.f(score)
\new Score
<<
    \new Staff
    \with
    {
        \override TextScript.staff-padding = #4
        \override TupletBracket.staff-padding = #0
    }
    {
        \tempo 4=60
        c'2
        ^ \markup make-dark-cyan "0'00''"
        d'2
        ^ \markup make-dark-cyan "0'02''"
        e'2
        ^ \markup make-dark-cyan "0'04''"
        f'2
        ^ \markup make-dark-cyan "0'06''"
    }
>>

Returns total duration.


Read-only properties

client

Gets client of label.

Returns component, selection, spanner or none.

deactivate

Is true when deactivated label attaches to leaf.

Defaults to none.

Set to true, false or none.

Returns true, false or none.

tag

Gets tag.

Returns string or none.