Chord

class scoretools.Chord(*arguments)

A chord.

>>> chord = Chord("<e' cs'' f''>4")
>>> show(chord) 

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=black, fontcolor=white, group=2, label=<<B>Chord</B>>, shape=box, style="filled, rounded"]; "abjad.tools.scoretools.Component.Component" [color=3, group=2, label=Component, shape=oval, style=bold]; "abjad.tools.scoretools.Leaf.Leaf" [color=3, group=2, label=Leaf, shape=oval, style=bold]; "abjad.tools.scoretools.Component.Component" -> "abjad.tools.scoretools.Leaf.Leaf"; "abjad.tools.scoretools.Leaf.Leaf" -> "abjad.tools.scoretools.Chord.Chord"; } 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.
note_heads Gets note-heads in chord.
written_duration Gets written duration of chord.
written_pitches Written pitches in chord.
__copy__(*arguments) Copies component with indicators but without children of component or spanners attached to component.
__eq__(argument) Is true when ID of argument 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__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of leaf.
__rmul__(n) Copies component n times and detach spanners.
__str__() String representation of leaf.

Read/write properties

(Component).name

Gets and sets name of component.

Returns string or none.

Chord.note_heads

Gets note-heads in chord.

Gets note-heads in chord:

>>> chord = Chord("<g' c'' e''>4")
>>> show(chord) 
>>> f(chord.note_heads)
scoretools.NoteHeadList(
    [
        scoretools.NoteHead(
            written_pitch=pitchtools.NamedPitch("g'"),
            ),
        scoretools.NoteHead(
            written_pitch=pitchtools.NamedPitch("c''"),
            ),
        scoretools.NoteHead(
            written_pitch=pitchtools.NamedPitch("e''"),
            ),
        ]
    )

SetS note-heads with pitch names:

>>> chord = Chord("<g' c'' e''>4")
>>> show(chord) 
>>> chord.note_heads = "c' d' fs'"
>>> show(chord) 

Sets note-heads with pitch numbers:

>>> chord = Chord("<g' c'' e''>4")
>>> show(chord) 
>>> chord.note_heads = [16, 17, 19]
>>> show(chord) 

Set note-heads with any iterable.

Returns note-head list.

Chord.written_duration

Gets written duration of chord.

Example 1. Get written duration:

>>> chord = Chord("<e' cs'' f''>4")
>>> show(chord) 
>>> chord.written_duration
Duration(1, 4)

Example 2. Set written duration:

>>> chord = Chord("<e' cs'' f''>4")
>>> show(chord) 
>>> chord.written_duration = Duration(1, 16)
>>> show(chord) 

Set duration.

Returns duration.

Chord.written_pitches

Written pitches in chord.

Example 1. Get written pitches:

>>> chord = Chord("<g' c'' e''>4")
>>> show(chord) 
>>> chord.written_pitches
PitchSegment("g' c'' e''")

Example 2. Set written pitches with pitch names:

>>> chord = Chord("<e' g' c''>4")
>>> show(chord) 
>>> chord.written_pitches = "f' b' d''"
>>> show(chord) 
>>> chord.written_pitches
PitchSegment("f' b' d''")

Set written pitches with any iterable.

Returns tuple.

Special methods

(Component).__copy__(*arguments)

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

Returns new component.

(AbjadObject).__eq__(argument)

Is true when ID of argument 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__(argument)

Is true when Abjad object does not equal argument. 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.

(Leaf).__str__()

String representation of leaf.

Returns string.