scoretools.StaffGroup

Inheritance diagram of abjad.tools.scoretools.StaffGroup.StaffGroup.StaffGroup

class abjad.tools.scoretools.StaffGroup.StaffGroup.StaffGroup(music=None, **kwargs)[source]

Abjad model of staff group:

abjad> staff_1 = Staff("c'4 d'4 e'4 f'4 g'1")
abjad> staff_2 = Staff("g2 f2 e1")
abjad> staff_group = scoretools.StaffGroup([staff_1, staff_2])
abjad> f(staff_group)
\new StaffGroup <<
    \new Staff {
        c'4
        d'4
        e'4
        f'4
        g'1
    }
    \new Staff {
        g2
        f2
        e1
    }
>>

Return staff group.

Read-only Properties

StaffGroup.contents_duration

Note

Inherited from containertools.Container

StaffGroup.duration_in_seconds

Note

Inherited from containertools.Container

StaffGroup.engraver_consists

New in version 2.0.

Unordered set of LilyPond engravers to include in context definition.

Manage with add, update, other standard set commands.

abjad> staff = Staff([])
abjad> staff.engraver_consists.add('Horizontal_bracket_engraver')
abjad> f(staff)
\new Staff \with {
    \consists Horizontal_bracket_engraver
} {
}

Note

Inherited from contexttools.Context

StaffGroup.engraver_removals

New in version 2.0.

Unordered set of LilyPond engravers to remove from context.

Manage with add, update, other standard set commands.

abjad> staff = Staff([])
abjad> staff.engraver_removals.add('Time_signature_engraver')
abjad> f(staff)
\new Staff \with {
    \remove Time_signature_engraver
} {
}

Note

Inherited from contexttools.Context

StaffGroup.format

Read-only LilyPond input format of component.

Note

Inherited from componenttools.Component

StaffGroup.is_semantic

Note

Inherited from contexttools.Context

StaffGroup.leaves

Read-only tuple of leaves in container:

abjad> container = Container("c'8 d'8 e'8")
abjad> container.leaves
(Note("c'8"), Note("d'8"), Note("e'8"))

Return tuple of zero or more leaves.

Note

Inherited from containertools.Container

StaffGroup.marks

Read-only tuple of marks attached to component.

Note

Inherited from componenttools.Component

StaffGroup.music

Read-only tuple of components in container:

abjad> container = Container("c'8 d'8 e'8")
abjad> container.music
(Note("c'8"), Note("d'8"), Note("e'8"))

Return tuple or zero or more components.

Note

Inherited from containertools.Container

StaffGroup.override

Read-only reference to LilyPond grob override component plug-in.

Note

Inherited from componenttools.Component

StaffGroup.parent

Note

Inherited from componenttools.Component

StaffGroup.preprolated_duration

Note

Inherited from containertools.Container

StaffGroup.prolated_duration

Note

Inherited from componenttools.Component

StaffGroup.prolation

Note

Inherited from componenttools.Component

StaffGroup.set

Read-only reference LilyPond context setting component plug-in.

Note

Inherited from componenttools.Component

StaffGroup.spanners

Read-only reference to unordered set of spanners attached to component.

Note

Inherited from componenttools.Component

Read/write Properties

StaffGroup.context_name

Read / write name of context as a string.

Note

Inherited from contexttools.Context

StaffGroup.is_nonsemantic

Set indicator of nonsemantic voice:

abjad> measures = measuretools.make_measures_with_full_measure_spacer_skips([(1, 8), (5, 16), (5, 16)])
abjad> voice = Voice(measures)
abjad> voice.name = 'HiddenTimeSignatureVoice'
abjad> voice.is_nonsemantic = True
abjad> f(voice)
\context Voice = "HiddenTimeSignatureVoice" {
    {
        \time 1/8
        s1 * 1/8
    }
    {
        \time 5/16
        s1 * 5/16
    }
    {
        \time 5/16
        s1 * 5/16
    }
}
abjad> voice.is_nonsemantic
True

Get indicator of nonsemantic voice:

abjad> voice = Voice([])
abjad> voice.is_nonsemantic
False

Return boolean.

The intent of this read / write attribute is to allow composers to tag invisible voices used to house time signatures indications, bar number directives or other pieces of score-global non-musical information. Such nonsemantic voices can then be omitted from voice interation and other functions.

Note

Inherited from contexttools.Context

StaffGroup.is_parallel

Get parallel container:

abjad> container = Container([Voice("c'8 d'8 e'8"), Voice('g4.')])
abjad> f(container)
{
    \new Voice {
        c'8
        d'8
        e'8
    }
    \new Voice {
        g4.
    }
}
abjad> container.is_parallel
False

Return boolean.

Set parallel container:

abjad> container.is_parallel = True
abjad> f(container)
<<
    \new Voice {
        c'8
        d'8
        e'8
    }
    \new Voice {
        g4.
    }
>>

Return none.

Note

Inherited from containertools.Container

StaffGroup.name

Read-write name of context. Must be string or none.

Note

Inherited from contexttools.Context

Methods

StaffGroup.append(component)

Append component to container:

abjad> container = Container("c'8 d'8 e'8")
abjad> beam = spannertools.BeamSpanner(container.music)
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
}
abjad> container.append(Note("f'8"))
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
    f'8
}

Return none.

Note

Inherited from containertools.Container

StaffGroup.extend(expr)

Extend expr against container:

abjad> container = Container("c'8 d'8 e'8")
abjad> beam = spannertools.BeamSpanner(container.music)
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
}
abjad> container.extend([Note("cs'8"), Note("ds'8"), Note("es'8")])
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
    cs'8
    ds'8
    es'8
}

Return none.

New in version 2.3: expr may now be a LilyPond input string.

Note

Inherited from containertools.Container

StaffGroup.index(component)

Index component in container:

abjad> container = Container("c'8 d'8 e'8")
abjad> note = container[-1]
abjad> note
Note("e'8")
abjad> container.index(note)
2

Return nonnegative integer.

Note

Inherited from containertools.Container

StaffGroup.insert(i, component)

Insert component in container at index i:

abjad> container = Container("c'8 d'8 e'8")
abjad> beam = spannertools.BeamSpanner(container.music)
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
}
abjad> container.insert(1, Note("cs'8"))
abjad> f(container)
{
    c'8 [
    cs'8
    d'8
    e'8 ]
}

Return none.

Note

Inherited from containertools.Container

StaffGroup.pop(i=-1)

Pop component at index i from container:

abjad> container = Container("c'8 d'8 e'8")
abjad> beam = spannertools.BeamSpanner(container.music)
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
}
abjad> container.pop(-1)
Note("e'8")
abjad> f(container)
{
    c'8 [
    d'8 ]
}

Return component.

Note

Inherited from containertools.Container

StaffGroup.remove(component)

Remove component from container:

abjad> container = Container("c'8 d'8 e'8")
abjad> beam = spannertools.BeamSpanner(container.music)
abjad> f(container)
{
    c'8 [
    d'8
    e'8 ]
}
abjad> note = container[-1]
abjad> note
Note("e'8")
abjad> container.remove(note)
abjad> f(container)
{
    c'8 [
    d'8 ]
}

Return none.

Note

Inherited from containertools.Container

Special Methods

StaffGroup.__add__(expr)

Concatenate containers self and expr. The operation c = a + b returns a new Container c with the content of both a and b. The operation is non-commutative: the content of the first operand will be placed before the content of the second operand.

Note

Inherited from containertools.Container

StaffGroup.__contains__(expr)

True if expr is in container, otherwise False.

Note

Inherited from containertools.Container

StaffGroup.__delattr__()

x.__delattr__(‘name’) <==> del x.name

Note

Inherited from __builtin__.object

StaffGroup.__delitem__(i)

Find component(s) at index or slice ‘i’ in container. Detach component(s) from parentage. Withdraw component(s) from crossing spanners. Preserve spanners that component(s) cover(s).

Note

Inherited from containertools.Container

StaffGroup.__eq__(arg)

True when id(self) equals id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

StaffGroup.__ge__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

StaffGroup.__getitem__(i)

Return component at index i in container. Shallow traversal of container for numeric indices only.

Note

Inherited from containertools.Container

StaffGroup.__gt__(arg)

Abjad objects by default do not implement this method.

Raise exception

Note

Inherited from abctools.AbjadObject

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

Note

Inherited from __builtin__.object

StaffGroup.__iadd__(expr)

__iadd__ avoids unnecessary copying of structures.

Note

Inherited from containertools.Container

StaffGroup.__imul__(total)

Multiply contents of container ‘total’ times. Return multiplied container.

Note

Inherited from containertools.Container

StaffGroup.__le__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

StaffGroup.__len__()

Return nonnegative integer number of components in container.

Note

Inherited from containertools.Container

StaffGroup.__lt__(arg)

Abjad objects by default do not implement this method.

Raise exception.

Note

Inherited from abctools.AbjadObject

StaffGroup.__mul__(n)

Note

Inherited from componenttools.Component

StaffGroup.__ne__(arg)

True when id(self) does not equal id(arg).

Return boolean.

Note

Inherited from abctools.AbjadObject

StaffGroup.__radd__(expr)

Extend container by contents of expr to the right.

Note

Inherited from containertools.Container

StaffGroup.__repr__()

Changed in version 2.0.

Named contexts now print name at the interpreter.

Note

Inherited from contexttools.Context

StaffGroup.__rmul__(n)

Note

Inherited from componenttools.Component

StaffGroup.__setattr__()

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

Note

Inherited from __builtin__.object

StaffGroup.__setitem__(i, expr)

Set ‘expr’ in self at nonnegative integer index i. Or, set ‘expr’ in self at slice i. Find spanners that dominate self[i] and children of self[i]. Replace contents at self[i] with ‘expr’. Reattach spanners to new contents. This operation leaves all score trees always in tact.

Note

Inherited from containertools.Container

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

Note

Inherited from __builtin__.object

Table Of Contents

This Page