InstrumentInterface

class abjad.instrument.interface.InstrumentInterface(client)

Bases: abjad.core.interface._Interface, abjad.core.grobhandler._GrobHandler, abjad.core.settinghandler._ContextSettingHandler, abjad.spanner.receptor._SpannerReceptor

Receive Abjad Instrument spanner. Handle the LilyPond InstrumentName grob.

abjad> t = Staff(construct.scale(4))
abjad> t.instrument
<InstrumentInterface>
abjad> t.instrument.color = 'red'
abjad> print t.format
\new Staff \with {
   \override InstrumentName #'color = #red
} {
   c'8
   d'8
   e'8
   f'8
}
chain
Return tuple of all leaves in spanner, if spanned; otherwise return 1-tuple of client.
count
Return number of spanners attaching to client.
first
True when client is first in spanner, otherwise False.
last
True when client is last in spanner, otherwise False.
name

Read / write LilyPond instrumentName context setting.

  • Default value: None.
  • All values: str, Markup, None.
abjad> t = Staff(construct.scale(4))
abjad> t.instrument.name = 'Violini I'
abjad> print t.format
\new Staff \with {
   instrumentName = "Violini I"
} {
   c'8
   d'8
   e'8
   f'8
}
only
True when client is only leaf in spanner, otherwise False.
parented
True when spanner attached to any component in parentage of client, including client, otherwise False.
position
Return zero-indexed position of client in spanner.
promote(setting, context)
Promote setting to LilyPond context.
settings

Read-only list of LilyPond context settings picked up at format-time.

  • Derived from name and short_name.
abjad> t = Staff(construct.scale(4))
abjad> t.instrument.name = 'Violini I'
abjad> t.instrument.short_name = 'Vni. I'
abjad> t.instrument.settings
['instrumentName = "Violini I"', 'shortInstrumentName = "Vni. I"']
short_name

Read / write LilyPond shortInstrumentName context setting.

  • Default value: None.
  • All values: str, Markup, None.
abjad> t = Staff(construct.scale(4))
abjad> t.instrument.short_name = 'Vni. I'
abjad> print t.format
\new Staff \with {
   shortInstrumentName = "Vni. I"
} {
   c'8
   d'8
   e'8
   f'8
}
spanned
True when client is spanned.
spanner
Return first spanner attaching to client.
spanner_in_parentage
Return first spanner attaching to parentage of client.
spanners
Return all spanners attaching to client.
unspan()
Remove all spanners attaching to client.

Previous topic

HistoryInterface

Next topic

InterfaceAggregator

This Page