Component

abstract class scoretools.Component(name=None)

Abstract base class from which score components inherit.

Notes, rests, chords, tuplets, measures, voices, staves, staff groups and scores are all components.

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_scoretools { graph [label=scoretools]; "abjad.tools.scoretools.Chord.Chord" [color=3, group=2, label=Chord, shape=box]; "abjad.tools.scoretools.Cluster.Cluster" [color=3, group=2, label=Cluster, shape=box]; "abjad.tools.scoretools.Component.Component" [color=black, fontcolor=white, group=2, label=<<B>Component</B>>, shape=oval, style="filled, rounded"]; "abjad.tools.scoretools.Container.Container" [color=3, group=2, label=Container, shape=box]; "abjad.tools.scoretools.Context.Context" [color=3, group=2, label=Context, shape=box]; "abjad.tools.scoretools.FixedDurationContainer.FixedDurationContainer" [color=3, group=2, label=FixedDurationContainer, shape=box]; "abjad.tools.scoretools.FixedDurationTuplet.FixedDurationTuplet" [color=3, group=2, label=FixedDurationTuplet, shape=box]; "abjad.tools.scoretools.GraceContainer.GraceContainer" [color=3, group=2, label=GraceContainer, shape=box]; "abjad.tools.scoretools.Leaf.Leaf" [color=3, group=2, label=Leaf, shape=oval, style=bold]; "abjad.tools.scoretools.Measure.Measure" [color=3, group=2, label=Measure, shape=box]; "abjad.tools.scoretools.MultimeasureRest.MultimeasureRest" [color=3, group=2, label=MultimeasureRest, shape=box]; "abjad.tools.scoretools.Note.Note" [color=3, group=2, label=Note, shape=box]; "abjad.tools.scoretools.Rest.Rest" [color=3, group=2, label=Rest, shape=box]; "abjad.tools.scoretools.Score.Score" [color=3, group=2, label=Score, shape=box]; "abjad.tools.scoretools.Skip.Skip" [color=3, group=2, label=Skip, shape=box]; "abjad.tools.scoretools.Staff.Staff" [color=3, group=2, label=Staff, shape=box]; "abjad.tools.scoretools.StaffGroup.StaffGroup" [color=3, group=2, label=StaffGroup, shape=box]; "abjad.tools.scoretools.Tuplet.Tuplet" [color=3, group=2, label=Tuplet, shape=box]; "abjad.tools.scoretools.Voice.Voice" [color=3, group=2, label=Voice, shape=box]; "abjad.tools.scoretools.Component.Component" -> "abjad.tools.scoretools.Container.Container"; "abjad.tools.scoretools.Component.Component" -> "abjad.tools.scoretools.Leaf.Leaf"; "abjad.tools.scoretools.Container.Container" -> "abjad.tools.scoretools.Cluster.Cluster"; "abjad.tools.scoretools.Container.Container" -> "abjad.tools.scoretools.Context.Context"; "abjad.tools.scoretools.Container.Container" -> "abjad.tools.scoretools.FixedDurationContainer.FixedDurationContainer"; "abjad.tools.scoretools.Container.Container" -> "abjad.tools.scoretools.GraceContainer.GraceContainer"; "abjad.tools.scoretools.Container.Container" -> "abjad.tools.scoretools.Tuplet.Tuplet"; "abjad.tools.scoretools.Context.Context" -> "abjad.tools.scoretools.Score.Score"; "abjad.tools.scoretools.Context.Context" -> "abjad.tools.scoretools.Staff.Staff"; "abjad.tools.scoretools.Context.Context" -> "abjad.tools.scoretools.StaffGroup.StaffGroup"; "abjad.tools.scoretools.Context.Context" -> "abjad.tools.scoretools.Voice.Voice"; "abjad.tools.scoretools.FixedDurationContainer.FixedDurationContainer" -> "abjad.tools.scoretools.Measure.Measure"; "abjad.tools.scoretools.Leaf.Leaf" -> "abjad.tools.scoretools.Chord.Chord"; "abjad.tools.scoretools.Leaf.Leaf" -> "abjad.tools.scoretools.MultimeasureRest.MultimeasureRest"; "abjad.tools.scoretools.Leaf.Leaf" -> "abjad.tools.scoretools.Note.Note"; "abjad.tools.scoretools.Leaf.Leaf" -> "abjad.tools.scoretools.Rest.Rest"; "abjad.tools.scoretools.Leaf.Leaf" -> "abjad.tools.scoretools.Skip.Skip"; "abjad.tools.scoretools.Tuplet.Tuplet" -> "abjad.tools.scoretools.FixedDurationTuplet.FixedDurationTuplet"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.scoretools.Component.Component"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

name Gets and sets name of component.
__copy__(\*args) Copies component with indicators but without children of component or spanners attached to component.
__eq__(expr) Is true when ID of expr equals ID of Abjad object.
__format__([format_specification]) Formats component.
__hash__() Hashes Abjad object.
__illustrate__() Illustrates component.
__mul__(n) Copies component n times and detaches spanners.
__ne__(expr) Is true when Abjad object does not equal expr.
__repr__() Gets interpreter representation of leaf.
__rmul__(n) Copies component n times and detach spanners.

Read/write properties

Component.name

Gets and sets name of component.

Returns string or none.

Special methods

Component.__copy__(*args)

Copies component with indicators but without children of component or spanners attached to component.

Returns new component.

(AbjadObject).__eq__(expr)

Is true when ID of expr equals ID of Abjad object. Otherwise false.

Returns true or false.

Component.__format__(format_specification='')

Formats component.

Set format_specification to ‘’, ‘lilypond’ or ‘storage’.

Returns string.

(AbjadObject).__hash__()

Hashes Abjad object.

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

Returns integer.

Component.__illustrate__()

Illustrates component.

Returns LilyPond file.

Component.__mul__(n)

Copies component n times and detaches spanners.

Returns list of new components.

(AbjadObject).__ne__(expr)

Is true when Abjad object does not equal expr. Otherwise false.

Returns true or false.

Component.__repr__()

Gets interpreter representation of leaf.

Returns string.

Component.__rmul__(n)

Copies component n times and detach spanners.

Returns list of new components.