KeyCluster

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.indicators" { graph [label="abjad.indicators"]; node [color=1]; "abjad.indicators.KeyCluster.KeyCluster" [URL="../api/abjad/indicators/KeyCluster.html#abjad.indicators.KeyCluster.KeyCluster", color=black, fontcolor=white, label="Key\nCluster", target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/indicators/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/indicators/../system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } 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.AbjadValueObject.AbjadValueObject" -> "abjad.indicators.KeyCluster.KeyCluster"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.indicators.KeyCluster.KeyCluster(*, include_black_keys=True, include_white_keys=True, hide=False, markup_direction=Up)

Key cluster.

Default values:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster()
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Attributes Summary

hide Is true if key cluster hidees key markup.
include_black_keys Is true if key cluster includes black keys.
include_white_keys Is true if key cluster includes white keys.
markup_direction Gets markup direction.
tweaks Are not implemented on key cluster.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

hide

Is true if key cluster hidees key markup.

Does not hide markup:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(hide=False)
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Default behavior.

Does not hide markup:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(hide=True)
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Todo

Remove?

Return type:bool
include_black_keys

Is true if key cluster includes black keys.

Includes flat markup:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(
...     include_black_keys=True,
...     )
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Default behavior.

Does not include flat markup:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(
...     include_black_keys=False,
...     )
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Todo

Rename to include_flat_markup.

Return type:bool
include_white_keys

Is true if key cluster includes white keys.

Includes natural markup:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(
...     include_white_keys=True,
...     )
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Default behavior.

Does not include natural markup:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(
...     include_white_keys=False,
...     )
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Todo

Rename to include_natural_markup.

Return type:bool
markup_direction

Gets markup direction.

Positions markup up:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(
...     markup_direction=abjad.Up,
...     )
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 

Default behavior.

Positions markup down:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster(
...     markup_direction=abjad.Down,
...     )
>>> abjad.attach(key_cluster, chord)
>>> abjad.show(chord) 
Return type:VerticalAlignment
tweaks

Are not implemented on key cluster.

Key cluster formats LilyPond overrides instead of tweaks:

>>> chord = abjad.Chord("<c' e' g' b' d'' f''>8")
>>> key_cluster = abjad.KeyCluster()
>>> abjad.attach(key_cluster, chord)
>>> abjad.f(chord)
\once \override Accidental.stencil = ##f
\once \override AccidentalCautionary.stencil = ##f
\once \override Arpeggio.X-offset = #-2
\once \override NoteHead.stencil = #ly:text-interface::print
\once \override NoteHead.text = \markup {
	\filled-box #'(-0.6 . 0.6) #'(-0.7 . 0.7) #0.25
}
<c' e' g' b' d'' f''>8
^ \markup {
    \center-align
        \concat
            {
                \natural
                \flat
            }
    }

The reason for this is that chords contain multiple note-heads: if key cluster formatted tweaks instead of overrides, the five format commands shown above would need to be duplicated immediately before each note-head.

Return type:None