contexttools.InstrumentMark

Inheritance diagram of abjad.tools.contexttools.InstrumentMark.InstrumentMark.InstrumentMark

class abjad.tools.contexttools.InstrumentMark.InstrumentMark.InstrumentMark(instrument_name, short_instrument_name, instrument_name_markup=None, short_instrument_name_markup=None, target_context=None)[source]

New in version 2.0.

Abjad model of an instrument change:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> contexttools.InstrumentMark('Flute', 'Fl.')(staff)
InstrumentMark(instrument_name='Flute', short_instrument_name='Fl.')(Staff{4})
abjad> f(staff)
\new Staff {
    \set Staff.instrumentName = \markup { Flute }
    \set Staff.shortInstrumentName = \markup { Fl. }
    c'8
    d'8
    e'8
    f'8
}

Instrument marks target staff context by default.

Read-only Properties

InstrumentMark.default_instrument_name[source]

Read-only default instrument name.

Return string.

InstrumentMark.default_short_instrument_name[source]

Read-only default short instrument name.

Return string.

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

InstrumentMark.format[source]

Read-only LilyPond input format of instrument mark:

abjad> instrument = contexttools.InstrumentMark('Flute', 'Fl.')
abjad> instrument.format
['\set Staff.instrumentName = \markup { Flute }', '\set Staff.shortInstrumentName = \markup { Fl. }']

Return list.

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

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

InstrumentMark.instrument_name[source]

Get instrument name:

abjad> instrument = contexttools.InstrumentMark('Flute', 'Fl.')
abjad> instrument.instrument_name
'Flute'

Set instrument name:

abjad> instrument.instrument_name = 'Alto Flute'
abjad> instrument.instrument_name
'Alto Flute'

Return string.

InstrumentMark.instrument_name_markup[source]

Get instrument name:

abjad> instrument = contexttools.InstrumentMark('Flute', 'Fl.')
abjad> instrument.instrument_name_markup
Markup('Flute')

Set instrument name:

abjad> instrument.instrument_name_markup = 'Alto Flute'
abjad> instrument.instrument_name_markup
Markup('Alto Flute')

Return markup.

InstrumentMark.short_instrument_name[source]

Get short instrument name:

abjad> instrument = contexttools.InstrumentMark('Flute', 'Fl.')
abjad> instrument.short_instrument_name
'Fl.'

Set short instrument name:

abjad> instrument.short_instrument_name = 'Alto Fl.'
abjad> instrument.short_instrument_name
'Alto Fl.'

Return string.

InstrumentMark.short_instrument_name_markup[source]

Get short instrument name:

abjad> instrument = contexttools.InstrumentMark('Flute', 'Fl.')
abjad> instrument.short_instrument_name_markup
Markup('Fl.')

Set short instrument name:

abjad> instrument.short_instrument_name_markup = 'Alto Fl.'
abjad> instrument.short_instrument_name_markup
Markup('Alto Fl.')

Return markup.

Methods

InstrumentMark.attach(start_component)

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

Note

Inherited from contexttools.ContextMark

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

InstrumentMark.__call__(*args)

Note

Inherited from marktools.Mark

InstrumentMark.__delattr__(*args)

Note

Inherited from marktools.Mark

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

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

InstrumentMark.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

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

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

InstrumentMark.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

InstrumentMark.__ne__(arg)

Note

Inherited from marktools.Mark

InstrumentMark.__repr__()

Note

Inherited from marktools.Mark

InstrumentMark.__setattr__()

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

Note

Inherited from __builtin__.object

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

Note

Inherited from __builtin__.object

Table Of Contents

This Page