leaftools.get_nth_leaf_in_thread_from_leaf

abjad.tools.leaftools.get_nth_leaf_in_thread_from_leaf.get_nth_leaf_in_thread_from_leaf(leaf, n=0)[source]

New in version 2.0.

Get n th leaf in thread from leaf:

abjad> staff = Staff(2 * Voice("c'8 d'8 e'8 f'8"))
abjad> pitchtools.set_ascending_named_diatonic_pitches_on_nontied_pitched_components_in_expr(staff)
abjad> f(staff)
\new Staff {
    \new Voice {
        c'8
        d'8
        e'8
        f'8
    }
    \new Voice {
        g'8
        a'8
        b'8
        c''8
    }
}
abjad> for n in range(8):
...     print n, leaftools.get_nth_leaf_in_thread_from_leaf(staff[0][0], n)
...
0 c'8
1 d'8
2 e'8
3 f'8
4 None
5 None
6 None
7 None

Return leaf or none.

This Page