Descendants¶
-
class
abjad.core.Descendants.
Descendants
(component=None, cross_offset=None, include_self=True)¶ Descendants of a component.
>>> score = abjad.Score() >>> staff = abjad.Staff( ... r"""\new Voice = "Treble Voice" { c'4 }""", ... name='Treble Staff', ... ) >>> score.append(staff) >>> bass = abjad.Staff( ... r"""\new Voice = "Bass Voice" { b,4 }""", ... name='Bass Staff', ... ) >>> score.append(bass)
>>> for component in abjad.inspect(score).descendants(): ... component ... <Score<<2>>> <Staff-"Treble Staff"{1}> Voice("c'4", name='Treble Voice') Note("c'4") <Staff-"Bass Staff"{1}> Voice('b,4', name='Bass Voice') Note('b,4')
>>> bass_voice = score['Bass Voice'] >>> agent = abjad.inspect(bass_voice) >>> for component in agent.descendants(): ... component ... Voice('b,4', name='Bass Voice') Note('b,4')
Descendants is treated as the component’s improper descendants.
Attributes Summary
__getitem__
Gets argument
.__len__
Gets length of descendants. component
The component from which descendants were derived. components
Gets components. Special methods
-
(
AbjadObject
).__format__
(format_specification='')¶ Formats Abjad object.
Set
format_specification
to''
or'storage'
. Interprets''
equal to'storage'
.Returns string.
-
__getitem__
(argument)¶ Gets
argument
.Returns component or tuple of components.
-
__len__
()¶ Gets length of descendants.
Returns int.
-
(
AbjadObject
).__repr__
()¶ Gets interpreter representation of Abjad object.
Returns string.
Methods
Read-only properties
-
component
¶ The component from which descendants were derived.
-
components
¶ Gets components.
Returns tuple.
-