Abjad model of backslash-style LilyPond markup or Scheme-style LilyPond markup.
Initialize backslash-style markup from string:
abjad> markup = markuptools.Markup(r'\bold { "This is markup text." }')
abjad> markup
Markup('\\bold { "This is markup text." }')
abjad> f(markup)
\markup { \bold { "This is markup text." } }
Initialize Scheme-style markup from string:
abjad> markup = markuptools.Markup("(markup #:draw-line '(0 . -1))", style_string='scheme')
abjad> markup
Markup("(markup #:draw-line '(0 . -1))", style_string='scheme')
abjad> f(markup)
#(markup #:draw-line '(0 . -1))
Initialize any markup from existing markup:
abjad> markup_1 = markuptools.Markup('foo', direction='up')
abjad> markup_2 = markuptools.Markup(markup_1, direction='down')
abjad> f(markup_1)
^ \markup { foo }
abjad> f(markup_2) # doctest: +SKIP
_ \markup { foo }
Attach markup to score components like this:
abjad> note = Note("c'4")
abjad> markup = markuptools.Markup(r'\bold { "This is markup text." }')
abjad> markup(note)
Markup('\\bold { "This is markup text." }')(c'4)
abjad> f(note)
c'4 - \markup { \bold { "This is markup text." } }
Set direction to 'up', 'down', 'neutral', '^', '_', '-' or None.
Set style_string to 'backslash', 'scheme' or none. Default to 'backslash'.
Markup objects are immutable.
Read-only contents string of markup:
abjad> markup = markuptools.Markup(r'\bold { "This is markup text." }')
abjad> markup.contents_string
'\\bold { "This is markup text." }'
Return string
Read-only LilyPond format of markup:
abjad> markup = markuptools.Markup(r'\bold { "This is markup text." }')
abjad> markup.format
'\\markup { \\bold { "This is markup text." } }'
Return string.
Read-only name of markup:
abjad> markup = markuptools.Markup(r'\bold { allegro ma non troppo }', markup_name='non troppo')
abjad> markup.markup_name
'non troppo'
Return string or none.
Read-only reference to mark start component:
abjad> note = Note("c'4")
abjad> mark = marktools.Mark()(note)
abjad> mark.start_component
Note("c'4")
Return component or none.
Note
Inherited from marktools.Mark
Attach mark to start_component:
abjad> note = Note("c'4")
abjad> mark = marktools.Mark()
abjad> mark.attach(note)
Mark()(c'4)
abjad> mark.start_component
Note("c'4")
Return mark.
Note
Inherited from marktools.Mark
Detach mark:
abjad> note = Note("c'4")
abjad> mark = marktools.Mark()(note)
abjad> mark.start_component
Note("c'4")
abjad> mark.detach()
Mark()
abjad> mark.start_component is None
True
Return mark.
Note
Inherited from marktools.Mark
Note
Inherited from marktools.Mark
Note
Inherited from marktools.Mark
Abjad objects by default do not implement this method.
Raise exception.
Note
Inherited from abctools.AbjadObject
Abjad objects by default do not implement this method.
Raise exception
Note
Inherited from abctools.AbjadObject
Abjad objects by default do not implement this method.
Raise exception.
Note
Inherited from abctools.AbjadObject
Abjad objects by default do not implement this method.
Raise exception.
Note
Inherited from abctools.AbjadObject
Note
Inherited from marktools.Mark
x.__setattr__(‘name’, value) <==> x.name = value
Note
Inherited from __builtin__.object