marktools.get_value_of_annotation_attached_to_component

abjad.tools.marktools.get_value_of_annotation_attached_to_component.get_value_of_annotation_attached_to_component(component, name, default_value=None)[source]

New in version 2.0.

Get value of annotation with name attached to component:

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

Return arbitrary value of annotation.

Return default_value when no annotation with name is attached.

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

This Page