contexttools.ClefMark

Inheritance diagram of abjad.tools.contexttools.ClefMark.ClefMark.ClefMark

class abjad.tools.contexttools.ClefMark.ClefMark.ClefMark(arg, target_context=None)[source]

New in version 2.0.

Abjad model of a clef:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> contexttools.ClefMark('treble')(staff)
ClefMark('treble')(Staff{4})
abjad> f(staff)
\new Staff {
    \clef "treble"
    c'8
    d'8
    e'8
    f'8
}

Clef marks target the staff context by default.

Read-only Properties

ClefMark.effective_context

Read-only reference to effective context of context mark:

abjad> note = Note("c'4")
abjad> context_mark = contexttools.ContextMark()(note)
abjad> context_mark.effective_context is None
True

Return context mark or none.

Note

Inherited from contexttools.ContextMark

ClefMark.format[source]

Read-only LilyPond format of clef:

abjad> clef = contexttools.ClefMark('treble')
abjad> clef.format
'\\clef "treble"'

Return string.

ClefMark.middle_c_position[source]

Read-only middle-C position of clef:

abjad> clef = contexttools.ClefMark('treble')
abjad> clef.middle_c_position
-6

Return integer number of stafflines.

ClefMark.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

ClefMark.target_context

Read-only reference to target context of context mark:

abjad> note = Note("c'4")
abjad> context_mark = contexttools.ContextMark()(note)
abjad> context_mark.target_context is None
True

Return context mark or none.

Note

Inherited from contexttools.ContextMark

Read/write Properties

ClefMark.clef_name[source]

Get clef name:

abjad> clef = contexttools.ClefMark('treble')
abjad> clef.clef_name
'treble'

Set clef name:

abjad> clef.clef_name = 'alto'
abjad> clef.clef_name
'alto'

Return string.

Methods

ClefMark.attach(start_component)

Make sure no context mark of same type is already attached to start component.

Note

Inherited from contexttools.ContextMark

ClefMark.detach()

Detach mark:

abjad> note = Note("c'4")
abjad> context_mark = contexttools.ContextMark()(note)
abjad> context_mark.start_component
Note("c'4")
abjad> context_mark.detach()
ContextMark()
abjad> context_mark.start_component is None
True

Return context mark.

Note

Inherited from contexttools.ContextMark

Special Methods

ClefMark.__call__(*args)

Note

Inherited from marktools.Mark

ClefMark.__delattr__(*args)

Note

Inherited from marktools.Mark

ClefMark.__eq__(arg)[source]
ClefMark.__ge__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

ClefMark.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

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

Note

Inherited from __builtin__.object

ClefMark.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

ClefMark.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

ClefMark.__ne__(arg)

Note

Inherited from marktools.Mark

ClefMark.__repr__()

Note

Inherited from marktools.Mark

ClefMark.__setattr__()

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

Note

Inherited from __builtin__.object

ClefMark.__str__() <==> str(x)

Note

Inherited from __builtin__.object

Table Of Contents

This Page