marktools.get_annotation_attached_to_component

abjad.tools.marktools.get_annotation_attached_to_component.get_annotation_attached_to_component(component)[source]

New in version 2.0.

Get exactly one annotation attached to component:

abjad> staff = Staff("c'8 d'8 e'8 f'8")
abjad> marktools.Annotation('special information')(staff[0])
Annotation('special information')(c'8)
abjad> f(staff)
\new Staff {
    c'8
    d'8
    e'8
    f'8
}
abjad> marktools.get_annotation_attached_to_component(staff[0])
Annotation('special information')(c'8)

Return one annotation.

Raise missing mark error when no annotation is attached.

Raise extra mark error when more than one annotation is attached.

This Page