markuptools.Markup

Inheritance diagram of abjad.tools.markuptools.Markup.Markup.Markup

class abjad.tools.markuptools.Markup.Markup.Markup(argument, direction=None, markup_name=None, style_string=None)[source]

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 Properties

Markup.contents_string[source]

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

Markup.format[source]

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.

Markup.markup_name[source]

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.

Markup.start_component

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

Markup.style_string[source]

Read-only style string of markup.

Read/write Properties

Markup.direction

Note

Inherited from marktools._DirectedMark

Methods

Markup.attach(start_component)

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

Markup.detach()

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

Special Methods

Markup.__call__(*args)

Note

Inherited from marktools.Mark

Markup.__delattr__(*args)

Note

Inherited from marktools.Mark

Markup.__eq__(expr)[source]
Markup.__ge__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

Markup.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

Markup.__hash__()[source]
Markup.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

Markup.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

Markup.__ne__(expr)[source]
Markup.__repr__()

Note

Inherited from marktools.Mark

Markup.__setattr__()

x.__setattr__(‘name’, value) <==> x.name = value

Note

Inherited from __builtin__.object

Markup.__str__()[source]

Table Of Contents

This Page