contexttools.StaffChangeMark

Inheritance diagram of abjad.tools.contexttools.StaffChangeMark.StaffChangeMark.StaffChangeMark

class abjad.tools.contexttools.StaffChangeMark.StaffChangeMark.StaffChangeMark(staff, target_context=None)[source]

New in version 2.0.

Abjad model of a staff change:

abjad> piano_staff = scoretools.PianoStaff([])
abjad> rh_staff = Staff("c'8 d'8 e'8 f'8")
abjad> rh_staff.name = 'RHStaff'
abjad> lh_staff = Staff("s2")
abjad> lh_staff.name = 'LHStaff'
abjad> piano_staff.extend([rh_staff, lh_staff])
abjad> f(piano_staff)
\new PianoStaff <<
    \context Staff = "RHStaff" {
        c'8
        d'8
        e'8
        f'8
    }
    \context Staff = "LHStaff" {
        s2
    }
>>
abjad> contexttools.StaffChangeMark(lh_staff)(rh_staff[2])
StaffChangeMark(Staff-"LHStaff"{1})(e'8)
abjad> f(piano_staff)
\new PianoStaff <<
    \context Staff = "RHStaff" {
        c'8
        d'8
        \change Staff = LHStaff
        e'8
        f'8
    }
    \context Staff = "LHStaff" {
        s2
    }
>>

Staff change marks target staff context by default.

Read-only Properties

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

StaffChangeMark.format[source]

Read-only LilyPond format of staff change mark:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> staff.name = 'RHStaff'
abjad> staff_change = contexttools.StaffChangeMark(staff)
abjad> staff_change.format
'\\change Staff = RHStaff'

Return string.

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

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

StaffChangeMark.staff[source]

Get staff of staff change mark:

abjad> rh_staff = Staff("c'8 d'8 e'8 f'8")
abjad> rh_staff.name = 'RHStaff'
abjad> staff_change = contexttools.StaffChangeMark(rh_staff)
abjad> staff_change.staff
Staff-"RHStaff"{4}

Set staff of staff change mark:

abjad> lh_staff = Staff("s2")
abjad> lh_staff.name = 'LHStaff'
abjad> staff_change.staff = lh_staff
abjad> staff_change.staff
Staff-"LHStaff"{1}

Return staff.

Methods

StaffChangeMark.attach(start_component)

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

Note

Inherited from contexttools.ContextMark

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

StaffChangeMark.__call__(*args)

Note

Inherited from marktools.Mark

StaffChangeMark.__delattr__(*args)

Note

Inherited from marktools.Mark

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

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

StaffChangeMark.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

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

Note

Inherited from __builtin__.object

StaffChangeMark.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

StaffChangeMark.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

StaffChangeMark.__ne__(arg)

Note

Inherited from marktools.Mark

StaffChangeMark.__repr__()

Note

Inherited from marktools.Mark

StaffChangeMark.__setattr__()

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

Note

Inherited from __builtin__.object

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

Note

Inherited from __builtin__.object

Table Of Contents

This Page