KeyCluster¶
-
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
-