componenttools.get_nth_namesake_from_component

abjad.tools.componenttools.get_nth_namesake_from_component.get_nth_namesake_from_component(component, n)[source]

New in version 2.0.

For positive n, return namesake to the right of component:

abjad> t = Staff("c'8 d'8 e'8 f'8")
abjad> componenttools.get_nth_namesake_from_component(t[1], 1)
Note("e'8")

For negative n, return namesake to the left of component:

abjad> t = Staff("c'8 d'8 e'8 f'8")
abjad> componenttools.get_nth_namesake_from_component(t[1], -1)
Note("c'8")

Return component when n is zero:

abjad> t = Staff("c'8 d'8 e'8 f'8")
abjad> componenttools.get_nth_namesake_from_component(t[1], 0)
Note("d'8")

Return component or none.

This Page