contexttools.KeySignatureMark

Inheritance diagram of abjad.tools.contexttools.KeySignatureMark.KeySignatureMark.KeySignatureMark

class abjad.tools.contexttools.KeySignatureMark.KeySignatureMark.KeySignatureMark(tonic, mode, target_context=None)[source]

New in version 2.0.

Abjad model of a key signature setting or key signature change:

abjad> staff = Staff("e'8 fs'8 gs'8 a'8")
abjad> contexttools.KeySignatureMark('e', 'major')(staff)
KeySignatureMark(NamedChromaticPitchClass('e'), Mode('major'))(Staff{4})
abjad> f(staff)
\new Staff {
    \key e \major
    e'8
    fs'8
    gs'8
    a'8
}

Key signature marks target staff context by default.

Read-only Properties

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

KeySignatureMark.format[source]

Read-only LilyPond format of key signature mark:

abjad> key_signature = contexttools.KeySignatureMark('e', 'major')
abjad> key_signature.format
'\\key e \\major'

Return string.

KeySignatureMark.name[source]

Read-only name of key signature:

abjad> key_signature = contexttools.KeySignatureMark('e', 'major')
abjad> key_signature.name
'E major'

Return string.

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

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

KeySignatureMark.mode[source]

Get mode of key signature:

abjad> key_signature = contexttools.KeySignatureMark('e', 'major')
abjad> key_signature.mode
Mode('major')

Set mode of key signature:

abjad> key_signature.mode = 'minor'
abjad> key_signature.mode
Mode('minor')

Return mode.

KeySignatureMark.tonic[source]

Get tonic of key signature:

abjad> key_signature = contexttools.KeySignatureMark('e', 'major')
abjad> key_signature.tonic
NamedChromaticPitchClass('e')

Set tonic of key signature:

abjad> key_signature.tonic = 'd'
abjad> key_signature.tonic
NamedChromaticPitchClass('d')

Return named chromatic pitch.

Methods

KeySignatureMark.attach(start_component)

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

Note

Inherited from contexttools.ContextMark

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

KeySignatureMark.__call__(*args)

Note

Inherited from marktools.Mark

KeySignatureMark.__delattr__(*args)

Note

Inherited from marktools.Mark

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

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

KeySignatureMark.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

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

Note

Inherited from __builtin__.object

KeySignatureMark.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

KeySignatureMark.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

KeySignatureMark.__ne__(arg)

Note

Inherited from marktools.Mark

KeySignatureMark.__repr__()

Note

Inherited from marktools.Mark

KeySignatureMark.__setattr__()

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

Note

Inherited from __builtin__.object

KeySignatureMark.__str__()[source]

Table Of Contents

This Page