Inspection

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.Inspection.Inspection" [URL="../api/abjad/core/Inspection.html#abjad.core.Inspection.Inspection", color=black, fontcolor=white, label=Inspection, 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.Inspection.Inspection"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.core.Inspection.Inspection(client=None)

Inspection.

>>> staff = abjad.Staff("c'4 e'4 d'4 f'4")
>>> abjad.show(staff) 
>>> abjad.inspect(staff)
Inspection(client=Staff("c'4 e'4 d'4 f'4"))

Attributes Summary

after_grace_container Gets after grace containers attached to leaf.
annotation Gets annotation.
annotation_wrappers Gets annotation wrappers.
badly_formed_components Gets badly formed components.
client Gets client of inspection.
contents Gets contents.
descendants Gets descendants.
duration Gets duration.
effective Gets effective indicator.
effective_staff Gets effective staff.
effective_wrapper Gets effective wrapper.
grace_container Gets grace container attached to leaf.
has_effective_indicator Is true when client has effective indicator.
has_indicator Is true when client has one or more indicators.
has_spanner Is true when client has one or more spanners.
indicator Gets indicator.
indicators Get indicators.
is_bar_line_crossing Is true when client crosses bar line.
is_grace_note Is true when client is grace note.
is_well_formed Is true when client is well-formed.
leaf Gets leaf n.
lineage Gets lineage.
logical_tie Gets logical tie.
markup Gets markup.
parentage Gets parentage.
pitches Gets pitches.
report_modifications Reports modifications.
sounding_pitch Gets sounding pitch.
sounding_pitches Gets sounding pitches.
spanner Gets spanner.
spanners Gets spanners.
tabulate_wellformedness Tabulates well-formedness.
timespan Gets timespan.
tuplet Gets tuplet n.
vertical_moment Gets vertical moment.
vertical_moment_at Gets vertical moment at offset.
wrapper Gets wrapper.
wrappers Gets wrappers.

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

after_grace_container()

Gets after grace containers attached to leaf.

Get after grace container attached to note:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> note = abjad.Note("ds'16")
>>> container = abjad.AfterGraceContainer([note])
>>> abjad.attach(container, staff[1])
>>> abjad.show(staff) 
>>> abjad.inspect(staff[1]).after_grace_container()
AfterGraceContainer("ds'16")
Return type:Optional[AfterGraceContainer]
annotation(annotation, default=None, unwrap=True)

Gets annotation.

>>> staff = abjad.Staff("c'4 e' e' f'")
>>> abjad.annotate(staff[0], 'default_instrument', abjad.Cello())
>>> abjad.show(staff) 
>>> string = 'default_instrument'
>>> abjad.inspect(staff[0]).annotation(string)
Cello()
>>> abjad.inspect(staff[1]).annotation(string) is None
True
>>> abjad.inspect(staff[2]).annotation(string) is None
True
>>> abjad.inspect(staff[3]).annotation(string) is None
True

Returns default when no annotation is found:

>>> abjad.inspect(staff[3]).annotation(string, abjad.Violin())
Violin()

REGRESSION: annotation is not picked up as effective indicator:

>>> prototype = abjad.Instrument
>>> abjad.inspect(staff[0]).effective(prototype) is None
True
>>> abjad.inspect(staff[1]).effective(prototype) is None
True
>>> abjad.inspect(staff[2]).effective(prototype) is None
True
>>> abjad.inspect(staff[3]).effective(prototype) is None
True
Return type:Any
annotation_wrappers()

Gets annotation wrappers.

>>> staff = abjad.Staff("c'4 e' e' f'")
>>> abjad.annotate(staff[0], 'default_instrument', abjad.Cello())
>>> abjad.annotate(staff[0], 'default_clef', abjad.Clef('tenor'))
>>> abjad.show(staff) 
>>> for wrapper in abjad.inspect(staff[0]).annotation_wrappers():
...     abjad.f(wrapper)
... 
abjad.Wrapper(
    annotation='default_instrument',
    indicator=abjad.Cello(
        name='cello',
        short_name='vc.',
        markup=abjad.Markup(
            contents=['Cello'],
            ),
        short_markup=abjad.Markup(
            contents=['Vc.'],
            ),
        allowable_clefs=('bass', 'tenor', 'treble'),
        context='Staff',
        default_tuning=abjad.Tuning(
            pitches=abjad.PitchSegment(
                (
                    abjad.NamedPitch('c,'),
                    abjad.NamedPitch('g,'),
                    abjad.NamedPitch('d'),
                    abjad.NamedPitch('a'),
                    ),
                item_class=abjad.NamedPitch,
                ),
            ),
        middle_c_sounding_pitch=abjad.NamedPitch("c'"),
        pitch_range=abjad.PitchRange('[C2, G5]'),
        primary=True,
        ),
    tag=abjad.Tag(),
    )
abjad.Wrapper(
    annotation='default_clef',
    indicator=abjad.Clef('tenor'),
    tag=abjad.Tag(),
    )
Return type:List[Wrapper]
badly_formed_components()

Gets badly formed components.

Return type:List[Component]
contents(include_self=True)

Gets contents.

>>> staff = abjad.Staff(r"\times 2/3 { c'8 d'8 e'8 } f'4")
>>> abjad.show(staff) 
>>> for component in abjad.inspect(staff).contents():
...     component
... 
<Staff{2}>
Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
Note("f'4")
>>> for component in abjad.inspect(staff).contents(
...     include_self=False,
...     ):
...     component
... 
Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
Note("f'4")
Return type:Optional[Selection]
descendants(include_self=True)

Gets descendants.

>>> staff = abjad.Staff(r"\times 2/3 { c'8 d'8 e'8 } f'4")
>>> abjad.show(staff) 
>>> for component in abjad.inspect(staff).descendants():
...     component
... 
<Staff{2}>
Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
Note("c'8")
Note("d'8")
Note("e'8")
Note("f'4")
>>> for component in abjad.inspect(staff).descendants(
...     include_self=False,
...     ):
...     component
... 
Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
Note("c'8")
Note("d'8")
Note("e'8")
Note("f'4")
>>> for component in abjad.inspect(staff[:1]).descendants(
...     include_self=False,
...     ):
...     component
... 
Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
Note("c'8")
Note("d'8")
Note("e'8")
Return type:Selection
duration(in_seconds=False)

Gets duration.

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.show(staff) 
>>> selection = staff[:3]
>>> abjad.inspect(selection).duration()
Duration(3, 4)
Return type:Duration
effective(prototype=None, unwrap=True, n=0, default=None)

Gets effective indicator.

Gets effective clef:

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Clef('alto'), staff[0])
>>> abjad.attach(abjad.AcciaccaturaContainer("fs'16"), staff[-1])
>>> abjad.show(staff) 
>>> for component in abjad.iterate(staff).components():
...     clef = abjad.inspect(component).effective(abjad.Clef)
...     print(component, clef)
... 
Staff("c'4 d'4 e'4 f'4") Clef('alto')
c'4 Clef('alto')
d'4 Clef('alto')
e'4 Clef('alto')
fs'16 Clef('alto')
f'4 Clef('alto')

Arbitrary objects (like strings) can be contexted:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> abjad.attach('color', staff[1], context='Staff')
>>> abjad.show(staff) 
>>> for component in abjad.iterate(staff).components():
...     string = abjad.inspect(component).effective(str)
...     print(component, repr(string))
... 
Staff("c'8 d'8 e'8 f'8") None
c'8 None
d'8 'color'
e'8 'color'
f'8 'color'

Scans forwards or backwards when n is set:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8 g'8")
>>> abjad.attach('red', staff[0], context='Staff')
>>> abjad.attach('blue', staff[2], context='Staff')
>>> abjad.attach('yellow', staff[4], context='Staff')
>>> abjad.show(staff) 
>>> for n in (-1, 0, 1):
...     color = abjad.inspect(staff[0]).effective(str, n=n)
...     print(n, repr(color))
... 
-1 None
0 'red'
1 'blue'
>>> for n in (-1, 0, 1):
...     color = abjad.inspect(staff[1]).effective(str, n=n)
...     print(n, repr(color))
... 
-1 None
0 'red'
1 'blue'
>>> for n in (-1, 0, 1):
...     color = abjad.inspect(staff[2]).effective(str, n=n)
...     print(n, repr(color))
... 
-1 'red'
0 'blue'
1 'yellow'
>>> for n in (-1, 0, 1):
...     color = abjad.inspect(staff[3]).effective(str, n=n)
...     print(n, repr(color))
... 
-1 'red'
0 'blue'
1 'yellow'
>>> for n in (-1, 0, 1):
...     color = abjad.inspect(staff[4]).effective(str, n=n)
...     print(n, repr(color))
... 
-1 'blue'
0 'yellow'
1 None

Synthetic offsets works this way:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> abjad.attach(
...     'red',
...     staff[-1],
...     context='Staff',
...     synthetic_offset=-1,
...     )
>>> abjad.attach('blue', staff[0], context='Staff')
>>> abjad.show(staff) 

Entire staff is effectively blue:

>>> abjad.inspect(staff).effective(str)
'blue'

The (synthetic) offset just prior to (start of) staff is red:

>>> abjad.inspect(staff).effective(str, n=-1)
'red'

Gets effective time signature:

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> leaves = abjad.select(staff).leaves()
>>> abjad.attach(abjad.TimeSignature((3, 8)), leaves[0])
>>> abjad.show(staff) 
>>> prototype = abjad.TimeSignature
>>> for component in abjad.iterate(staff).components():
...     inspection = abjad.inspect(component)
...     time_signature = inspection.effective(prototype)
...     print(component, time_signature)
... 
Staff("c'4 d'4 e'4 f'4") 3/8
c'4 3/8
d'4 3/8
e'4 3/8
f'4 3/8
Return type:Any
effective_staff()

Gets effective staff.

Return type:Optional[Staff]
effective_wrapper(prototype=None, n=0)

Gets effective wrapper.

Gets effective clef wrapper:

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Clef('alto'), staff[0])
>>> abjad.attach(abjad.AcciaccaturaContainer("fs'16"), staff[-1])
>>> abjad.show(staff) 
>>> for component in abjad.iterate(staff).components():
...     inspection = abjad.inspect(component)
...     wrapper = inspection.effective_wrapper(abjad.Clef)
...     print(component, wrapper)
... 
Staff("c'4 d'4 e'4 f'4") Wrapper(context='Staff', indicator=Clef('alto'), tag=Tag())
c'4 Wrapper(context='Staff', indicator=Clef('alto'), tag=Tag())
d'4 Wrapper(context='Staff', indicator=Clef('alto'), tag=Tag())
e'4 Wrapper(context='Staff', indicator=Clef('alto'), tag=Tag())
fs'16 Wrapper(context='Staff', indicator=Clef('alto'), tag=Tag())
f'4 Wrapper(context='Staff', indicator=Clef('alto'), tag=Tag())
Return type:Optional[Wrapper]
grace_container()

Gets grace container attached to leaf.

Get acciaccatura container attached to note:

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8")
>>> note = abjad.Note("cs'16")
>>> container = abjad.AcciaccaturaContainer([note])
>>> abjad.attach(container, staff[1])
>>> abjad.show(staff) 
>>> abjad.inspect(staff[1]).grace_container()
AcciaccaturaContainer("cs'16")
Return type:Optional[GraceContainer]
has_effective_indicator(prototype=None)

Is true when client has effective indicator.

Return type:bool
has_indicator(prototype=None)

Is true when client has one or more indicators.

Return type:bool
has_spanner(prototype=None)

Is true when client has one or more spanners.

Return type:bool
indicator(prototype=None, default=None, unwrap=True)

Gets indicator.

Raises exception when more than one indicator of prototype attach to client.

Returns default when no indicator of prototype attaches to client.

Return type:Any
indicators(prototype=None, unwrap=True)

Get indicators.

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Articulation('^'), staff[0])
>>> abjad.attach(abjad.Articulation('^'), staff[1])
>>> abjad.attach(abjad.Articulation('^'), staff[2])
>>> abjad.attach(abjad.Articulation('^'), staff[3])
>>> abjad.show(staff) 
>>> abjad.inspect(staff).indicators(abjad.Articulation)
[]
>>> abjad.inspect(staff[0]).indicators(abjad.Articulation)
[Articulation('^')]
Return type:List[~T]
is_bar_line_crossing()

Is true when client crosses bar line.

>>> staff = abjad.Staff("c'4 d'4 e'4")
>>> time_signature = abjad.TimeSignature((3, 8))
>>> abjad.attach(time_signature, staff[0])
>>> abjad.show(staff) 
>>> for note in staff:
...     result = abjad.inspect(note).is_bar_line_crossing()
...     print(note, result)
... 
c'4 False
d'4 True
e'4 False
Return type:bool
is_grace_note()

Is true when client is grace note.

Return type:bool
is_well_formed(check_beamed_long_notes=True, check_discontiguous_spanners=True, check_duplicate_ids=True, check_empty_containers=True, check_misdurated_measures=True, check_misfilled_measures=True, check_mismatched_enchained_hairpins=True, check_mispitched_ties=True, check_misrepresented_flags=True, check_missing_parents=True, check_nested_measures=True, check_notes_on_wrong_clef=True, check_out_of_range_notes=True, check_overlapping_beams=True, check_overlapping_glissandi=True, check_overlapping_hairpins=True, check_overlapping_octavation_spanners=True, check_overlapping_ties=True, check_overlapping_trill_spanners=True, check_tied_rests=True)

Is true when client is well-formed.

Return type:bool
leaf(n=0)

Gets leaf n.

>>> staff = abjad.Staff()
>>> staff.append(abjad.Voice("c'8 d'8 e'8 f'8"))
>>> staff.append(abjad.Voice("g'8 a'8 b'8 c''8"))
>>> abjad.show(staff) 

Gets leaf n from client when client is a leaf.

With positive indices:

>>> first_leaf = staff[0][0]
>>> first_leaf
Note("c'8")
>>> for n in range(8):
...     leaf = abjad.inspect(first_leaf).leaf(n)
...     print(n, leaf)
... 
0 c'8
1 d'8
2 e'8
3 f'8
4 None
5 None
6 None
7 None

With negative indices:

>>> last_leaf = staff[0][-1]
>>> last_leaf
Note("f'8")
>>> for n in range(0, -8, -1):
...     leaf = abjad.inspect(last_leaf).leaf(n)
...     print(n, leaf)
... 
0 f'8
-1 e'8
-2 d'8
-3 c'8
-4 None
-5 None
-6 None
-7 None

Gets leaf n in client when client is a container.

With positive indices:

>>> first_voice = staff[0]
>>> first_voice
Voice("c'8 d'8 e'8 f'8")
>>> for n in range(8):
...     leaf = abjad.inspect(first_voice).leaf(n)
...     print(n, leaf)
... 
0 c'8
1 d'8
2 e'8
3 f'8
4 None
5 None
6 None
7 None

With negative indices:

>>> first_voice = staff[0]
>>> first_voice
Voice("c'8 d'8 e'8 f'8")
>>> for n in range(-1, -9, -1):
...     leaf = abjad.inspect(first_voice).leaf(n)
...     print(n, leaf)
... 
-1 f'8
-2 e'8
-3 d'8
-4 c'8
-5 None
-6 None
-7 None
-8 None
Return type:Optional[Leaf]
lineage()

Gets lineage.

Return type:Lineage
logical_tie()

Gets logical tie.

Return type:LogicalTie
markup(direction=None)

Gets markup.

Return type:List[Markup]
parentage(include_self=True, grace_notes=False)

Gets parentage.

Gets parentage without grace notes:

>>> voice = abjad.Voice("c'4 d'4 e'4 f'4")
>>> container = abjad.GraceContainer("c'16 d'16")
>>> abjad.attach(container, voice[1])
>>> abjad.show(voice) 
>>> abjad.inspect(container[0]).parentage()
Parentage(component=Note("c'16"))

Gets parentage with grace notes:

>>> voice = abjad.Voice("c'4 d'4 e'4 f'4")
>>> container = abjad.GraceContainer("c'16 d'16")
>>> abjad.attach(container, voice[1])
>>> abjad.show(voice) 
>>> agent = abjad.inspect(container[0])
>>> parentage = agent.parentage(grace_notes=True)
>>> for component in parentage:
...     component
... 
Note("c'16")
GraceContainer("c'16 d'16")
Note("d'4")
Voice("c'4 d'4 e'4 f'4")
Return type:Parentage
pitches()

Gets pitches.

Return type:Optional[PitchSet]
report_modifications()

Reports modifications.

Reports container modifications:

>>> container = abjad.Container("c'8 d'8 e'8 f'8")
>>> abjad.override(container).note_head.color = 'red'
>>> abjad.override(container).note_head.style = 'harmonic'
>>> abjad.show(container) 
>>> report = abjad.inspect(container).report_modifications()
>>> print(report)
{
    \override NoteHead.color = #red
    \override NoteHead.style = #'harmonic
    %%% 4 components omitted %%%
    \revert NoteHead.color
    \revert NoteHead.style
}

Reports leaf modifications:

>>> container = abjad.Container("c'8 d'8 e'8 f'8")
>>> abjad.attach(abjad.Clef('alto'), container[0])
>>> abjad.override(container[0]).note_head.color = 'red'
>>> abjad.override(container[0]).stem.color = 'red'
>>> abjad.show(container) 
>>> report = abjad.inspect(container[0]).report_modifications()
>>> print(report)
slot absolute before:
slot 1:
    grob overrides:
        \once \override NoteHead.color = #red
        \once \override Stem.color = #red
slot 3:
    commands:
        \clef "alto"
slot 4:
    leaf body:
        c'8
slot 5:
slot 7:
slot absolute after:
Return type:str
sounding_pitch()

Gets sounding pitch.

>>> staff = abjad.Staff("d''8 e''8 f''8 g''8")
>>> piccolo = abjad.Piccolo()
>>> abjad.attach(piccolo, staff[0])
>>> abjad.Instrument.transpose_from_sounding_pitch(staff)
>>> abjad.show(staff) 
Return type:NamedPitch
sounding_pitches()

Gets sounding pitches.

>>> staff = abjad.Staff("<c''' e'''>4 <d''' fs'''>4")
>>> glockenspiel = abjad.Glockenspiel()
>>> abjad.attach(glockenspiel, staff[0])
>>> abjad.Instrument.transpose_from_sounding_pitch(staff)
>>> abjad.show(staff) 
>>> abjad.inspect(staff[0]).sounding_pitches()
[NamedPitch("c'''"), NamedPitch("e'''")]

Returns tuple.

Return type:List[NamedPitch]
spanner(prototype=None, default=None)

Gets spanner.

Raises exception when more than one spanner of prototype attaches to client.

Returns default when no spanner of prototype attaches to client.

Return type:Any
spanners(prototype=None)

Gets spanners.

>>> staff = abjad.Staff("c'8 d' e' f'")
>>> abjad.attach(abjad.Beam(), staff[:2])
>>> abjad.attach(abjad.Beam(), staff[2:])
>>> abjad.show(staff) 
>>> abjad.inspect(staff).spanners()
[]
>>> abjad.inspect(staff[0]).spanners()
[Beam("c'8, d'8", durations=(), span_beam_count=1)]
>>> beams = abjad.inspect(staff[:]).spanners()
>>> beams = list(beams)
>>> beams.sort()
>>> beams
[Beam("c'8, d'8", durations=(), span_beam_count=1), Beam("e'8, f'8", durations=(), span_beam_count=1)]
Return type:List[Spanner]
tabulate_wellformedness(allow_percussion_clef=None, check_beamed_long_notes=True, check_discontiguous_spanners=True, check_duplicate_ids=True, check_empty_containers=True, check_misdurated_measures=True, check_misfilled_measures=True, check_mismatched_enchained_hairpins=True, check_mispitched_ties=True, check_misrepresented_flags=True, check_missing_parents=True, check_nested_measures=True, check_notes_on_wrong_clef=True, check_out_of_range_notes=True, check_overlapping_beams=True, check_overlapping_glissandi=True, check_overlapping_hairpins=True, check_overlapping_octavation_spanners=True, check_overlapping_ties=True, check_overlapping_trill_spanners=True, check_tied_rests=True)

Tabulates well-formedness.

Return type:str
timespan(in_seconds=False)

Gets timespan.

Gets timespan of grace notes:

>>> voice = abjad.Voice("c'8 [ d'8 e'8 f'8 ]")
>>> grace_notes = [abjad.Note("c'16"), abjad.Note("d'16")]
>>> container = abjad.GraceContainer(grace_notes)
>>> abjad.attach(container, voice[1])
>>> container = abjad.AfterGraceContainer("e'16 f'16")
>>> abjad.attach(container, voice[1])
>>> abjad.show(voice) 
>>> for leaf in abjad.iterate(voice).leaves():
...     timespan = abjad.inspect(leaf).timespan()
...     print(str(leaf) + ':')
...     abjad.f(timespan)
... 
c'8:
abjad.Timespan(
    start_offset=abjad.Offset(0, 1),
    stop_offset=abjad.Offset(1, 8),
    )
c'16:
abjad.Timespan(
    start_offset=abjad.Offset(
        (1, 8),
        grace_displacement=abjad.Duration(-1, 8),
        ),
    stop_offset=abjad.Offset(
        (1, 8),
        grace_displacement=abjad.Duration(-1, 16),
        ),
    )
d'16:
abjad.Timespan(
    start_offset=abjad.Offset(
        (1, 8),
        grace_displacement=abjad.Duration(-1, 16),
        ),
    stop_offset=abjad.Offset(1, 8),
    )
d'8:
abjad.Timespan(
    start_offset=abjad.Offset(1, 8),
    stop_offset=abjad.Offset(1, 4),
    )
e'16:
abjad.Timespan(
    start_offset=abjad.Offset(
        (1, 4),
        grace_displacement=abjad.Duration(-1, 8),
        ),
    stop_offset=abjad.Offset(
        (1, 4),
        grace_displacement=abjad.Duration(-1, 16),
        ),
    )
f'16:
abjad.Timespan(
    start_offset=abjad.Offset(
        (1, 4),
        grace_displacement=abjad.Duration(-1, 16),
        ),
    stop_offset=abjad.Offset(1, 4),
    )
e'8:
abjad.Timespan(
    start_offset=abjad.Offset(1, 4),
    stop_offset=abjad.Offset(3, 8),
    )
f'8:
abjad.Timespan(
    start_offset=abjad.Offset(3, 8),
    stop_offset=abjad.Offset(1, 2),
    )
>>> staff = abjad.Staff("c'8 d' e' f'")
>>> abjad.attach(abjad.Beam(), staff[:2])
>>> abjad.attach(abjad.Beam(), staff[2:])
>>> abjad.show(staff) 
>>> abjad.inspect(staff).timespan()
Timespan(start_offset=Offset(0, 1), stop_offset=Offset(1, 2))
>>> abjad.inspect(staff[0]).timespan()
Timespan(start_offset=Offset(0, 1), stop_offset=Offset(1, 8))
>>> abjad.inspect(staff[:3]).timespan()
Timespan(start_offset=Offset(0, 1), stop_offset=Offset(3, 8))
Return type:Timespan
tuplet(n=0)

Gets tuplet n.

>>> staff = abjad.Staff()
>>> staff.append(abjad.Tuplet((2, 3), "c'8 d' e'"))
>>> staff.append(abjad.Tuplet((2, 3), "d'8 e' f'"))
>>> staff.append(abjad.Tuplet((2, 3), "e'8 f' g'"))
>>> staff.append(abjad.Tuplet((2, 3), "f'8 g' a'"))
>>> abjad.show(staff) 
>>> for n in range(4):
...     tuplet = abjad.inspect(staff).tuplet(n)
...     print(n, tuplet)
... 
0 Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
1 Tuplet(Multiplier(2, 3), "d'8 e'8 f'8")
2 Tuplet(Multiplier(2, 3), "e'8 f'8 g'8")
3 Tuplet(Multiplier(2, 3), "f'8 g'8 a'8")
>>> for n in range(-1, -5, -1):
...     tuplet = abjad.inspect(staff).tuplet(n)
...     print(n, tuplet)
... 
-1 Tuplet(Multiplier(2, 3), "f'8 g'8 a'8")
-2 Tuplet(Multiplier(2, 3), "e'8 f'8 g'8")
-3 Tuplet(Multiplier(2, 3), "d'8 e'8 f'8")
-4 Tuplet(Multiplier(2, 3), "c'8 d'8 e'8")
Return type:Optional[Tuplet]
vertical_moment(governor=None)

Gets vertical moment.

>>> score = abjad.Score()
>>> tuplet = abjad.Tuplet((4, 3), "d''8 c''8 b'8")
>>> score.append(abjad.Staff([tuplet]))
>>> staff_group = abjad.StaffGroup(lilypond_type='PianoStaff')
>>> staff_group.append(abjad.Staff("a'4 g'4"))
>>> staff_group.append(abjad.Staff("f'8 e'8 d'8 c'8"))
>>> clef = abjad.Clef('bass')
>>> abjad.attach(clef, staff_group[1][0])
>>> score.append(staff_group)
>>> abjad.show(score) 
>>> agent = abjad.inspect(staff_group[1][0])
>>> moment = agent.vertical_moment(governor=staff_group)
>>> moment.leaves
Selection([Note("a'4"), Note("f'8")])
>>> agent = abjad.inspect(staff_group[1][1])
>>> moment = agent.vertical_moment(governor=staff_group)
>>> moment.leaves
Selection([Note("a'4"), Note("e'8")])
>>> agent = abjad.inspect(staff_group[1][2])
>>> moment = agent.vertical_moment(governor=staff_group)
>>> moment.leaves
Selection([Note("g'4"), Note("d'8")])
>>> agent = abjad.inspect(staff_group[1][3])
>>> moment = agent.vertical_moment(governor=staff_group)
>>> moment.leaves
Selection([Note("g'4"), Note("c'8")])
Return type:VerticalMoment
vertical_moment_at(offset)

Gets vertical moment at offset.

Return type:VerticalMoment
wrapper(prototype=None)

Gets wrapper.

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Articulation('^'), staff[0])
>>> abjad.attach(abjad.Articulation('^'), staff[1])
>>> abjad.attach(abjad.Articulation('^'), staff[2])
>>> abjad.attach(abjad.Articulation('^'), staff[3])
>>> abjad.show(staff) 
>>> abjad.inspect(staff).wrapper(abjad.Articulation) is None
True
>>> abjad.inspect(staff[0]).wrapper(abjad.Articulation)
Wrapper(indicator=Articulation('^'), tag=Tag())

Raises exception when more than one indicator of prototype attach to client.

Return type:Optional[Wrapper]
wrappers(prototype=None)

Gets wrappers.

>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.attach(abjad.Articulation('^'), staff[0])
>>> abjad.attach(abjad.Articulation('^'), staff[1])
>>> abjad.attach(abjad.Articulation('^'), staff[2])
>>> abjad.attach(abjad.Articulation('^'), staff[3])
>>> abjad.show(staff) 
>>> abjad.inspect(staff).wrappers(abjad.Articulation)
[]
>>> abjad.inspect(staff[0]).wrappers(abjad.Articulation)
[Wrapper(indicator=Articulation('^'), tag=Tag())]
Return type:Optional[List[Wrapper]]

Read-only properties

client

Gets client of inspection.

>>> staff = abjad.Staff()
>>> staff.append(abjad.Voice("c'8 d'8 e'8 f'8"))
>>> staff.append(abjad.Voice("g'8 a'8 b'8 c''8"))
>>> abjad.show(staff) 
>>> abjad.inspect(staff).client
<Staff{2}>
Return type:Union[Component, Iterable[Component], None]