LilyPondGrobOverride

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

class abjad.lilypondnames.LilyPondGrobOverride.LilyPondGrobOverride(lilypond_type=None, grob_name='NoteHead', once=None, is_revert=None, property_path='color', value='red')

LilyPond grob override.

>>> override = abjad.LilyPondGrobOverride(
...    lilypond_type='Staff',
...    grob_name='TextSpanner',
...    once=True,
...    property_path=(
...        'bound-details',
...        'left',
...        'text',
...        ),
...    value=abjad.Markup(r'\bold { over pressure }'),
...    )
>>> print(override.override_string)
\once \override Staff.TextSpanner.bound-details.left.text = \markup {
    \bold
        {
            over
            pressure
        }
    }

Attributes Summary

__eq__ Is true when argument is a LilyPond grob override with equivalent keyword values.
__hash__ Hashes LilyPond grob override.
grob_name Gets grob name.
is_revert Is true if grob override is a grob revert.
lilypond_type Gets LilyPond type of context.
once Is true when grob override is to be applied only once.
override_format_pieces Gets LilyPond grob override override format pieces.
override_string Gets LilyPond grob override override string.
property_path Gets LilyPond grob override property path.
revert_format_pieces Gets LilyPond grob override revert format pieces.
revert_string Gets LilyPond grob override revert string.
tweak_string Gets LilyPond grob override tweak string.
value Gets value of LilyPond grob override.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

__eq__(argument)

Is true when argument is a LilyPond grob override with equivalent keyword values.

Return type:bool
(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

__hash__()

Hashes LilyPond grob override.

Redefined in tandem with __eq__.

Return type:int
(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Methods

tweak_string(directed=True, grob=False)

Gets LilyPond grob override tweak string.

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> override.tweak_string()
"- \\tweak style #'zigzag"
>>> override = abjad.LilyPondGrobOverride(
...     grob_name='RehearsalMark',
...     property_path='color',
...     value='red',
...     )
>>> override.tweak_string(directed=False)
'\\tweak color #red'

LilyPond literals are allowed:

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='TextSpann',
...     property_path=('bound-details', 'left-broken', 'text'),
...     value=abjad.LilyPondLiteral(r'\markup \upright pont.'),
...     )
>>> override.tweak_string(directed=False)
'\\tweak bound-details.left-broken.text \\markup \\upright pont.'
Return type:str

Read-only properties

grob_name

Gets grob name.

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> override.grob_name
'Glissando'
Return type:str
is_revert

Is true if grob override is a grob revert.

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> bool(override.is_revert)
False
>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     is_revert=True,
...     property_path='style',
...     )
>>> bool(override.is_revert)
True
Return type:Optional[bool]
lilypond_type

Gets LilyPond type of context.

>>> override = abjad.LilyPondGrobOverride(
...    lilypond_type='Staff',
...    grob_name='TextSpanner',
...    once=True,
...    property_path=(
...        'bound-details',
...        'left',
...        'text',
...        ),
...    value=abjad.Markup(r'\bold { over pressure }'),
...    )
>>> override.lilypond_type
'Staff'
>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> override.lilypond_type is None
True
Return type:Optional[str]
once

Is true when grob override is to be applied only once.

>>> override = abjad.LilyPondGrobOverride(
...    lilypond_type='Staff',
...    grob_name='TextSpanner',
...    once=True,
...    property_path=(
...        'bound-details',
...        'left',
...        'text',
...        ),
...    value=abjad.Markup(r'\bold { over pressure }'),
...    )
>>> bool(override.once)
True
>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> bool(override.once)
False
Return type:Optional[bool]
override_format_pieces

Gets LilyPond grob override override format pieces.

>>> override = abjad.LilyPondGrobOverride(
...    lilypond_type='Staff',
...    grob_name='TextSpanner',
...    once=True,
...    property_path=(
...        'bound-details',
...        'left',
...        'text',
...        ),
...    value=abjad.Markup(r'\bold { over pressure }'),
...    )
>>> for line in override.override_format_pieces:
...     line
...
'\\once \\override Staff.TextSpanner.bound-details.left.text = \\markup {'
'    \\bold'
'        {'
'            over'
'            pressure'
'        }'
'    }'
Return type:Tuple[str, …]
override_string

Gets LilyPond grob override override string.

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> override.override_string
"\\override Glissando.style = #'zigzag"
Return type:str
property_path

Gets LilyPond grob override property path.

>>> override = abjad.LilyPondGrobOverride(
...    lilypond_type='Staff',
...    grob_name='TextSpanner',
...    once=True,
...    property_path=(
...        'bound-details',
...        'left',
...        'text',
...        ),
...    value=abjad.Markup(r'\bold { over pressure }'),
...    )
>>> override.property_path
('bound-details', 'left', 'text')
Return type:Tuple[str, …]
revert_format_pieces

Gets LilyPond grob override revert format pieces.

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> override.revert_format_pieces
('\\revert Glissando.style',)
Return type:Tuple[str, …]
revert_string

Gets LilyPond grob override revert string.

>>> override = abjad.LilyPondGrobOverride(
...     grob_name='Glissando',
...     property_path='style',
...     value=abjad.SchemeSymbol('zigzag'),
...     )
>>> override.revert_string
'\\revert Glissando.style'
Return type:str
value

Gets value of LilyPond grob override.

>>> override = abjad.LilyPondGrobOverride(
...    lilypond_type='Staff',
...    grob_name='TextSpanner',
...    once=True,
...    property_path=(
...        'bound-details',
...        'left',
...        'text',
...        ),
...    value=abjad.Markup(r'\bold { over pressure }'),
...    )
>>> override.value
Markup(contents=[MarkupCommand('bold', ['over', 'pressure'])])
Return type:Any