markuptools.MarkupCommand

Inheritance diagram of abjad.tools.markuptools.MarkupCommand.MarkupCommand.MarkupCommand

class abjad.tools.markuptools.MarkupCommand.MarkupCommand.MarkupCommand(command, *args)[source]

Abjad model of a LilyPond markup command:

abjad> circle = markuptools.MarkupCommand('draw-circle', 2.5, 0.1, False)
abjad> square = markuptools.MarkupCommand('rounded-box', 'hello?')
abjad> line = markuptools.MarkupCommand('line', [square, 'wow!'])
abjad> rotate = markuptools.MarkupCommand('rotate', 60, line)
abjad> combine = markuptools.MarkupCommand('combine', rotate, circle)
abjad> print combine
\combine \rotate #60 \line { \rounded-box hello? wow! } \draw-circle #2.5 #0.1 ##f

Insert markup command in markup to attach to score components:

abjad> note = Note("c'4")
abjad> markup = markuptools.Markup(combine)
abjad> markup(note)
Markup('\\combine \\rotate #60 \\line { \\rounded-box hello? wow! } \\draw-circle #2.5 #0.1 ##f')(c'4)
abjad> f(note)
c'4 - \markup { \combine \rotate #60 \line { \rounded-box hello? wow! } \draw-circle #2.5 #0.1 ##f }

Markup commands are immutable.

Read-only Properties

MarkupCommand.args[source]

Read-only tuple of markup command arguments.

MarkupCommand.command[source]

Read-only string of markup command command-name.

MarkupCommand.format[source]

Read-only format of markup command:

abjad> markup_command = markuptools.MarkupCommand('draw-circle', 2.5, 0.1, False)
abjad> markup_command.format
'\\draw-circle #2.5 #0.1 ##f'

Returns string.

Special Methods

MarkupCommand.__delattr__()

x.__delattr__(‘name’) <==> del x.name

Note

Inherited from __builtin__.object

MarkupCommand.__eq__(other)[source]
MarkupCommand.__ge__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

MarkupCommand.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

MarkupCommand.__hash__() <==> hash(x)

Note

Inherited from __builtin__.object

MarkupCommand.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

MarkupCommand.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

MarkupCommand.__ne__(arg)

True when id(self) does not equal id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

MarkupCommand.__repr__()[source]
MarkupCommand.__setattr__()

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

Note

Inherited from __builtin__.object

MarkupCommand.__str__()[source]

Table Of Contents

This Page