spannertools.find_index_of_spanner_component_at_score_offset

abjad.tools.spannertools.find_index_of_spanner_component_at_score_offset.find_index_of_spanner_component_at_score_offset(spanner, score_offset)[source]

Return index of component in ‘spanner’ that begins at exactly ‘score_offset’:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> beam = spannertools.BeamSpanner(staff.leaves)
abjad> f(staff)
\new Staff {
    c'8 [
    d'8
    e'8
    f'8 ]
}
abjad> spannertools.find_index_of_spanner_component_at_score_offset(beam, Duration(3, 8))
3

Raise spanner population error when no component in spanner begins at exactly score_offset.

Changed in version 2.0: renamed spannertools.find_index_at_score_offset() to spannertools.find_index_of_spanner_component_at_score_offset().

This Page