§
    ƒØj˜  ã                  óö   — d Z ddlmZ ddlZddlmZ ddlmZ  G d„ dej        e¦  «        Z	 G d„ d	ej        ej
        ¦  «        Z G d
„ dej        ¦  «        Ze	efZedk    rddlZ ej        e¦  «         dS dS )a  
Editorial objects store comments and other metadata associated with specific
:class:`~music21.base.Music21Object` elements such as Notes.

Some aspects of :class:`~music21.editorial.Editorial` objects
represent very early (pre-v0.1) versions of music21.  Thus, some
pre-defined aspects might be removed from documentation in the future.

Access an editorial object by calling `.editorial` on any music21 object:

>>> c = clef.TrebleClef()
>>> ed = c.editorial
>>> ed
<music21.editorial.Editorial {}>

The object is lazily created on first access.
To see if there is any existing editorial information without creating
the object, call `.hasEditorialInformation`

>>> n = note.Note('C#4')
>>> n.hasEditorialInformation
False

>>> n.editorial.unedited = True
>>> n.hasEditorialInformation
True
é    )ÚannotationsN)Úprebase)Ústylec                  óN   — e Zd ZU dZddddddœZded	<   d
ZdZd„ Zd„ Z	d„ Z
d„ ZdS )Ú	EditorialaI  
    Editorial comments and special effects that can be applied to music21 objects.

    >>> ed1 = editorial.Editorial()
    >>> ed1.backgroundHighlight = 'yellow'  # non-standard.
    >>> ed1.backgroundHighlight
    'yellow'
    >>> list(ed1.keys())
    ['backgroundHighlight']
    >>> ed1
     <music21.editorial.Editorial {'backgroundHighlight': 'yellow'}>

    Every GeneralNote object already has a NoteEditorial object attached to it
    at object.editorial.  Normally you will just change that object instead.

    For instance, take the case where a scribe wrote F in the score, knowing
    that a good singer would automatically sing F-sharp instead.  We can store
    the editorial suggestion to sing F-sharp as a "musica ficta" accidental
    object:

    >>> fictaSharp = pitch.Accidental('sharp')
    >>> n = note.Note('F')
    >>> n.editorial.ficta = fictaSharp
    >>> assert(n.editorial.ficta.alter == 1.0) #_DOCS_HIDE
    >>> #_DOCS_SHOW n.show('lily.png')  # only Lilypond currently supports musica ficta

    .. image:: images/noteEditorialFictaSharp.*
        :width: 103

    z‰
            a list of :class:`~music21.editorial.Comment` objects that represent any comments
            about the object.
            z±
            a list of :class:`~music21.editorial.Comment` objects that represent annotations
            for the object.  These have specific meanings in MusicXML.
            zÓa :class:`~music21.pitch.Accidental` object that specifies musica
            ficta for the note.  Will only be displayed in LilyPond and then only if
            there is no Accidental object on the note itselfzÐan :class:`~music21.interval.Interval` object that specifies
            the harmonic interval between this object and a single other object, or None
            (useful for storing information post analysis)z�an :class:`~music21.interval.Interval` object that specifies
            the melodic interval to the next object in this Part/Voice/Stream, etc.)ÚcommentsÚ	footnotesÚfictaÚharmonicIntervalÚmelodicIntervalzdict[str, str]Ú	_DOC_ATTR)r	   r   )r
   r   r   c                ó6   — t                                | ¦  «        S ©N)ÚdictÚ__repr__©Úselfs    ú†/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/music21/editorial.pyÚ_reprInternalzEditorial._reprInternald   s   € Ý�}Š}˜TÑ"Ô"Ð"ó    c                ó–   — || v r| |         S || j         v rg | |<   | |         S || j        v rd | |<   | |         S t          d|› �¦  «        ‚)Nz%Editorial does not have an attribute )ÚpredefinedListsÚpredefinedNonesÚAttributeError©r   Únames     r   Ú__getattr__zEditorial.__getattr__h   sn   € Ø�4ˆ<ˆ<Ø˜”:ÐØ�TÔ)Ð)Ð)ØˆD�‰JØ˜”:ÐØ�TÔ)Ð)Ð)ØˆD�‰JØ˜”:Ðå Ð!OÈÐ!OÐ!OÑPÔPÐPr   c                ó   — || |<   d S r   © )r   r   Úvalues      r   Ú__setattr__zEditorial.__setattr__t   s   € ØˆˆT‰
ˆ
ˆ
r   c                ó8   — || v r| |= d S t          d|z   ¦  «        ‚)NzNo such attribute: )r   r   s     r   Ú__delattr__zEditorial.__delattr__w   s*   € Ø�4ˆ<ˆ<Ø�T�
�
�
å Ð!6¸Ñ!=Ñ>Ô>Ð>r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   r   r!   r#   r   r   r   r   r   .   s¦   € € € € € € ðð ð>ðð@ð>ðWð!ð !€Ið ð ð ñ ð( 0€OØF€Oð#ð #ð #ð
Qð 
Qð 
Qðð ð ð?ð ?ð ?ð ?ð ?r   r   c                  ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚCommenta·  
    A comment or footnote or something else attached to a note.

    >>> c = editorial.Comment('presented as C natural in the 1660 print.')
    >>> c
    <music21.editorial.Comment 'presented as C na...'>

    Note that the text is truncated in representation, but it is all there in `.text`:

    >>> c.text
    'presented as C natural in the 1660 print.'

    >>> c.isFootnote = True
    >>> c.levelInformation = 'musicological'

    >>> n = note.Note('C#4')
    >>> n.editorial.footnotes.append(c)
    >>> n.editorial.footnotes[0]
    <music21.editorial.Comment 'presented as C na...'>

    Comments have style information:

    >>> c.style.color = 'red'
    >>> c.style.color
    'red'
    Nc                ó€   •— t          ¦   «                              ¦   «          || _        d| _        d| _        d | _        d S )NF)ÚsuperÚ__init__ÚtextÚ
isFootnoteÚisReferenceÚlevelInformation)r   r.   Ú	__class__s     €r   r-   zComment.__init__š   s=   ø€ Ý‰Œ×ÒÑÔÐØˆŒ	ØˆŒØ ˆÔØ $ˆÔÐÐr   c                óª   — | j         €dS t          | j         ¦  «        dk     rt          | j         ¦  «        S t          | j         d d…         dz   ¦  «        S )NÚ é   é   z...)r.   ÚlenÚreprr   s    r   r   zComment._reprInternal¡   sM   € ØŒ9ÐØ�2åˆtŒy‰>Œ>˜BÒÐÝ˜œ	‘?”?Ð"å˜œ	 # 2 #œ¨Ñ.Ñ/Ô/Ð/r   r   )r$   r%   r&   r'   r-   r   Ú__classcell__)r2   s   @r   r*   r*      sV   ø€ € € € € ðð ð4%ð %ð %ð %ð %ð %ð0ð 0ð 0ð 0ð 0ð 0ð 0r   r*   c                  ó   — e Zd Zd„ ZdS )ÚTestc                óB   — ddl m}  || t          ¦   «         ¦  «         d S )Nr   )ÚtestCopyAll)Úmusic21.test.commonTestr=   Úglobals)r   r=   s     r   ÚtestCopyAndDeepcopyzTest.testCopyAndDeepcopy¯   s0   € Ø7Ð7Ð7Ð7Ð7Ð7Øˆ�D�'™)œ)Ñ$Ô$Ð$Ð$Ð$r   N)r$   r%   r&   r@   r   r   r   r;   r;   ­   s#   € € € € € ð%ð %ð %ð %ð %r   r;   Ú__main__)r'   Ú
__future__r   ÚunittestÚmusic21r   r   ÚProtoM21Objectr   r   Ú
StyleMixinr*   ÚTestCaser;   Ú
_DOC_ORDERr$   ÚmainTestr   r   r   ú<module>rJ      s0  ððð ð6 #Ð "Ð "Ð "Ð "Ð "à €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ðM?ð M?ð M?ð M?ð M?�Ô&¨ñ M?ô M?ð M?ðb)0ð )0ð )0ð )0ð )0ˆgÔ$ eÔ&6ñ )0ô )0ð )0ð\%ð %ð %ð %ð %ˆ8Ôñ %ô %ð %ð Øð€
ð
 ˆzÒÐð €N€N€NØ€GÔ�TÑÔÐÐÐð	 Ðr   