split.fractured_at_index

abjad.tools.split.fractured_at_index(container, i)

Splits container in two at given index position. Compare with split.container_fractured( )().

Both functions break container just before index. However, split.container_unfractured( ) preserves spanners. And split.container_fractured( ) fractures spanners.

Both functions create two new copies of container. Both functions empty original container of contents.

Return split parts.

Example of splitting a beamed triplet in voice:

t = Voice(FixedDurationTuplet((2, 8), construct.run(3)) * 2)
tuplet = t[1]
pitchtools.diatonicize(t)
Beam(t[:])

\new Voice {
        \times 2/3 {
                c'8 [
                d'8
                e'8
        }
        \times 2/3 {
                f'8
                g'8
                a'8 ]
        }
}

left, right = split.container_fractured(tuplet, 1)

\new Voice {
        \times 2/3 {
                c'8 [
                d'8
                e'8
        }
        \times 2/3 {
                f'8 ]
        }
        \times 2/3 {
                g'8 [
                a'8 ]
        }
}

Previous topic

split.fractured_at_duration

Next topic

split.unfractured_at_duration

This Page