
    rh                       S r SSKJr  SSKrSSKJr  SSKJr   " S S\R                  \5      r	 " S S	\R                  \R                  5      r " S
 S\R                  5      r\	\4r\S:X  a  SSKr\R                   " \5        gg)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                  T    \ rS rSr% SrSSSSSS.rS	\S
'   SrSrS r	S r
S rS rSrg)	Editorial/   a  
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.
            za :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 itselfzan :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)zan :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                ,    [         R                  U 5      $ N)dict__repr__selfs    K/home/james-whalen/.local/lib/python3.13/site-packages/music21/editorial.py_reprInternalEditorial._reprInternale   s    }}T""    c                    X;   a  X   $ XR                   ;   a  / X'   X   $ XR                  ;   a  S X'   X   $ [        SU 35      e)Nz%Editorial does not have an attribute )predefinedListspredefinedNonesAttributeErrorr   names     r   __getattr__Editorial.__getattr__i   sX    <:)))DJ:)))DJ: #H!OPPr   c                    X U'   g r    )r   r   values      r   __setattr__Editorial.__setattr__u   s	    T
r   c                .    X;   a  X	 g [        SU-   5      e)NzNo such attribute: )r   r   s     r   __delattr__Editorial.__delattr__x   s    <
 !6!=>>r   r"   N)__name__
__module____qualname____firstlineno____doc__r   __annotations__r   r   r   r   r$   r'   __static_attributes__r"   r   r   r   r   /   sQ    >@>W!I~ ( 0OFO#
Q?r   r   c                  6   ^  \ rS rSrSrSU 4S jjrS rSrU =r$ )Comment   ao  
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'
c                X   > [         TU ]  5         Xl        SU l        SU l        S U l        g )NF)super__init__text
isFootnoteisReferencelevelInformation)r   r6   	__class__s     r   r5   Comment.__init__   s*    	  $r   c                    U R                   c  g[        U R                   5      S:  a  [        U R                   5      $ [        U R                   S S S-   5      $ )N       z...)r6   lenreprr   s    r   r   Comment._reprInternal   sG    99tyy>B		?"		#2.//r   )r7   r8   r9   r6   r   )	r)   r*   r+   r,   r-   r5   r   r/   __classcell__)r:   s   @r   r1   r1      s    4%0 0r   r1   c                      \ rS rSrS rSrg)Test   c                2    SSK Jn  U" U [        5       5        g )Nr   )testCopyAll)music21.test.commonTestrH   globals)r   rH   s     r   testCopyAndDeepcopyTest.testCopyAndDeepcopy   s    7D')$r   r"   N)r)   r*   r+   r,   rK   r/   r"   r   r   rE   rE      s    %r   rE   __main__)r-   
__future__r   unittestmusic21r   r   ProtoM21Objectr   r   
StyleMixinr1   TestCaserE   
_DOC_ORDERr)   mainTestr"   r   r   <module>rV      s   6 #   M?&& M?b)0g$$e&6&6 )0\%8 % 

 z T	 r   