LabelAgent

class agenttools.LabelAgent(client=None)

Label agent.

>>> import abjad

Labels pitch names:

>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> abjad.label(staff).with_pitches()
>>> show(staff) 
>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> expression = abjad.label().with_pitches()
>>> f(expression)
abjad.Expression(
    callbacks=[
        abjad.Expression(
            evaluation_template='abjad.LabelAgent',
            is_initializer=True,
            ),
        abjad.Expression(
            evaluation_template='{}.with_pitches()',
            qualified_method_name='abjad.LabelAgent.with_pitches',
            ),
        ],
    proxy_class=agenttools.LabelAgent,
    )
>>> expression(staff)
>>> show(staff) 

Labels durations:

>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> abjad.label(staff).with_durations()
>>> show(staff) 
>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> expression = abjad.label().with_durations()
>>> f(expression)
abjad.Expression(
    callbacks=[
        abjad.Expression(
            evaluation_template='abjad.LabelAgent',
            is_initializer=True,
            ),
        abjad.Expression(
            evaluation_template='{}.with_durations()',
            qualified_method_name='abjad.LabelAgent.with_durations',
            ),
        ],
    proxy_class=agenttools.LabelAgent,
    )
>>> expression(staff)
>>> show(staff) 

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

Bases

Attribute summary

client Gets client of label agent.
color_alternating([colors]) Colors client items in alternating colors.
color_container([color]) Colors contents of container.
color_leaves([color]) Colors leaves.
color_note_heads([color_map]) Colors note note-heads.
remove_markup() Removes markup from leaves.
vertical_moments([direction, prototype]) Labels vertical moments.
with_durations([direction, …]) Labels logical ties with durations.
with_indices([direction, prototype]) Labels logical ties with indices.
with_intervals([direction, prototype]) Labels consecutive notes with intervals.
with_pitches([direction, prototype]) Labels logical ties with pitches.
with_set_classes([direction, prototype]) Labels items in client with set-classes.
with_start_offsets([clock_time, direction, …]) Labels logical ties with start offsets.
__eq__(argument) Is true when ID of argument equals ID of Abjad object.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

LabelAgent.client

Gets client of label agent.

Returns component, selection, spanner or none.

Methods

LabelAgent.color_alternating(colors=['red', 'blue'])

Colors client items in alternating colors.

Returns none.

LabelAgent.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')
>>> show(measure) 
>>> measure = abjad.Measure((2, 8), "c'8 d'8")
>>> expression = abjad.label().color_container('red')
>>> expression(measure)
>>> show(measure) 

Returns none.

LabelAgent.color_leaves(color='red')

Colors leaves.

Colors leaves red:

>>> staff = abjad.Staff("cs'8. [ r8. s8. <c' cs' a'>8. ]")
>>> abjad.label(staff).color_leaves('red')
>>> show(staff) 
>>> staff = abjad.Staff("cs'8. [ r8. s8. <c' cs' a'>8. ]")
>>> expression = abjad.label().color_leaves('red')
>>> expression(staff)
>>> show(staff) 

Returns none.

LabelAgent.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, pitches)
>>> abjad.label(chord).color_note_heads(color_map)
>>> 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, pitches)
>>> expression = abjad.label().color_note_heads(color_map)
>>> expression(chord)
>>> show(chord) 

Colors note note-head:

>>> note = abjad.Note("c'4")
>>> abjad.label(note).color_note_heads(color_map)
>>> show(note) 
>>> note = abjad.Note("c'4")
>>> expression = abjad.label().color_note_heads(color_map)
>>> expression(note)
>>> 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()
>>> 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)
>>> show(staff) 

Returns none.

LabelAgent.remove_markup()

Removes markup from leaves.

Removes markup:

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

Returns none.

LabelAgent.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()
>>> 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)
>>> 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,
...     )
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> 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)
>>> show(staff_group) 

Set prototype to one of the classes shown above.

Returns none.

LabelAgent.with_durations(direction=Up, preferred_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()
>>> show(staff) 
>>> staff = abjad.Staff(r"c'4. d'8 ~ d'4. e'16 [ ef'16 ]")
>>> expression = abjad.label().with_durations()
>>> expression(staff)
>>> 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(preferred_denominator=16)
>>> show(staff) 
>>> staff = abjad.Staff(r"c'4. d'8 ~ d'4. e'16 [ ef'16 ]")
>>> expression = abjad.label().with_durations(preferred_denominator=16)
>>> expression(staff)
>>> show(staff) 

Returns none.

LabelAgent.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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> show(staff) 

Returns none.

LabelAgent.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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> show(staff) 

Returns none.

LabelAgent.with_pitches(direction=Up, 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> show(voice) 

Returns none.

LabelAgent.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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> 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.HorizontalBracketSpanner()
...     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
>>> show(voice) 

Returns none.

LabelAgent.with_start_offsets(clock_time=False, direction=Up, font_size=None)

Labels logical ties with start offsets.

Labels logical tie start offsets:

>>> staff = abjad.Staff(r"\times 2/3 { c'4 d'4 e'4 ~ } e'4 ef'4")
>>> abjad.label(staff).with_start_offsets(direction=Up)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> show(staff) 
>>> staff = abjad.Staff(r"\times 2/3 { c'4 d'4 e'4 ~ } e'4 ef'4")
>>> expression = abjad.label().with_start_offsets(direction=Up)
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> 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)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> 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)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> show(score) 

Labels logical tie start offsets with clock time and custom font size:

>>> 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,
...     font_size=-3,
...     )
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> 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,
...     font_size=-3,
...     )
>>> expression(staff)
>>> abjad.override(staff).text_script.staff_padding = 4
>>> abjad.override(staff).tuplet_bracket.staff_padding = 0
>>> show(score) 

Returns none.

Special methods

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

(AbjadObject).__hash__()

Hashes Abjad object.

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

Returns integer.

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