componenttools.iterate_components_backward_in_expr

abjad.tools.componenttools.iterate_components_backward_in_expr.iterate_components_backward_in_expr(expr, klass=<class 'abjad.tools.componenttools.Component.Component.Component'>, start=0, stop=None)[source]

New in version 1.1.

Iterate components backward in expr:

abjad> staff = Staff(tuplettools.FixedDurationTuplet(Duration(2, 8), notetools.make_repeated_notes(3)) * 2)
abjad> pitchtools.set_ascending_named_diatonic_pitches_on_nontied_pitched_components_in_expr(staff)
abjad> f(staff)
\new Staff {
    \times 2/3 {
        c'8
        d'8
        e'8
    }
    \times 2/3 {
        f'8
        g'8
        a'8
    }
}
abjad> for x in componenttools.iterate_components_backward_in_expr(staff, Note):
...     x
...
Note("a'8")
Note("g'8")
Note("f'8")
Note("e'8")
Note("d'8")
Note("c'8")

New in version 2.0: optional start and stop keyword parameters.

abjad> for x in componenttools.iterate_components_backward_in_expr(staff, Note, start = 0, stop = 4):
...     x
...
Note("a'8")
Note("g'8")
Note("f'8")
Note("e'8")
abjad> for x in componenttools.iterate_components_backward_in_expr(staff, Note, start = 4):
...     x
...
Note("d'8")
Note("c'8")
abjad> for x in componenttools.iterate_components_backward_in_expr(staff, Note, start = 4, stop = 6):
...     x
...
Note("d'8")
Note("c'8")

This function is thread-agnostic.

Changed in version 2.0: renamed iterate.backwards() to componenttools.iterate_components_backward_in_expr().

This Page