iterate.tie_chains

abjad.tools.iterate.tie_chains(expr)

Yield left-to-right tie chains in expr.

abjad> notes construct.notes([0], [(5, 16), (1, 8), (1, 8), (5, 16)])
abjad> staff = Staff(notes)
abjad> tuplet = FixedDurationTuplet((2, 16), staff[1:3])
abjad> pitchtools.diatonicize(staff)
abjad> print staff.format
\new Staff {
        c'4 ~
        \times 2/3 {
                c'16
                d'8
        }
        e'8
        f'4 ~
        f'16
}
abjad> for x in iterate.tie_chains(t):
...     x
... 
(Note(c', 4), Note(c', 16))
(Note(d', 8),)
(Note(e', 8),)
(Note(f', 4), Note(f', 16))

Note that one-note tie chains yield the same as other tie chains.

Note also that nested structures are no problem.

Previous topic

iterate.thread_from

Next topic

label.clear_leaves

This Page