§
    ƒØjgt ã                  ó¾  — U d Z ddlmZ ddlmZmZ ddlZddlZddlZ	ddl
Z
ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z! ddlm"Z" ddl#m$Z$ ddl%m&Z& ej'        Z' ej(        d¦  «        Z) G d„ dej*        ¦  «        Z+ G d„ dej,        ¦  «        Z-d Z.d Z/d Z0d!Z1d"Z2dZ3d#Z4d$Z5d%Z6d&Z7d Z8ej9        e-j:        e.fej;        e-j:        e/fej<        e-j:        e0fej=        e-j:        e1fej>        e-j:        e2fej?        e-j@        e3fejA        e-jB        e4fejC        e-jB        e5fejD        e-jE        e6fejF        e-jG        e7fejH        e-jI        e8fgZJd'eKd(<   e-jB        d)e-jE        d*e-jG        d+e-jL        d,e-jI        d-e-j:        d.e-jM        d/e-j@        d0iZNd1eKd2<   ejO        ejP        ejQ        ejR        gZSd3eKd4<    G d5„ d6e	jT        ¦  «        ZUddd7œZVd6eKd8<   d9„ ZWd&ZXd:ZY ed;g d<¢¦  «        ZZ G d=„ d>e	j[        ¦  «        Z\ G d?„ d@e¦  «        Z] G dA„ dBe"j^        ¦  «        Z_ G dC„ dDe_e"j`        ¦  «        ZaddEdddFddGdEddEddGdEdGdEdHœd`dK„ZbdEdGddLœd`dM„ZcddFdNœdadQ„ZddbdU„ZedV„ ZfdcdY„ZgdZ„ Zhddd[„Zided\„Zj G d]„ d^e
jk        ¦  «        Zlemd_k    rddlZ ejn        el¦  «         dS dS )fa�  
Inner classes and functions for transcribing musical segments into braille.

This module was made in consultation with the manual "Introduction to Braille
Music Transcription, Second Edition" by Mary Turner De Garmo, 2005. It is
available from the Library of Congress
`here <https://www.loc.gov/nls/services-and-resources/music-service-and-materials/>`_,
and will henceforth be referred to as BMTM.
é    )Úannotations)ÚdequeÚ
namedtupleN)Úbar)Úbase)Úchord)Úclef)Údynamics)Úenvironment)Úexceptions21)Úexpressions©Úkey)Úlayout)Úmeter)Únote)Úspanner)Ústream)Útempo)ÚProtoM21Object)Úbasic)Úlookup)ÚnoteGrouping)Útext)ÚBrailleTranscriptionHelper)ÚopFracz
segment.pyc                  ó   — e Zd ZdS )ÚBrailleSegmentExceptionN)Ú__name__Ú
__module__Ú__qualname__© ó    úŒ/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/music21/braille/segment.pyr   r   :   s   € € € € € Ø€Dr#   r   c                  ó2   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
S )ÚAffinityéÿÿÿÿé   é   é   é   é   é   é	   é
   N)r   r    r!   Ú_LOWESTÚ	SIGNATUREÚTTEXTÚMMARKÚLONG_TEXTEXPRÚINACCORDÚSPLIT1_NOTEGROUPÚ	NOTEGROUPÚSPLIT2_NOTEGROUPr"   r#   r$   r&   r&   >   s?   € € € € € Ø€GØ€IØ€EØ€EØ€MØ€HàÐØ€IØÐÐÐr#   r&   r/   r.   r,   é   é   r(   r)   z4list[tuple[type[base.Music21Object], Affinity, int]]ÚaffinityCodeszSignature GroupingzTempo Text GroupingzMetronome Mark GroupingzLong Text Expression GroupingzInaccord GroupingzNote GroupingzSplit Note Grouping AzSplit Note Grouping Bzdict[Affinity, str]ÚaffinityNameszlist[type[base.Music21Object]]ÚexcludeFromBrailleElementsc                  ó$   — e Zd ZU ded<   ded<   dS )ÚGroupingGlobalszkey.KeySignature | NoneÚkeySignaturezmeter.TimeSignature | NoneÚtimeSignatureN)r   r    r!   Ú__annotations__r"   r#   r$   r?   r?   y   s*   € € € € € € Ø'Ð'Ð'Ñ'Ø+Ð+Ð+Ñ+Ð+Ð+r#   r?   )r@   rA   ÚGROUPING_GLOBALSc                 ó®   — t           d         €t          j        d¦  «        t           d<   t           d         €t          j        d¦  «        t           d<   dS dS )z–
    sets defaults for grouping globals.  Called first time anything
    in Braille is run, but saves creating two expensive objects if never run
    r@   Nr   rA   ú4/4)rC   r   ÚKeySignaturer   ÚTimeSignaturer"   r#   r$   ÚsetGroupingGlobalsrH   „   sT   € õ
 ˜Ô'Ð/Ý+.Ô+;¸AÑ+>Ô+>Õ˜Ñ(Ý˜Ô(Ð0Ý,1Ô,?ÀÑ,FÔ,FÕ˜Ñ)Ð)Ð)ð 1Ð0r#   é0   Ú_ThreeDigitNumber)ÚhundredsÚtensÚonesc                  óH   — e Zd ZU dZded<   dZded<   dZded<   dZded	<   dS )
Ú
SegmentKeyr   ÚintÚmeasureÚordinalNzAffinity | NoneÚaffinityz
str | NoneÚhand)r   r    r!   rQ   rB   rR   rS   rT   r"   r#   r$   rO   rO   •   sV   € € € € € € Ø€GÐÐÐÑØ€GÐÐÐÑØ"€HÐ"Ð"Ð"Ñ"Ø€DÐÐÐÑÐÐr#   rO   c                  ób   — e Zd ZU dZdddddddœZd	ed
<   d„ Zd„ Zd„ Zd„ Z	d„ Z
d„ Zdd„Zd„ ZdS )ÚBrailleElementGroupinga  
    A BrailleElementGrouping mimics a list of objects which should be displayed
    without a space in braille.

    >>> from music21.braille import segment
    >>> bg = segment.BrailleElementGrouping()
    >>> bg.append(note.Note('C4'))
    >>> bg.append(note.Note('D4'))
    >>> bg.append(note.Rest())
    >>> bg.append(note.Note('F4'))
    >>> bg
    <music21.braille.segment.BrailleElementGrouping [<music21.note.Note C>,
        <music21.note.Note D>, <music21.note.Rest quarter>, <music21.note.Note F>]>
    >>> print(bg)
    <music21.note.Note C>
    <music21.note.Note D>
    <music21.note.Rest quarter>
    <music21.note.Note F>

    These are the defaults, and they are shared across all objects.

    >>> bg.keySignature
    <music21.key.KeySignature of no sharps or flats>
    >>> bg.timeSignature
    <music21.meter.TimeSignature 4/4>

    >>> bg.descendingChords
    True

    >>> bg.showClefSigns
    False

    >>> bg.upperFirstInNoteFingering
    True

    >>> bg.withHyphen
    False

    >>> bg.numRepeats
    0
    zCThe last :class:`~music21.key.KeySignature` preceding the grouping.zFThe last :class:`~music21.meter.TimeSignature` preceding the grouping.zŸTrue if a :class:`~music21.chord.Chord` should be spelled
             from highest to lowest pitch
             in braille, False if the opposite is the case.zèIf True, clef signs are shown in braille.
             Representation of music in braille is not
             dependent upon clefs and staves, so the clef signs would be displayed
             for referential or historical purposes.z4If True, this grouping will end with a music hyphen.z.The number of times this grouping is repeated.)r@   rA   ÚdescendingChordsÚshowClefSignsÚ
withHyphenÚ
numRepeatsúdict[str, str]Ú	_DOC_ATTRc                óÌ   — t          |Ž | _        t          ¦   «          t          d         | _        t          d         | _        d| _        d| _        d| _        d| _	        d| _
        d S )Nr@   rA   TFr   )ÚlistÚinternalListrH   rC   r@   rA   rW   rX   ÚupperFirstInNoteFingeringrY   rZ   )ÚselfÚlistElementss     r$   Ú__init__zBrailleElementGrouping.__init__Ö   s_   € Ý  ,Ð/ˆÔÝÑÔÐå,¨^Ô<ˆÔÝ-¨oÔ>ˆÔØ $ˆÔØ"ˆÔØ)-ˆÔ&ØˆŒØˆŒˆˆr#   c                ó*   — t          | j        ¦  «        S ©N)Úiterr_   ©ra   s    r$   Ú__iter__zBrailleElementGrouping.__iter__â   ó   € Ý�DÔ%Ñ&Ô&Ð&r#   c                ó   — | j         |         S re   ©r_   ©ra   Úitems     r$   Ú__getitem__z"BrailleElementGrouping.__getitem__å   s   € ØÔ  Ô&Ð&r#   c                ó   — || j         |<   d S re   rk   )ra   Úposrm   s      r$   Ú__setitem__z"BrailleElementGrouping.__setitem__è   s   € Ø!%ˆÔ˜#ÑÐÐr#   c                ó*   — t          | j        ¦  «        S re   )Úlenr_   rg   s    r$   Ú__len__zBrailleElementGrouping.__len__ë   s   € Ý�4Ô$Ñ%Ô%Ð%r#   c                óV   — |dk    rt          d¦  «        ‚t          | j        |¦  «        S )Nr_   zinternalList not defined yet)ÚAttributeErrorÚgetattrr_   )ra   Úattrs     r$   Ú__getattr__z"BrailleElementGrouping.__getattr__î   s/   € Ø�>Ò!Ð!Ý Ð!?Ñ@Ô@Ð@Ý�tÔ(¨$Ñ/Ô/Ð/r#   ÚreturnÚstrc                óN  — g }d}| D �]*}t          |t          j        ¦  «        rž|r(|                     dt          j        d         › �¦  «         |D ]n}	 |                     d                     |j        j        ¦  «        ¦  «         Œ6# t          t          f$ r% |                     t          |¦  «        ¦  «         Y Œkw xY wd}Œ»	 |                     d                     |j        j        ¦  «        ¦  «         n9# t          t          f$ r% |                     t          |¦  «        ¦  «         Y nw xY wd}�Œ,| j        dk    r!|                     d| j        dz   › d	�¦  «         | j        du r(|                     d
t          j        d         › �¦  «         d                     |¦  «        }|S )zo
        Return a unicode braille representation
        of each object in the BrailleElementGrouping.
        Fzfull inaccord Úfull_inaccordú
Tr   z** Grouping x r9   z **zmusic hyphen Úmusic_hyphen)Ú
isinstancer   ÚVoiceÚappendr   ÚsymbolsÚjoinÚ	editorialÚbrailleEnglishrv   Ú	TypeErrorr{   rZ   rY   )ra   Ú
allObjectsÚprevious_was_voiceÚobjÚobj2Úouts         r$   Ú__str__zBrailleElementGrouping.__str__ó   sÕ  € ð
 ˆ
Ø#(ÐØð 	+ñ 	+ˆCÝ˜#�vœ|Ñ,Ô,ð +Ø%ð ZØ×%Ò%Ð&Xµv´~ÀoÔ7VÐ&XÐ&XÑYÔYÐYØð 5ð 5�Dð5Ø"×)Ò)¨$¯)ª)°D´NÔ4QÑ*RÔ*RÑSÔSÐSÐSøÝ*­IÐ6ð 5ð 5ð 5Ø"×)Ò)­#¨d©)¬)Ñ4Ô4Ð4Ð4Ð4ð5øøøà%)Ð"Ð"ð0Ø×%Ò% d§i¢i°´Ô0LÑ&MÔ&MÑNÔNÐNÐNøÝ&­	Ð2ð 0ð 0ð 0Ø×%Ò%¥c¨#¡h¤hÑ/Ô/Ð/Ð/Ð/ð0øøøà%*Ð"Ñ"ØŒ?˜QÒÐØ×ÒÐG¨t¬ÀÑ/BÐGÐGÐGÑHÔHÐHØŒ?˜dÐ"Ð"Ø×ÒÐN­f¬n¸^Ô.LÐNÐNÑOÔOÐOØ�iŠi˜
Ñ#Ô#ˆØˆ
s$   Á2BÂ3B<Â;B<Ã2C6Ã63D,Ä+D,c                ó*   — t          | j        ¦  «        S re   )Úreprr_   rg   s    r$   Ú_reprInternalz$BrailleElementGrouping._reprInternal  ri   r#   N)rz   r{   )r   r    r!   Ú__doc__r\   rB   rc   rh   rn   rq   rt   ry   r�   r�   r"   r#   r$   rV   rV   ž   sÚ   € € € € € € ð(ð (ðT ^Øað?ð8ð
 MØFð!ð !€Ið ð ð ñ ð
ð 
ð 
ð'ð 'ð 'ð'ð 'ð 'ð&ð &ð &ð&ð &ð &ð0ð 0ð 0ð
ð ð ð ð<'ð 'ð 'ð 'ð 'r#   rV   c            
      ó   ‡ — e Zd ZU ddddddddd	d
œ	Zded<   d1d2ˆ fd„Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd„ Zed„ ¦   «         Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd3d!„Zd"„ Zd4d%„Zd5d'„Z	 	 d6d)„Zd3d*„Zd+„ Zd,„ Zd-„ Zd.„ Zd/„ Zd0„ Z ˆ xZ!S )7ÚBrailleSegmentzIf True, the previous key signature should be
                 cancelled immediately before a new key signature is encountered.záFor a given positive integer n, adds n "dummy rests"
                 near the beginning of a segment. Designed for test purposes, as they
                 are used to demonstrate measure division at the end of braille lines.zzThe maximum amount of braille characters that should be
                 present in a line. The standard is 40 characters.zwIf True, then a measure number is shown
                 following the heading (if applicable) and preceding the music.zsIf set to "right" or "left", shows the corresponding
                 hand sign at the beginning of the first line.z¢If True, then a braille heading is displayed.
                 See :meth:`~music21.braille.basic.transcribeHeading`
                 for more details on headings.z¨If True, then all octave marks are suppressed.
                 Designed for test purposes, as octave marks were not presented
                 until Chapter 7 of BMTM.a%  If True, then the last
                 :class:`~music21.braille.segment.BrailleElementGrouping` of this
                 segment will be followed by a music hyphen.
                 The last grouping is incomplete, because a segment
                 break occurred in the middle of a measure.z¬If True, then the initial measure number of this
                 segment should be followed by a dot. This segment
                 is starting in the middle of a measure.)	ÚcancelOutgoingKeySigÚdummyRestLengthÚ
lineLengthÚshowFirstMeasureNumberÚshowHandÚshowHeadingÚsuppressOctaveMarksÚ	endHyphenÚbeginsMidMeasurer[   r\   é(   r–   rP   c                óD  •— t          ¦   «                              |¬¦  «         i | _        t          ¦   «         | _        d| _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        dS )a¿  
        A segment is "a group of measures occupying more than one braille line."
        Music is divided into segments in order to "present the music to the reader
        in a meaningful manner and to give him convenient reference points to
        use in memorization" (BMTM, 71).

        >>> brailleSeg = braille.segment.BrailleSegment()

        >>> brailleSeg.cancelOutgoingKeySig
        True
        >>> brailleSeg.dummyRestLength

        >>> brailleSeg.lineLength
        40

        >>> brailleSeg.showFirstMeasureNumber
        True

        Possible showHand values are None, 'right', 'left':

        >>> brailleSeg.showHand is None
        True

        >>> brailleSeg.showHeading
        True

        >>> brailleSeg.suppressOctaveMarks
        False

        >>> brailleSeg.endHyphen
        False

        >>> brailleSeg.beginsMidMeasure
        False

        A BrailleSegment is a type of defaultdict that returns a BrailleElementGrouping
        when a key is missing.

        >>> len(brailleSeg.keys())
        0
        >>> beg = brailleSeg[braille.segment.SegmentKey(4, 1, 9)]
        >>> type(beg) is braille.segment.BrailleElementGrouping
        True

        Of course, creating random keys like this will have consequences:

        >>> print(str(brailleSeg))
        ---begin segment---
        <music21.braille.segment BrailleSegment>
        Measure 4, Note Grouping 2:
        <BLANKLINE>
        ===
        ---end segment---
        ©r–   NFT)Úsuperrc   Ú_groupingDictr   ÚgroupingKeysToProcessÚcurrentGroupingKeyÚpreviousGroupingKeyÚlastNoterX   r`   rW   r”   r•   r—   r˜   r™   rš   r›   rœ   )ra   r–   Ú	__class__s     €r$   rc   zBrailleSegment.__init__2  s¨   ø€ õn 	‰Œ×Ò JÐÑ/Ô/Ð/ØGIˆÔå8=¹¼ˆÔ"Ø37ˆÔØ48ˆÔ Ø(,ˆŒà#(ˆÔØ/3ˆÔ&Ø&*ˆÔà$(ˆÔ!Ø#ˆÔØ&*ˆÔ#ØˆŒØˆÔØ#(ˆÔ ØˆŒØ %ˆÔÐÐr#   c                ó   — || j         |<   d S re   ©r¡   )ra   rm   Úvalues      r$   rq   zBrailleSegment.__setitem__~  s   € Ø#(ˆÔ˜4Ñ Ð Ð r#   c                óZ   — || j         vrt          ¦   «         | j         |<   | j         |         S re   )r¡   rV   rl   s     r$   rn   zBrailleSegment.__getitem__�  s1   € Ø�tÔ)Ð)Ð)Ý'=Ñ'?Ô'?ˆDÔ˜tÑ$ØÔ! $Ô'Ð'r#   c                óN   — || j         vr
| j        |= d S t          d|›d�¦  «        S )NzNo item z in Segment)Ú__dict__r¡   Ú
ValueErrorrl   s     r$   Ú__delitem__zBrailleSegment.__delitem__†  s:   € Ø�t”}Ð$Ð$ØÔ" 4Ð(Ð(Ð(åÐ<¨Ð<Ð<Ð<Ñ=Ô=Ð=r#   c                ó,   — t          | j        |¦  «        S re   )rw   r¡   rl   s     r$   ry   zBrailleSegment.__getattr__Œ  s   € Ý�tÔ)¨4Ñ0Ô0Ð0r#   c                ó   — || j         v S re   r¨   rl   s     r$   Ú__contains__zBrailleSegment.__contains__�  s   € Ø�tÔ)Ð)Ð)r#   c                ó*   — t          | j        ¦  «        S re   )rf   r¡   rg   s    r$   rh   zBrailleSegment.__iter__’  s   € Ý�DÔ&Ñ'Ô'Ð'r#   c                ó*   — t          | j        ¦  «        S re   )rs   r¡   rg   s    r$   rt   zBrailleSegment.__len__•  s   € Ý�4Ô%Ñ&Ô&Ð&r#   c                ó@   — t           j                             | ¦  «        S )z@
        Returns the string from the BrailleText object
        )r   ÚBrailleTextr�   rg   s    r$   ÚbrailleTextzBrailleSegment.brailleText˜  s   € õ
 Ô×'Ò'¨Ñ-Ô-Ð-r#   c           
     ó$  — d}t          |                      ¦   «         ¦  «        }g }g }t          ¦   «         }|D ]‘\  }}	 |j        t          j        k    r|}Œn# t          $ r Y nw xY w|                     d|j        › dt          |j                 › d|j
        dz   › d�¦  «         t          |¦  «        }|                     |¦  «         |}Œ’d                     d„ t          ||¦  «        D ¦   «         ¦  «        }	d                     d	||	d
g¦  «        }
|
S )Nz(<music21.braille.segment BrailleSegment>úMeasure z, ú r9   ú:
r~   c              3  ó*   K  — | ]\  }}|› |› d �V — ŒdS )z
===Nr"   )Ú.0ÚkÚgs      r$   ú	<genexpr>z)BrailleSegment.__str__.<locals>.<genexpr>·  sD   è è € ð (
ð (
á��1ð ˆN�!ˆNˆNˆNð(
ð (
ð (
ð (
ð (
ð (
r#   z---begin segment---z---end segment---)ÚsortedÚitemsrO   rS   r&   r6   r‡   r‚   rQ   r<   rR   r{   r„   Úzip)ra   ÚnameÚallItemsÚallKeysÚallGroupingsÚprevKeyÚitemKeyÚgroupingÚgStrÚallElementGroupingsrŒ   s              r$   r�   zBrailleSegment.__str__Ÿ  so  € Ø9ˆå˜$Ÿ*š*™,œ,Ñ'Ô'ˆØˆØˆå‘,”,ˆà#+ð 	ð 	ÑˆW�hðØÔ#¥xÔ'@Ò@Ð@Ø%�GØð Aøõ ð ð ð Ø�ðøøøà�NŠNð,˜7œ?ð ,ð ,Ý  Ô!1Ô2ð,ð ,à”? QÑ&ð,ð ,ð ,ñô ð õ
 �x‘=”=ˆDØ×Ò Ñ%Ô%Ð%ØˆGˆGØ"Ÿišið (
ð (
å˜G \Ñ2Ô2ð(
ñ (
ô (
ñ 
ô 
Ðð �iŠiÐ.ØØ,Ø,ð.ñ /ô /ˆð ˆ
s   ¾AÁ
A$Á#A$c                ó  — t          t          |                      ¦   «         ¦  «        ¦  «        | _        | j        r|                      ¦   «          | j        r|                      ¦   «          | j        �|  	                    ¦   «          d| _
        | j        rõ| j                             ¦   «         | _        | j        j        }|t          j        k    r|                      ¦   «          n“|t          j        k    r|                      ¦   «          nn|t          j        k    r|                      ¦   «          nI|t          j        k    r|                      ¦   «          n$|t          j        k    r|                      ¦   «          | j        | _
        | j        °õ| j        S )a-  
        Transcribes all noteGroupings in this dict by:

        *    First transcribes the Heading (if applicable)
        *    then the Measure Number
        *    then adds appropriate numbers of dummyRests
        *    then adds the Rest of the Note Groupings

        Returns brailleText
        N)r   rÀ   Úkeysr¢   r™   ÚextractHeadingr—   ÚextractMeasureNumberr•   ÚaddDummyRestsr¤   Úpopleftr£   rS   r&   r7   ÚextractNoteGroupingr1   ÚextractSignatureGroupingr4   ÚextractLongExpressionGroupingr5   ÚextractInaccordGroupingr2   ÚextractTempoTextGroupingr¶   )ra   ÚcgkAffinityGroups     r$   Ú
transcribezBrailleSegment.transcribeÁ  s}  € õ &+­6°$·)²)±+´+Ñ+>Ô+>Ñ%?Ô%?ˆÔ"àÔð 	"Ø×ÒÑ!Ô!Ð!àÔ&ð 	(Ø×%Ò%Ñ'Ô'Ð'àÔÐ+Ø×ÒÑ Ô Ð à#'ˆÔ ØÔ(ð 	?Ø&*Ô&@×&HÒ&HÑ&JÔ&JˆDÔ#à#Ô6Ô?Ðà¥8Ô#5Ò5Ð5Ø×(Ò(Ñ*Ô*Ð*Ð*Ø!¥XÔ%7Ò7Ð7Ø×-Ò-Ñ/Ô/Ð/Ð/Ø!¥XÔ%;Ò;Ð;Ø×2Ò2Ñ4Ô4Ð4Ð4Ø!¥XÔ%6Ò6Ð6Ø×,Ò,Ñ.Ô.Ð.Ð.Ø!¥X¤^Ò3Ð3Ø×-Ò-Ñ/Ô/Ð/Ø'+Ô'>ˆDÔ$ð Ô(ð 	?ð" ÔÐr#   c                ón   — |D ]1}t           j        D ]"}t          ||¦  «        rt          ||¦  «         Œ#Œ2dS )z°
        Removes temporary attributes from Music21Objects set during transcription.
        Run this only AFTER any possible re-transcription in extractNoteGrouping().
        N)r   ÚTEMPORARY_ATTRIBUTESÚhasattrÚdelattr)ra   r   ÚelÚkws       r$   Ú_cleanupAttributesz!BrailleSegment._cleanupAttributesë  sR   € ð
 ð 	$ð 	$ˆBÝÔ0ð $ð $�Ý˜2˜r‘?”?ð $Ý˜B ‘O”O�Oøð$ð	$ð 	$r#   c                óŒ   — | j         t          j        d         z  g}|                      d                     |¦  «        ¦  «         dS )uY  
        Adds as many dummy rests as self.dummyRestLength to the signatures of
        brailleText

        >>> seg = braille.segment.BrailleSegment()
        >>> seg.dummyRestLength = 4

        >>> print(braille.lookup.rests['dummy'])
        â „
        >>> seg.addDummyRests()
        >>> print(seg.brailleText)
        â „â „â „â „
        ÚdummyÚ N)r•   r   ÚrestsÚaddSignaturesr„   )ra   Ú
dummyRestss     r$   rÐ   zBrailleSegment.addDummyRestsõ  sA   € ð Ô*­V¬\¸'Ô-BÑBÐCˆ
Ø×Ò˜2Ÿ7š7 :Ñ.Ô.Ñ/Ô/Ð/Ð/Ð/r#   c                ó  — | j         p-t          t          |                      ¦   «         ¦  «        ¦  «        }|d         }|j        }t          j        |¦  «        }| j        r|t          d         z  }|  	                    |¦  «         dS )u  
        Adds a measure number from the segmentKey needing processing

        >>> segKey = braille.segment.SegmentKey(measure=4, ordinal=1, affinity=9)
        >>> seg = braille.segment.BrailleSegment()

        Initialize a new Key

        >>> type(seg[segKey])
        <class 'music21.braille.segment.BrailleElementGrouping'>
        >>> seg.extractMeasureNumber()
        >>> print(seg.brailleText)
        â ¼â ™

        Add a dot to the measure number if the segment begins mid-measure

        >>> seg = braille.segment.BrailleSegment()
        >>> seg[segKey]
        <music21.braille.segment.BrailleElementGrouping []>

        >>> seg.beginsMidMeasure = True
        >>> seg.extractMeasureNumber()
        >>> print(seg.brailleText)
        â ¼â ™â „
        r   ÚdotN)
r¢   r   rÀ   rÍ   rQ   r   ÚnumberToBraillerœ   rƒ   ÚaddMeasureNumber)ra   ÚgkpÚfirstSegmentKeyÚinitMeasureNumberÚbrailleNumbers        r$   rÏ   z#BrailleSegment.extractMeasureNumber  s   € ð4 Ô(ÐF­Eµ&¸¿º¹¼Ñ2EÔ2EÑ,FÔ,FˆØ˜aœ&ˆØ+Ô3ÐÝÔ-Ð.?Ñ@Ô@ˆØÔ ð 	,Ø�W Uœ^Ñ+ˆMà×Ò˜mÑ,Ô,Ð,Ð,Ð,r#   c                óú  — d}d}d}d}| j         p-t          t          |                      ¦   «         ¦  «        ¦  «        }|ró|d         j        t
          j        k    rn×|                     ¦   «         }|j        }| j         	                    |¦  «        }|t
          j
        k    r_t          |¦  «        dk    r|d         |d         }}nlt          |¦  «        dk    r'|d         }	t          |	t          j        ¦  «        r|	}n4|	}n1|t
          j        k    r	|d         }n|t
          j        k    r|d         }|°ót!          ||||g¦  «        r5t#          j        ||||| j        ¬¦  «        }
|                      |
¦  «         dS dS )a  
        Extract a :class:`~music21.key.KeySignature`, :class:`~music21.meter.TimeSignature,
        :class:`~music21.tempo.TempoText` and :class:`~music21.tempo.MetronomeMark` and
        add an appropriate braille heading to the brailleText object inputted.
        Nr   r:   r9   ©ÚmaxLineLength)r¢   r   rÀ   rÍ   rS   r&   r3   rÑ   r¡   Úgetr1   rs   r€   r   rF   r2   Úanyr   ÚtranscribeHeadingr–   Ú
addHeading)ra   r@   rA   Ú	tempoTextÚmetronomeMarkr¢   Úcgkr×   ÚcurrentBrailleGroupingÚkeyOrTimeSigÚbrailleHeadings              r$   rÎ   zBrailleSegment.extractHeading)  s¬  € ð ˆØˆØˆ	Øˆð !%Ô :Ð X½eÅFÈ4Ï9Ê9É;Ì;ÑDWÔDWÑ>XÔ>XÐà#ð 	:Ø$ QÔ'Ô0µ8´>ÒAÐAØØ'×/Ò/Ñ1Ô1ˆCà"œ|ÐØ%)Ô%7×%;Ò%;¸CÑ%@Ô%@Ð"à¥8Ô#5Ò5Ð5ÝÐ-Ñ.Ô.°!Ò3Ð3Ø3IÈ!Ô3LØ3IÈ!Ô3Lð #0�L�LåÐ/Ñ0Ô0°AÒ5Ð5Ø#9¸!Ô#<�LÝ! ,µÔ0@ÑAÔAð 5Ø'3˜˜à(4˜øØ!¥X¤^Ò3Ð3Ø2°1Ô5�	�	Ø!¥X¤^Ò3Ð3Ø 6°qÔ 9�ð+ $ð 	:õ. �˜m¨Y¸ÐFÑGÔGð 	,Ý"Ô4ØØØØØ"œoðñ ô ˆNð �OŠO˜NÑ+Ô+Ð+Ð+Ð+ð	,ð 	,r#   rz   ÚNonec                ó(  — | j         €t          d¦  «        ‚| j        | j                  }d }d}|D ]â}t          |t          j        ¦  «        r|}Œt          |t          j        ¦  «        st           	                    |› d�¦  «         t          |¦  «        }|r|                     d|¦  «         d }|j        |_        |j        |_        |j        |_        |rt          d         nd}|t!          j        |¦  «        z  }|                      |¦  «         d}Œãd S )NzCcurrentGroupingKey must not be None to call extractInaccordGroupingFz' is neither a voice nor clef; ignoring!r   r}   râ   T)r£   r­   r¡   r€   r	   ÚClefr   r�   ÚenvironRulesÚwarnÚextractBrailleElementsÚinsertrW   rX   r`   rƒ   ÚngModÚtranscribeNoteGroupingÚaddInaccord)ra   Ú	inaccordsÚ	last_clefÚ
seen_voiceÚmusic21VoiceOrClefr   ÚbrailleInaccords          r$   rÕ   z&BrailleSegment.extractInaccordGroupingY  s5  € ØÔ"Ð*ÝÐbÑcÔcÐcØÔ& tÔ'>Ô?ˆ	Ø$(ˆ	Ø ˆ
Ø"+ð 	ð 	ÐÝÐ,­d¬iÑ8Ô8ð Ø.�	ØÝÐ0µ&´,Ñ?Ô?ð bÝ×!Ò!Ð%7Ð"`Ð"`Ð"`ÑaÔaÐaÝ1Ð2DÑEÔEˆLØð !Ø×#Ò# A yÑ1Ô1Ð1Ø �	Ø,5Ô,FˆLÔ)Ø)2Ô)@ˆLÔ&Ø5>Ô5XˆLÔ2Ø:DÐL�g oÔ6Ð6È"ˆOØ�uÔ;¸LÑIÔIÑIˆOØ×Ò˜_Ñ-Ô-Ð-ØˆJˆJð!	ð 	r#   c                óª   — | j         }| j                             |¦  «        }|d         }t          j        |¦  «        }|                      |¦  «         dS )zv
        Extract the Long Expression that is in the ElementGrouping in cgk
        and add it to brailleText.
        r   N)r£   r¡   rñ   r   ÚtextExpressionToBrailleÚaddLongExpression)ra   r÷   ÚcurrentElementGroupingÚlongTextExpressionÚlongExprInBrailles        r$   rÔ   z,BrailleSegment.extractLongExpressionGroupingr  s[   € ð
 Ô%ˆØ!%Ô!3×!7Ò!7¸Ñ!<Ô!<ÐØ3°AÔ6ÐÝ!Ô9Ð:LÑMÔMÐØ×ÒÐ0Ñ1Ô1Ð1Ð1Ð1r#   r   rV   c                ó�  — | j         }| j        }|�f|�d|j        t          j        k    sH|j        t          j        k    s3|j        |j        k    r*|j        |j        dz   k    r|j        |j        k    rd| _        | j	        rdS d„ |D ¦   «         }d}|r6| j        �"|d         }t          j        | j        |¦  «        }|d         | _        |S )aÕ  
        Given a noteGrouping, should we show the octave symbol?

        >>> n1 = note.Note('C1')
        >>> n2 = note.Note('D1')
        >>> n3 = note.Note('E1')

        >>> beg1 = braille.segment.BrailleElementGrouping([n1, n2, n3])
        >>> bs1 = braille.segment.BrailleSegment()

        This is True because last note is None

        >>> bs1.lastNote is None
        True
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg1)
        True

        But if we run it again, now we have a note within a fourth, so we do not
        need to show the octave:

        >>> bs1.lastNote
        <music21.note.Note E>
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg1)
        False

        And that is true no matter how many times we call it on the same
        BrailleElementGrouping:

        >>> bs1.showLeadingOctaveFromNoteGrouping(beg1)
        False

        But if we give a new, much higher BrailleElementGrouping, we
        will see octave marks again.

        >>> nHigh1 = note.Note('C6')
        >>> nHigh2 = note.Note('D6')
        >>> beg2 = braille.segment.BrailleElementGrouping([nHigh1, nHigh2])
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg2)
        True

        But if we set `self.suppressOctaveMarks` to True, we won't see any
        when we switch back to beg1:

        >>> bs1.suppressOctaveMarks = True
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg2)
        False

        We also show octaves if for some reason two noteGroups in the same measure have
        different BrailleElementGroupings keyed to consecutive ordinals.  The code simulates
        that situation.

        >>> bs1.suppressOctaveMarks = False
        >>> bs1.previousGroupingKey = braille.segment.SegmentKey(measure=3, ordinal=1,
        ...                                          affinity=braille.segment.Affinity.NOTEGROUP)
        >>> bs1.currentGroupingKey = braille.segment.SegmentKey(measure=3, ordinal=2,
        ...                                          affinity=braille.segment.Affinity.NOTEGROUP)
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg2)
        True
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg1)
        True
        >>> bs1.showLeadingOctaveFromNoteGrouping(beg1)
        True

        Nr9   Fc                óF   — g | ]}t          |t          j        ¦  «        ¯|‘ŒS r"   ©r€   r   ÚNote©r¼   Úns     r$   ú
<listcomp>zDBrailleSegment.showLeadingOctaveFromNoteGrouping.<locals>.<listcomp>Ò  s)   € ÐHÐHÐH˜!­z¸!½T¼YÑ/GÔ/GÐH�AÐHÐHÐHr#   Tr   r'   )r£   r¤   rS   r&   r7   rQ   rR   rT   r¥   rš   r   ÚshowOctaveWithNote)ra   r   Ú
currentKeyÚpreviousKeyÚallNotesÚshowLeadingOctaveÚ	firstNotes          r$   Ú!showLeadingOctaveFromNoteGroupingz0BrailleSegment.showLeadingOctaveFromNoteGrouping}  sî   € ðB Ô,ˆ
ØÔ.ˆð Ð#ØÐ*ØÔ$­Ô(:Ò:Ð:ØÔ&­(Ô*<Ò<Ð<ØÔ&¨+Ô*=Ò=Ð=Ø"Ô*¨kÔ.AÀAÑ.EÒEÐEØ"œ¨;Ô+;Ò;Ð;Ø $�”àÔ#ð 	Ø�5ð IÐH˜|ÐHÑHÔHˆØ ÐØð 	)ØŒ}Ð(Ø$ QœK�	Ý$)Ô$<¸T¼]ÈIÑ$VÔ$VÐ!à$ RœLˆDŒMà Ð r#   Úboolc                óx   — | j         dz  }| j         | j        j        z
  }||k    rt          |¦  «        |k    rdS dS )an  
        Returns boolean on whether a note grouping needs to be split in order to fit.

        Generally a noteGrouping will need to be split if the amount of space left
        is more than 1/4 of the line length and the brailleNoteGrouping cannot fit.

        >>> n1 = note.Note('C1')
        >>> n2 = note.Note('D1')
        >>> n3 = note.Note('E1')

        >>> beg1 = braille.segment.BrailleElementGrouping([n1, n2, n3])
        >>> seg = braille.segment.BrailleSegment()
        >>> seg.needsSplitToFit(beg1)
        False
        >>> seg.lineLength = 10
        >>> seg.needsSplitToFit(beg1)
        True
        r)   TF)r–   ÚcurrentLineÚtextLocationrs   )ra   ÚbrailleNoteGroupingÚquarterLineLengthÚ	spaceLefts       r$   ÚneedsSplitToFitzBrailleSegment.needsSplitToFitÝ  sN   € ð& !œO¨qÑ0ÐØ”O dÔ&6Ô&CÑCˆ	ØÐ)Ò)Ð)ÝÐ+Ñ,Ô,Ð/@Ò@Ð@Ø�4à�5r#   Fc                óð  — t          j        ¦   «         }d}d}d\  }}d}	||k     rZt          ||¬¦  «        \  }}||_        d|_        |                     |¦  «        }	| j                             |	|¬¦  «        rn|dz  }Œ`| j         }
|
|_        |                     |¦  «        }| j	        }| 
                    t          j        ¬	¦  «        }| 
                    t          j        ¬	¦  «        }|| |<   || |<   |	|fS )
z€
        Take a noteGrouping and split it at a logical place,
        returning braille transcriptions of each section.
        r   r/   ©NNN)ÚbeatDivisionOffsetT©ÚaddSpacer9   ©rS   )r  ÚNoteGroupingTranscriberÚsplitNoteGroupingr  rY   ÚtranscribeGroupr   Ú	canAppendrš   r£   Ú_replacer&   r6   r8   )ra   r   ÚshowLeadingOctaveOnFirstÚaddSpaceToFirstÚtranscriberr(  ÚREASONABLE_LIMITÚsplitNoteGroupAÚsplitNoteGroupBÚbrailleNoteGroupingAr  ÚbrailleNoteGroupingBr  ÚaKeyÚbKeys                  r$   ÚsplitNoteGroupingAndTranscribez-BrailleSegment.splitNoteGroupingAndTranscribeø  s2  € õ Ô3Ñ5Ô5ˆàÐØÐØ-9Ñ*ˆ˜/Ø#Ðà Ð#3Ò3Ð3Ý1BØØ#5ð2ñ 2ô 2Ñ.ˆ_˜oð -EˆKÔ)Ø)-ˆOÔ&Ø#.×#>Ò#>¸Ñ#OÔ#OÐ ØÔ×)Ò)Ð*>ÈÐ)ÑYÔYð Øà !Ñ#ÐØà $Ô 8Ð8ÐØ(9ˆÔ%Ø*×:Ò:¸?ÑKÔKÐàÔ,ˆ
ð ×"Ò"­HÔ,EÐ"ÑFÔFˆà×"Ò"­HÔ,EÐ"ÑFÔFˆà$ˆˆT‰
Ø$ˆˆT‰
à$Ð&:Ð;Ð;r#   c                óv  — t          j        ¦   «         }| j        €t          d¦  «        ‚| j        | j                 }|                      |¦  «        }||_        |                     |¦  «        }|                      |¦  «        }| j	         
                    ||¬¦  «        r| j	                             ||¬¦  «         nÏ|                      |¦  «        }|r_	 |                      |||¦  «        \  }}| j	                             ||¬¦  «         |                      |¦  «         n# t          $ r d}Y nw xY w|sW|du r%| j        du rd|_        |                     |¦  «        }| j	                             ¦   «          |                      |¦  «         |                      |j        ¦  «         |                      |¦  «         dS )z^
        Fundamentally important method that adds a noteGrouping to the braille line.
        Nz?currentGroupingKey must not be None to call extractNoteGroupingr)  FT)r  r,  r£   r­   r¡   r  r  r.  Ú!optionalAddKeyboardSymbolsAndDotsr   r/  r‚   r%  r;  ÚaddToNewLiner   rš   ÚlastHyphenToSpaceÚaddRepeatSymbolsrZ   rß   )	ra   r3  r   r  r"  r*  Úshould_splitÚbngAÚbngBs	            r$   rÒ   z"BrailleSegment.extractNoteGrouping%  sù  € õ Ô3Ñ5Ô5ˆØÔ"Ð*ÝÐ^Ñ_Ô_Ð_ØÔ)¨$Ô*AÔBˆà ×BÒBÀ<ÑPÔPÐØ(9ˆÔ%Ø)×9Ò9¸,ÑGÔGÐà×9Ò9Ð:MÑNÔNˆàÔ×%Ò%Ð&9ÀHÐ%ÑMÔMð !	7ØÔ×#Ò#Ð$7À(Ð#ÑKÔKÐKÐKà!%×!5Ò!5Ð6IÑ!JÔ!JˆLØð )ð)Ø!%×!DÒ!DÀ\ØARØAIñ"Kô "K‘J�D˜$ð Ô$×+Ò+¨D¸8Ð+ÑDÔDÐDØ×%Ò% dÑ+Ô+Ð+Ð+øÝ.ð )ð )ð )ð $)�L�L�Lð)øøøð  ð 
7ð %¨Ð-Ð-°$Ô2JÈeÐ2SÐ2Sð 59�KÔ1Ø*5×*EÒ*EÀlÑ*SÔ*SÐ'àÔ ×2Ò2Ñ4Ô4Ð4Ø×!Ò!Ð"5Ñ6Ô6Ð6à×Ò˜lÔ5Ñ6Ô6Ð6Ø×Ò Ñ-Ô-Ð-Ð-Ð-s   ÃAD ÄD.Ä-D.c                ó  — d|cxk     rdk     r7n n4t          |¦  «        D ]"}|                      t          d         ¦  «         Œ#dS |dk    r>|                      t          d         t          j        |¦  «        z   ¦  «         d| _        dS dS )u¾  
        Adds the appropriate number of repeat symbols, following DeGarmo chapter 17.

        >>> seg = braille.segment.BrailleSegment()
        >>> seg.addRepeatSymbols(0)
        >>> print(seg.brailleText)
        >>> seg.addRepeatSymbols(1)
        >>> print(seg.brailleText)
        â ¶

        >>> seg = braille.segment.BrailleSegment()
        >>> seg.addRepeatSymbols(2)
        >>> print(seg.brailleText)
        â ¶â €â ¶

        >>> seg = braille.segment.BrailleSegment()
        >>> seg.addRepeatSymbols(3)
        >>> print(seg.brailleText)
        â ¶â ¼â ‰

        Does not yet handle situations beginning with Example 17-6 (repeats at
        different octaves), and further
        r   r(   ÚrepeatN)Úrangerä   rƒ   r   rè   r¥   )ra   ÚrepeatTimesÚunused_repeatCounters      r$   r@  zBrailleSegment.addRepeatSymbolsZ  s«   € ð0 ˆ{ÐÐÒÐ˜QÒÐÐÐÐÝ(-¨kÑ(:Ô(:ð 6ð 6Ð$Ø×"Ò"¥7¨8Ô#4Ñ5Ô5Ð5Ð5ð6ð 6à˜AÒÐØ×Ò�w xÔ0µ5Ô3HÈÑ3UÔ3UÑUÑVÔVÐVà ˆDŒMˆMˆMð Ðr#   c                óô  — d}d}| j         }| j                             |¦  «        }t          |¦  «        dk    r|d         |d         }}nWt          |¦  «        dk    rD| j                             | j         ¦  «        d         }t	          |t
          j        ¦  «        r|}n|}d}| j        r|�	 |j        }n# t          $ r Y nw xY wt          j        |||¦  «        }|dk    r|                      |¦  «         dS dS )z­
        Extracts a key signature, time signature, and possibly an outgoing key signature
        from the currentGroupingKey and adds it to the BrailleText object.
        Nr:   r   r9   râ   )r£   r¡   rñ   rs   r€   r   rF   r”   ÚoutgoingKeySigrv   r   ÚtranscribeSignaturesrä   )ra   r@   rA   r÷   r   rù   rJ  Ú
brailleSigs           r$   rÓ   z'BrailleSegment.extractSignatureGroupingz  s+  € ð
 ˆØˆàÔ%ˆØÔ)×-Ò-¨cÑ2Ô2ˆåˆ|ÑÔ Ò!Ð!Ø*6°q¬/¸<È¼?˜-ˆLˆLÝ�ÑÔ !Ò#Ð#ØÔ-×1Ò1°$Ô2IÑJÔJÈ1ÔMˆLÝ˜,­Ô(8Ñ9Ô9ð -Ø+��à ,�àˆØÔ$ð 	¨Ð)AðØ!-Ô!<��øÝ!ð ð ð Ø�ðøøøõ Ô/°¸mÈ^Ñ\Ô\ˆ
Ø˜ÒÐØ×Ò˜zÑ*Ô*Ð*Ð*Ð*ð Ðs   Â-B5 Â5
CÃCc                ó  — | j                              | j        ¦  «         | j        j        t
          j        k    r| j                              | j        ¦  «         |                      ¦   «          |                      ¦   «          dS )z9
        Extracts a tempo text and processes it.
        N)	r¢   Ú
appendleftr£   r¤   rS   r&   r1   rÎ   rÏ   rg   s    r$   rÖ   z'BrailleSegment.extractTempoTextGrouping™  sv   € ð 	Ô"×-Ò-¨dÔ.EÑFÔFÐFØÔ#Ô,µÔ0BÒBÐBØÔ&×1Ò1°$Ô2JÑKÔKÐKØ×ÒÑÔÐØ×!Ò!Ñ#Ô#Ð#Ð#Ð#r#   c                ó  — t          | j        ¦  «        }d}t          |                      ¦   «         ¦  «        D ]F\  }}|j        t
          j        k    r|||<   d}Œ"|€|}|D ]}||                              |¦  «         ŒŒG|S )ag  
        Puts together certain types of elements according to the last digit of their key
        (if it is the same as Affinity.NOTEGROUP or not.

        >>> SK = braille.segment.SegmentKey
        >>> BS1 = braille.segment.BrailleSegment()
        >>> BS1[SK(ordinal=0, affinity=2)] = ['hi', 'hello', 'there']
        >>> BS1[SK(ordinal=1, affinity=9)] = ['these', 'get']
        >>> BS1[SK(ordinal=2, affinity=9)] = ['put', 'together']
        >>> BS1[SK(ordinal=3, affinity=4)] = ['in', 'new', 'group']
        >>> BS1[SK(ordinal=4, affinity=9)] = ['with', 'the', 'previous']
        >>> BS2 = BS1.consolidate()
        >>> for (groupingKey, groupingList) in sorted(BS2.items()):
        ...     print(groupingKey, groupingList)
        SegmentKey(measure=0, ordinal=0, affinity=2, hand=None) ['hi', 'hello', 'there']
        SegmentKey(measure=0, ordinal=1, affinity=9, hand=None) these
        get
        put
        together
        SegmentKey(measure=0, ordinal=3, affinity=4, hand=None) ['in', 'new', 'group']
        SegmentKey(measure=0, ordinal=4, affinity=9, hand=None) with
        the
        previous
        N)r“   r–   rÀ   rÁ   rS   r&   r7   r‚   )ra   Ú
newSegmentÚpngKeyÚgroupingKeyÚgroupingListrm   s         r$   ÚconsolidatezBrailleSegment.consolidate£  sž   € õ4 $ D¤OÑ4Ô4ˆ
ØˆÝ+1°$·*²*±,´,Ñ+?Ô+?ð 	4ð 	4Ñ'ˆ[˜,ØÔ#¥xÔ'9Ò9Ð9Ø*6�
˜;Ñ'Ø��à�>Ø(�FØ(ð 4ð 4�DØ˜vÔ&×-Ò-¨dÑ3Ô3Ð3Ð3ð4àÐr#   c                óB  — t          j        d¦  «        }t          j        d¦  «        }t	          |                      ¦   «         ¦  «        }d\  }}|D �]<\  }}|�±|j        dk    rd|_        |j        dk    r”|j        t          j
        k    r|j        dk    rt|j        t          j
        k    r_t          |d         t          j        ¦  «        rt          |dd…         |¦  «        }nt          ||¦  «        }|r|xj        dz  c_        | |= Œ¹|j        t          j        k    rF|D ]B}	t          |	t          j        ¦  «        r|	}Œt          |	t           j        ¦  «        r	||	_        |	}ŒCnò|j        t          j        t          j
        fv rÓt          |d         t          j        ¦  «        rgt          |d         t          j        t          j        f¦  «        rd| _        n3t          |d         t          j        t          j        f¦  «        rd| _        d„ |D ¦   «         }
t1          |
¦  «        dk    r-t          |
d         t2          j        ¦  «        rd|
d         _        ||_        ||_        | j        |_        | j        |_        | j        |_        ||}}�Œ>| j         r	d|_        dS dS )	a%  
        Modifies the attributes of all :class:`~music21.braille.segment.BrailleElementGrouping`
        instances in a list of :class:`~music21.braille.segment.BrailleSegment` instances. The
        necessary information is retrieved from the segment and from the found clef, if any.
        r   rE   r'  Nr9   TFc                óF   — g | ]}t          |t          j        ¦  «        ¯|‘ŒS r"   )r€   r   ÚGeneralNoter  s     r$   r  z8BrailleSegment.addGroupingAttributes.<locals>.<listcomp>õ  s*   € Ð"^Ð"^Ð"^¨½jÈÍDÔL\Ñ>]Ô>]Ð"^ 1Ð"^Ð"^Ð"^r#   )!r   rF   r   rG   rÀ   rÁ   rR   rY   rS   r&   r7   r€   r	   rý   ÚareGroupingsIdenticalrZ   r1   rJ  r5   Ú
TrebleClefÚAltoClefrW   ÚBassClefÚ	TenorClefrs   r   ÚRestÚfullMeasurer@   rA   rX   r`   r›   )ra   ÚcurrentKeySigÚcurrentTimeSigrÆ   r  ÚpreviousListrR  rS  ÚisRepetitionÚbrailleElementÚallGeneralNotess              r$   ÚaddGroupingAttributesz$BrailleSegment.addGroupingAttributesÊ  s°  € õ Ô(¨Ñ+Ô+ˆÝÔ,¨UÑ3Ô3ˆå˜dŸjšj™lœlÑ+Ô+ˆØ&2Ñ#ˆ�là+7ð '	Fñ '	FÑ'ˆ[˜,ØÐ&ØÔ&¨!Ò+Ð+Ø.2�LÔ+ØÔ'¨1Ò,Ð,Ø'Ô0µHÔ4FÒFÐFØ'Ô/°1Ò4Ð4Ø'Ô0µHÔ4FÒFÐFÝ! ,¨q¤/µ4´9Ñ=Ô=ð YÝ'<¸\È!È"È"Ô=MÈ|Ñ'\Ô'\˜˜å'<¸\È<Ñ'XÔ'X˜Ø#ð !Ø$Ð/Ô/°1Ñ4Ð/Ô/Ø  Ð-Ø ØÔ#¥xÔ'9Ò9Ð9Ø&2ð 7ð 7�NÝ! .µ%Ô2EÑFÔFð 7Ø)7˜˜Ý# NµCÔ4DÑEÔEð 7Ø8E˜Ô5Ø(6˜øð7ð Ô%­(Ô*;½XÔ=OÐ)PÐPÐPÝ˜l¨1œo­t¬yÑ9Ô9ð 6Ý! ,¨q¤/µD´OÅTÄ]Ð3SÑTÔTð 6Ø04˜Ô-Ð-Ý# L°¤Oµd´mÅTÄ^Ð5TÑUÔUð 6Ø05˜Ô-ð #_Ð"^¨lÐ"^Ñ"^Ô"^�Ý�Ñ'Ô'¨1Ò,Ð,µ¸OÈAÔ<NÕPTÔPYÑ1ZÔ1ZÐ,Ø59�O AÔ&Ô2Ø(5ˆLÔ%Ø)7ˆLÔ&Ø,0Ô,AˆLÔ)Ø)-Ô);ˆLÔ&Ø59Ô5SˆLÔ2Ø+6¸˜,ˆ[‰[ØŒ>ð 	+Ø&*ˆLÔ#Ð#Ð#ð	+ð 	+r#   c           	     ó|  ‡‡	— ddl mŠ ˆfd„}|                      ¦   «         Š	ˆ	fd„‰	                     ¦   «         D ¦   «         }|D ]w}d„ |D ¦   «         }t	          t          |¦  «        ¦  «        D ]L}||         }|j        D ]:}t          |‰j        ¦  «        rt          |‰j        ¦  «        r |||||¦  «         Œ;ŒMŒxdS )a¼  
        Goes through each :class:`~music21.braille.segment.BrailleSegment` and modifies the
        list of :attr:`~music21.note.GeneralNote.articulations` of a :class:`~music21.note.Note`
        if appropriate. In particular, two rules are applied:

        * Doubling rule => If four or more of the same :class:`~music21.articulations.Articulation`
          are found in a row, the first instance of the articulation is doubled and the rest are
          omitted.

          It is permissible (not mandatory) to observe this doubling with bowings. (BMTM, 114)
          For this reason, any :class:`~music21.articulations.TechnicalIndication` but for bowings
          (e.g. fingering, harmonic) is skipped, because it does not braille as an articulation.

        * Staccato, Tenuto rule => "If two repeated notes appear to be tied, but either is marked
          staccato or tenuto, they are treated as slurred instead of tied." (BMTM, 112)
        r   )Úarticulationsc                ój  •— | j         }t          | ‰	j        ‰	j        f¦  «        rV|j        �O|j        j        dk    r!d ||dz
           _        d||dz
           _        nd ||dz            _        d|_        d |_        d}t          |dz   t          |¦  «        ¦  «        D ]#}||         }|d„ |j	        D ¦   «         v r|dz  }Œ# |dk     rd S |j	         
                    | ¦  «         t          |dz   ||z   ¦  «        D ]9}||         }|j	        D ]'}|j         |k    r|j	                             |¦  «         Œ(Œ:d S )NÚstopr9   Tr   c                ó   — g | ]	}|j         ‘Œ
S r"   )rÃ   )r¼   Úas     r$   r  zOBrailleSegment.fixArticulations.<locals>.fixOneArticulation.<locals>.<listcomp>"  s   € Ð SÐ SÐ S¨A ¤Ð SÐ SÐ Sr#   r(   )rÃ   r€   ÚStaccatoÚTenutoÚtieÚtypeÚ	shortSlurrF  rs   rg  r‚   Úremove)
ÚarticÚmusic21NoteStartr  ÚnoteIndexStartÚ	articNameÚnumSequentialÚnoteIndexContinueÚmusic21NoteContinueÚartOtherrg  s
            €r$   ÚfixOneArticulationz;BrailleSegment.fixArticulations.<locals>.fixOneArticulation  s�  ø€ Øœ
ˆIÝ˜5 =Ô#9¸=Ô;OÐ"PÑQÔQð ,Ø(Ô,Ð8Ø#Ô'Ô,°Ò6Ð6Ø7;�H˜^¨aÑ/Ô0Ô4Ø=A�H˜^¨aÑ/Ô0Ô:Ð:à7;�H˜^¨aÑ/Ô0Ô4Ø15Ð$Ô.Ø'+Ð Ô$ØˆMÝ%*¨>¸AÑ+=½sÀ8¹}¼}Ñ%MÔ%Mð ð Ð!Ø&.Ð/@Ô&AÐ#ØÐ SÐ SÐ1DÔ1RÐ SÑ SÔ SÐSÐSØ! QÑ&�MØØØ˜qÒ Ð Ø�ð Ô*×1Ò1°%Ñ8Ô8Ð8Ý%*¨>¸AÑ+=Ø+9¸MÑ+Iñ&Kô &Kð Kð KÐ!à&.Ð/@Ô&AÐ#Ø 3Ô Að Kð K�HØ”}¨	Ò1Ð1Ø+Ô9×@Ò@ÀÑJÔJÐJøðKðKð Kr#   c                óJ   •— g | ]}|j         t          j        k    ¯‰|         ‘Œ S r"   )rS   r&   r7   )r¼   ÚgpKeyrP  s     €r$   r  z3BrailleSegment.fixArticulations.<locals>.<listcomp>3  s;   ø€ ð Ið Ið IØ!&Ø#(¤>µXÔ5GÒ#GÐ#Gð $ EÔ*à#GÐ#GÐ#Gr#   c                óF   — g | ]}t          |t          j        ¦  «        ¯|‘ŒS r"   r  r  s     r$   r  z3BrailleSegment.fixArticulations.<locals>.<listcomp>7  s)   € ÐRÐRÐR A½ÀAÅtÄyÑ9QÔ9QÐR˜aÐRÐRÐRr#   N)	Úmusic21rg  rT  rÍ   rF  rs   r€   ÚTechnicalIndicationÚBowing)
ra   rz  ÚnoteGroupingsr   ÚallNotes_outerÚnoteIndexStart_outerÚmusic21NoteStart_outerÚartic_outerrg  rP  s
           @@r$   ÚfixArticulationszBrailleSegment.fixArticulations  sD  øø€ ð" 	*Ð)Ð)Ð)Ð)Ð)ð	Kð 	Kð 	Kð 	Kð 	Kð< ×%Ò%Ñ'Ô'ˆ
ðIð Ið Ið IØ*4¯/ª/Ñ*;Ô*;ðIñ Iô Iˆð *ð 	ð 	ˆLØRÐR¨ÐRÑRÔRˆNÝ(-­c°.Ñ.AÔ.AÑ(BÔ(Bð 
ð 
Ð$Ø)7Ð8LÔ)MÐ&Ø#9Ô#Gð ð �KÝ& {°MÔ4UÑVÔVð Ý)¨+°}Ô7KÑLÔLðà*Ð*Ø'Ø2Ø*Ø0ñ	ô ð øðð
ð	ð 	r#   ©r�   ©r–   rP   )rz   rû   )r   rV   )rz   r  )FF)"r   r    r!   r\   rB   rc   rq   rn   r®   ry   r±   rh   rt   Úpropertyr¶   r�   rØ   rß   rÐ   rÏ   rÎ   rÕ   rÔ   r  r%  r;  rÒ   r@  rÓ   rÖ   rT  re  r†  Ú__classcell__)r¦   s   @r$   r“   r“     sh  ø€ € € € € € ð!UðZðFð#SðBð2ð -ð?ð
<ð/!ð !€Ið ð ð ñ ð8J&ð J&ð J&ð J&ð J&ð J&ð J&ðX)ð )ð )ð(ð (ð (ð
>ð >ð >ð1ð 1ð 1ð*ð *ð *ð(ð (ð (ð'ð 'ð 'ð ð.ð .ñ „Xð.ð ð  ð  ðD( ð ( ð ( ðT$ð $ð $ð0ð 0ð 0ð"!-ð !-ð !-ðF-,ð -,ð -,ð`ð ð ð ð2	2ð 	2ð 	2ð^!ð ^!ð ^!ð ^!ð@ð ð ð ð: AFØ7<ð+<ð +<ð +<ð +<ðZ3.ð 3.ð 3.ð 3.ðj!ð !ð !ð@+ð +ð +ð>$ð $ð $ð%ð %ð %ðN5+ð 5+ð 5+ðnAð Að Að Að Að Að Ar#   r“   c                  óP   — e Zd ZdZddd„Zed„ ¦   «         Zd„ Zd„ Zd	„ Z	d
„ Z
d„ ZdS )ÚBrailleGrandSegmenta  
    A BrailleGrandSegment represents a pair of segments (rightSegment, leftSegment)
    representing the right and left hands of a piano staff (or other two-staff object).

    >>> bgs = braille.segment.BrailleGrandSegment(lineLength=36)
    >>> bgs.lineLength
    36
    r�   r–   rP   c                óÂ   — t                                | |¬¦  «         t          j                             | |¬¦  «         t	          ¦   «         | _        d | _        d | _        d S )NrŸ   )r“   rc   r   ÚBrailleKeyboardr   ÚallKeyPairsÚpreviousGroupingPairÚcurrentGroupingPair)ra   r–   s     r$   rc   zBrailleGrandSegment.__init__N  s\   € Ý×Ò °ÐÑ<Ô<Ð<ÝÔ×%Ò% d°zÐ%ÑBÔBÐBå:?¹'¼'ð 	Ôà$(ˆÔ!Ø#'ˆÔ Ð Ð r#   c                ó@   — t           j                             | ¦  «        S re   )r   rŽ  r�   rg   s    r$   r¶   zBrailleGrandSegment.brailleTextV  s   € åÔ#×+Ò+¨DÑ1Ô1Ð1r#   c                ó¤  — d}g }|                       ¦   «         D �]	\  }}|�hd|j        › dt          |j                 › d|j        dz   › d�}t          | j                             |¦  «        ¦  «        }d                     ||g¦  «        }nd}|�hd|j        › d	t          |j                 › d|j        dz   › d�}t          | j                             |¦  «        ¦  «        }	d                     ||	g¦  «        }
nd}
| 	                    d
                     ||
dg¦  «        ¦  «         �Œd
                     d|d                     |¦  «        dg¦  «        }|S )Nz1<music21.braille.segment BrailleGrandSegment>
===r¸   z Right, r¹   r9   rº   râ   z	
Measure z Left, r~   z====
z---begin grand segment---z---end grand segment---)
ÚyieldCombinedGroupingKeysrQ   r<   rS   rR   r{   r¡   rñ   r„   r‚   )ra   rÃ   ÚallPairsÚrightKeyÚleftKeyÚrightHeadingÚrightContentsÚ	rightFullÚleftHeadingÚleftContentsÚleftFullrŒ   s               r$   r�   zBrailleGrandSegment.__str__Z  s¡  € ØCˆØˆØ#'×#AÒ#AÑ#CÔ#Cð 	Hñ 	HÑˆX�wØÐ#ð1˜xÔ/ð 1ð 1Ý$ XÔ%6Ô7ð1ð 1àÔ'¨!Ñ+ð1ð 1ð 1ð õ
 !$ DÔ$6×$:Ò$:¸8Ñ$DÔ$DÑ EÔ E�ØŸGšG \°=Ð$AÑBÔB�	�	à�	ØÐ"ð0 ¤ð 0ð 0Ý$ WÔ%5Ô6ð0ð 0à”¨Ñ*ð0ð 0ð 0ð õ
  # 4Ô#5×#9Ò#9¸'Ñ#BÔ#BÑCÔC�ØŸ7š7 K°Ð#>Ñ?Ô?��à�Ø�OŠO˜DŸIšI y°(¸HÐ&EÑFÔFÑGÔGÐGÑGØ�iŠiÐ4ØØŸš Ñ*Ô*Ø2ð4ñ 5ô 5ˆð ˆ
r#   c              #  ó  K  — d„ }d„ }d}d}t          |                      ¦   «         |¬¦  «        D ]Å}|j        dk    ri|�d |||¦  «        r||fV — nN|j        t          j        k    r1 ||                     t          j        ¬¦  «        |¦  «        r||fV — nd|fV — |}d}Œs|}Œv|j        dk    rD|�@ |||¦  «        r||fV — n*|j        t          j        k     r|dfV — d|fV — n|dfV — |}d}ŒÃ|}ŒÆ|r|dfV — |rd|fV — dS dS )aó  
        yields all the keys in order as a tuple of (rightKey, leftKey) where
        two keys are grouped if they have the same segmentKey except for the hand.

        >>> bgs = braille.segment.BrailleGrandSegment()
        >>> SegmentKey = braille.segment.SegmentKey  # namedtuple
        >>> bgs[SegmentKey(1, 1, 1, 'right')] = '1r'
        >>> bgs[SegmentKey(1, 1, 1, 'left')]  = '1l'
        >>> bgs[SegmentKey(1, 2, 3, 'right')] = '2r'
        >>> bgs[SegmentKey(1, 2, 4, 'left')] = '3l'
        >>> bgs[SegmentKey(2, 1, 9, 'left')] = '4l'
        >>> bgs[SegmentKey(2, 1, 9, 'right')] = '4r'
        >>> bgs[SegmentKey(3, 1, 9, 'right')] = '5r'
        >>> for l, r in bgs.yieldCombinedGroupingKeys():
        ...     (bgs[l], bgs[r])
        ('1r', '1l')
        ('2r', <music21.braille.segment.BrailleElementGrouping []>)
        (<music21.braille.segment.BrailleElementGrouping []>, '3l')
        ('4r', '4l')
        ('5r', <music21.braille.segment.BrailleElementGrouping []>)

        Known Bug:
            Because this puts `None` elements into the defaultDict,
            it makes the assumption that all of .keys() will be SegmentKeys
            incorrect.  In fact, if you run this method twice, the second time
            it will crash.
        c                óL   — | j         dk    rd}nd}| j        | j        | j        |fS )z\
            sort by measure, then ordinal, then affinity, then hand (r then l)
            Úrightr'   r9   )rT   rQ   rR   rS   )Ú
segmentKeyÚskHs     r$   ÚsegmentKeySortKeyzHBrailleGrandSegment.yieldCombinedGroupingKeys.<locals>.segmentKeySortKey˜  s6   € ð Œ 'Ò)Ð)Ø��à�ØÔ&¨
Ô(:¸JÔ<OÐQTÐUÐUr#   c                ój   — | j         |j         k    r"| j        |j        k    r| j        |j        k    rdS dS )NTF)rQ   rR   rS   )ÚthisKey_innerÚotherKeys     r$   Ú
matchOtherzABrailleGrandSegment.yieldCombinedGroupingKeys.<locals>.matchOther¢  s?   € ØÔ%¨Ô)9Ò9Ð9Ø%Ô-°Ô1AÒAÐAØ%Ô.°(Ô2CÒCÐCØ�tà�ur#   Nr   r   r+  Úleft)rÀ   rÍ   rT   rS   r&   r7   r0  r5   )ra   r£  r§  ÚstoredRightÚ
storedLeftÚthisKeys         r$   r”  z-BrailleGrandSegment.yieldCombinedGroupingKeysy  sÝ  è è € ð>	Vð 	Vð 	Vð	ð 	ð 	ð ˆØˆ
Ý˜dŸiši™kœkÐ/@ÐAÑAÔAð 	)ð 	)ˆGØŒ|˜wÒ&Ð&ØÐ)Ø!�z '¨:Ñ6Ô6ð 	.Ø&¨
Ð3Ð3Ð3Ð3Ð3Ø!Ô*­hÔ.@Ò@Ð@Ø(˜j¨×)9Ò)9Å8ÔCTÐ)9Ñ)UÔ)UÐWaÑbÔbð Að  '¨
Ð3Ð3Ð3Ð3Ð3à# ZÐ0Ð0Ð0Ð0Ø&-˜Ø!%�J�Jà")�K�KØ” Ò'Ð'ØÐ*Ø!�z '¨;Ñ7Ô7ð -Ø*¨GÐ4Ð4Ð4Ð4Ð4Ø$Ô-µÔ0AÒAÐAØ*¨DÐ1Ð1Ð1Ð1Ø# W˜oÐ-Ð-Ð-Ð-à*¨DÐ1Ð1Ð1Ð1Ø%,˜
Ø"&�K�Kà!(�Jøàð 	&Ø Ð%Ð%Ð%Ð%Øð 	%Ø˜Ð$Ð$Ð$Ð$Ð$Ð$ð	%ð 	%r#   c                ó:  — t          |                      ¦   «         ¦  «        | _        | j        d         }|d         r|d         j        n|d         j        }t	          t          |¦  «        ¦  «        | _        |                      ¦   «          d| _        | j        r}| j        | _	        | j         
                    ¦   «         | _        | j        \  }}|�|j        t          j        k    s|�)|j        t          j        k    r|                      ¦   «          | j        °}| j        S )zI
        Returns the BrailleText from the combined grouping keys
        r'   r   r9   N)r   r”  r�  rQ   rs   r{   ÚhighestMeasureNumberLengthrÎ   r‘  r�  rÑ   rS   r&   r5   rÒ   r¶   )ra   ÚlastPairÚhighestMeasurer–  r—  s        r$   rØ   zBrailleGrandSegment.transcribeþ  s  € õ ! ×!?Ò!?Ñ!AÔ!AÑBÔBˆÔØÔ# BÔ'ˆØ08¸´ÐT˜ !œÔ,Ð,ÀÈ!ÄÔATˆÝ*-­c°.Ñ.AÔ.AÑ*BÔ*BˆÔ'à×ÒÑÔÐØ#'ˆÔ ØÔð 	+Ø(,Ô(@ˆDÔ%Ø'+Ô'7×'?Ò'?Ñ'AÔ'AˆDÔ$Ø"&Ô":ÑˆX�wàÐ%¨(Ô*;½xÔ?PÒ*PÐ*PØÐ+°Ô0@ÅHÔDUÒ0UÐ0UØ×(Ò(Ñ*Ô*Ð*ð Ôð 	+ð  ÔÐr#   c                ó€  — d}d}d}d}| j         �rI| j         d         \  }}|}	 | j                             |¦  «        }nG# t          $ r:}	|	j        d         dk    r| j                             |¦  «        }|}n|	‚Y d}	~	nd}	~	ww xY w|j        t          j        k    rn¾| j                              ¦   «          |j        t          j	        k    rM	 |d         |d         }}nv# t          $ r. t          |t          j        ¦  «        r	|d         }n|d         }Y n?w xY w|j        t          j        k    r	|d         }n|j        t          j        k    r|d         }| j         �°I	 t          j        ||||| j        ¬¦  «        }
|                      |
¦  «         dS # t          j        $ r}|j        d         dk    r|‚Y d}~dS d}~ww xY w)z•
        Finds KeySignatures, TimeSignatures, TempoText, and Metronome Marks
        within the keyPairs, and removes some from allKeyPairs.
        Nr   rû   r9   rï   zNo heading can be made.)r�  r¡   rñ   ÚKeyErrorÚargsrS   r&   r3   rÑ   r1   Ú
IndexErrorr€   r   rF   r2   r   ró   r–   rô   ÚBrailleBasicException)ra   r@   rA   rõ   rö   r–  r—  ÚuseKeyÚ
useElementÚkerú   Úbbes               r$   rÎ   z"BrailleGrandSegment.extractHeading  s"  € ð
 ˆØˆØˆ	ØˆàÔñ 	.Ø"&Ô"2°1Ô"5ÑˆX�wØˆFðØ!Ô/×3Ò3°HÑ=Ô=�
�
øÝð ð ð Ø”7˜1”: Ò'Ð'Ø!%Ô!3×!7Ò!7¸Ñ!@Ô!@�JØ$�F�Fà�Hð �F�F�F�Føøøøðøøøð Œ¥¤Ò/Ð/ØØÔ×$Ò$Ñ&Ô&Ð&ØŒ¥(Ô"4Ò4Ð4ð6Ø2<¸Q´-ÀÈAÄ -�L�LøÝ!ð 6ð 6ð 6Ý! *­cÔ.>Ñ?Ô?ð 6Ø'1°!¤}˜˜à(2°1¬˜øøð	6øøøð
 ”¥H¤NÒ2Ð2Ø& qœM�	�	Ø”¥H¤NÒ2Ð2Ø *¨1¤�ð3 Ôñ 	.ð6	Ý"Ô4ØØØØØ"œoðñ ô ˆNð �OŠO˜NÑ+Ô+Ð+Ð+Ð+øÝÔ*ð 	ð 	ð 	ØŒx˜Œ{Ð7Ò7Ð7Ø�	ð 8Ð7Ð7Ð7Ð7Ð7øøøøð	øøøs?   ¤? ¿
BÁ	0A>Á>BÃC Ã5DÄDÅ3F ÆF=ÆF8Æ8F=c                óò   ‡ — ‰ j         \  }}|r|j        }n|r|j        }nt          d¦  «        ‚t          j        |d¬¦  «        }ˆ fd„} ||¦  «        } ||¦  «        }‰                      |||¦  «         d S )Nz/Measure must be defined for leftKey or rightKeyF)ÚwithNumberSignc                ó^  •— | �á| j         t          j        k    rÌ‰j                             | ¦  «        }g }|D ]Œ}t          |t          j        ¦  «        sŒt          |¦  «        }|j	        |_	        |j
        |_
        |j        |_        |                     t          j        |¦  «        ¦  «         ‰                     |¦  «         Œ�t           d                              |¦  «        }nH| �D‰j                             | ¦  «        }t          j        |¦  «        }‰                     |¦  «         nd}|S )Nr}   râ   )rS   r&   r5   r¡   rñ   r€   r   r�   r   rW   rX   r`   r‚   r  r  rß   rƒ   r„   )ÚrightOrLeftKeyr  Úvoice_transÚmusic21Voicer   Ú
brailleStrra   s         €r$   ÚbrailleFromKeyz?BrailleGrandSegment.extractNoteGrouping.<locals>.brailleFromKeyX  s&  ø€ ØÐ)¨nÔ.EÍÔIZÒ.ZÐ.ZØ Ô.×2Ò2°>ÑBÔB�	Ø �Ø$-ð :ð :�LÝ% lµF´LÑAÔAð !Ø Ý#9¸,Ñ#GÔ#G�LØ4=Ô4N�LÔ1Ø1:Ô1H�LÔ.Ø=FÔ=`�LÔ:Ø×&Ò&¥uÔ'CÀLÑ'QÔ'QÑRÔRÐRØ×+Ò+¨LÑ9Ô9Ð9Ð9å$ _Ô5×:Ò:¸;ÑGÔG�
�
ØÐ+Ø#Ô1×5Ò5°nÑEÔE�Ý"Ô9¸,ÑGÔG�
Ø×'Ò'¨Ñ5Ô5Ð5Ð5à�
àÐr#   )r‘  rQ   r­   r   rè   ÚaddNoteGroupings)ra   r–  r—  ÚmNumÚcurrentMeasureNumberrÀ  Ú	rhBrailleÚ	lhBrailles   `       r$   rÒ   z'BrailleGrandSegment.extractNoteGroupingM  s²   ø€ Ø"Ô6Ñˆ�7Øð 	PØÔ#ˆDˆDØð 	PØ”?ˆDˆDåÐNÑOÔOÐOå$Ô4°TÈ%ÐPÑPÔPÐð	ð 	ð 	ð 	ð 	ð0 #�N 8Ñ,Ô,ˆ	Ø"�N 7Ñ+Ô+ˆ	à×ÒÐ2°I¸yÑIÔIÐIÐIÐIr#   Nr‡  rˆ  )r   r    r!   r‘   rc   r‰  r¶   r�   r”  rØ   rÎ   rÒ   r"   r#   r$   rŒ  rŒ  E  s§   € € € € € ðð ð(ð (ð (ð (ð (ð ð2ð 2ñ „Xð2ðð ð ð>T%ð T%ð T%ðJ ð  ð  ð:0ð 0ð 0ðd&Jð &Jð &Jð &Jð &Jr#   rŒ  Tr�   F)ÚsetHandr”   rW   r•   rð   ÚsegmentBreaksrX   r—   r˜   r™   ÚshowLongSlursAndTiesTogetherÚshowShortSlursAndTiesTogetherÚslurLongPhraseWithBracketsrš   r`   rÈ  úbool | Nonec               ó(  — t          | |||¬¦  «         t          | ||¬¦  «        }|D ]i}||_        ||_        ||_        |                     ¦   «          ||_        ||_        ||_        |	|_	        |
|_
        ||_        |                     ¦   «          Œj|S )u'  
    Takes in a :class:`~music21.stream.Part`.

    Returns a list of :class:`~music21.segment.BrailleSegment` instances.

    Five functions or methods get called in the generation of segments:

    * :func:`~music21.braille.segment.prepareSlurredNotes`
    * :func:`~music21.braille.segment.getRawSegments`
    * :meth:`~music21.braille.segment.BrailleSegment.addGroupingAttributes`
    * :meth:`~music21.braille.segment.BrailleSegment.addSegmentAttributes`
    * :meth:`~music21.braille.segment.BrailleSegment.fixArticulations`

    >>> from music21.braille import test
    >>> example = test.example11_2()
    >>> allSegments = braille.segment.findSegments(example)

    >>> print(str(allSegments[0]))
    ---begin segment---
    <music21.braille.segment BrailleSegment>
    Measure 0, Signature Grouping 1:
    <music21.key.KeySignature of 3 flats>
    <music21.meter.TimeSignature 4/4>
    ===
    Measure 0, Note Grouping 1:
    <music21.clef.TrebleClef>
    <music21.note.Note B->
    ===
    Measure 1, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note E->
    <music21.note.Note D>
    <music21.note.Note E->
    ===
    Measure 2, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note F>
    <music21.note.Note E->
    ===
    Measure 3, Note Grouping 1:
    <music21.note.Note A->
    <music21.note.Note G>
    <music21.note.Note C>
    <music21.note.Note C>
    ===
    Measure 4, Note Grouping 1:
    <music21.note.Note B->
    <music21.note.Note B->
    ===
    Measure 5, Note Grouping 1:
    <music21.note.Note E->
    <music21.note.Note B->
    <music21.note.Note A->
    <music21.note.Note G>
    ===
    Measure 6, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note F>
    <music21.note.Note C>
    ===
    Measure 7, Note Grouping 1:
    <music21.note.Note C>
    <music21.note.Note F>
    <music21.note.Note A->
    <music21.note.Note D>
    ===
    Measure 8, Note Grouping 1:
    <music21.note.Note E->
    music hyphen â �
    ===
    ---end segment---

    Second segment

    >>> print(str(allSegments[1]))
    ---begin segment---
    <music21.braille.segment BrailleSegment>
    Measure 8, Note Grouping 2:
    <music21.note.Note G>
    ===
    Measure 9, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note F>
    <music21.note.Note F>
    <music21.note.Note F>
    ===
    Measure 10, Note Grouping 1:
    <music21.note.Note A->
    <music21.note.Note G>
    <music21.note.Note B->
    ===
    Measure 11, Note Grouping 1:
    <music21.note.Note B->
    <music21.note.Note A>
    <music21.note.Note A>
    <music21.note.Note C>
    ===
    Measure 12, Note Grouping 1:
    <music21.note.Note B->
    <music21.note.Note B->
    ===
    Measure 13, Note Grouping 1:
    <music21.note.Note E->
    <music21.note.Note B->
    <music21.note.Note A->
    <music21.note.Note G>
    ===
    Measure 14, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note F>
    <music21.note.Note C>
    ===
    Measure 15, Note Grouping 1:
    <music21.note.Note C>
    <music21.note.Rest quarter>
    <music21.note.Note F>
    <music21.note.Rest quarter>
    ===
    Measure 16, Note Grouping 1:
    <music21.note.Note A->
    <music21.note.Note D>
    ===
    Measure 17, Note Grouping 1:
    <music21.note.Note E->
    <music21.bar.Barline type=final>
    ===
    ---end segment---
    )rÈ  rÉ  rÊ  ©rÆ  rð   )ÚprepareSlurredNotesÚgetRawSegmentsrX   r`   rW   re  r”   r•   r—   r˜   r™   rš   r†  )Úmusic21PartrÆ  r”   rW   r•   rð   rÇ  rX   r—   r˜   r™   rÈ  rÉ  rÊ  rš   r`   ÚallSegmentsÚsegs                     r$   ÚfindSegmentsrÓ  …  sÅ   € õj ˜Ø5QØ6SØ3Mðñ ô ð õ ! °gÈ]Ð[Ñ[Ô[€Kàð ð ˆð *ˆÔØ(AˆÔ%Ø/ˆÔØ×!Ò!Ñ#Ô#Ð#ð $8ˆÔ Ø-ˆÔØ%;ˆÔ"ØˆŒØ%ˆŒØ"5ˆÔð 	×ÒÑÔÐÐàÐr#   )rÊ  rÉ  rÈ  c               ó  — | j         sdS |€|}|                      ¦   «         j                             ¦   «         }| j                              t
          j        ¦  «        D �]¦}|                     ¦   «         }|                     ¦   «         }	 | 	                    |¦  «        }| 	                    |¦  «        }	n# t          j        $ r Y Œhw xY wt          |	|z
  ¦  «        dz   }
|s[|
t          k    rP||         j        �||         j        j        dk    r|dz  }||	         j        �||	         j        j        dk    r|	dz  }	|s[|
t          k    rP||         j        �||         j        j        dk    r|dz  }||	         j        �||	         j        j        dk    r|	dz  }	|
t          k    r"t!          ||	¦  «        D ]}d||         _        Œ�Œh|rd||         _        d||	         _        �Œ†d||dz            _        d||	dz
           _        �Œ¨dS )aF  
    Takes in a :class:`~music21.stream.Part` and three keywords:

    * slurLongPhraseWithBrackets
    * showShortSlursAndTiesTogether
    * showLongSlursAndTiesTogether

    For any slurs present in the Part, the appropriate notes are labeled
    with attributes indicating where to put the symbols that represent
    slurring in braille. For purposes of slurring in braille, there is
    a distinction between short and long phrases. In a short phrase, a
    slur covers up to four notes. A short slur symbol should follow each
    note except the last.

    >>> import copy
    >>> from music21.braille import segment
    >>> short = converter.parse('tinynotation: 3/4 c4 d e')
    >>> s1 = spanner.Slur(short.recurse().notes.first(), short.recurse().notes.last())
    >>> short.append(s1)
    >>> short.show('text')
    {0.0} <music21.stream.Measure 1 offset=0.0>
        {0.0} <music21.clef.TrebleClef>
        {0.0} <music21.meter.TimeSignature 3/4>
        {0.0} <music21.note.Note C>
        {1.0} <music21.note.Note D>
        {2.0} <music21.note.Note E>
        {3.0} <music21.bar.Barline type=final>
    {3.0} <music21.spanner.Slur <music21.note.Note C><music21.note.Note E>>
    >>> shortA = copy.deepcopy(short)
    >>> segment.prepareSlurredNotes(shortA)
    >>> shortA.recurse().notes[0].shortSlur
    True
    >>> shortA.recurse().notes[1].shortSlur
    True

    In a long phrase, a slur covers more than four notes. There are two
    options for slurring long phrases. The first is by using the bracket
    slur. By default, slurLongPhraseWithBrackets is True. The opening
    bracket sign is put before the first note, and the closing bracket
    sign is put before the last note.

    >>> long = converter.parse('tinynotation: 3/4 c8 d e f g a')
    >>> s2 = spanner.Slur(long[note.Note].first(), long[note.Note].last())
    >>> long.append(s2)
    >>> long.show('text')
    {0.0} <music21.stream.Measure 1 offset=0.0>
        {0.0} <music21.clef.TrebleClef>
        {0.0} <music21.meter.TimeSignature 3/4>
        {0.0} <music21.note.Note C>
        {0.5} <music21.note.Note D>
        {1.0} <music21.note.Note E>
        {1.5} <music21.note.Note F>
        {2.0} <music21.note.Note G>
        {2.5} <music21.note.Note A>
        {3.0} <music21.bar.Barline type=final>
    {3.0} <music21.spanner.Slur <music21.note.Note C><music21.note.Note A>>
    >>> longA = copy.deepcopy(long)
    >>> segment.prepareSlurredNotes(longA)
    >>> longA[note.Note].first().beginLongBracketSlur
    True
    >>> longA[note.Note].last().endLongBracketSlur
    True

    The other way is by using the double slur, setting `slurLongPhraseWithBrackets`
    to False. The opening sign of the double slur is put after the first note
    (i.e. before the second note) and the closing sign is put before the last
    note (i.e. before the second to last note).

    If a value is not supplied for `showLongSlursAndTiesTogether`, it will take the
    value set for `slurLongPhraseWithBrackets`, which defaults True.

    >>> longB = copy.deepcopy(long)
    >>> segment.prepareSlurredNotes(longB, slurLongPhraseWithBrackets=False)
    >>> longB.recurse().notes[1].beginLongDoubleSlur
    True
    >>> longB.recurse().notes[-2].endLongDoubleSlur
    True

    In the event that slurs and ties are shown together in print, the slur is
    redundant. Examples are shown for slurring a short phrase; the process is
    identical for slurring a long phrase.

    Below, a tie has been added between the first two notes of the short phrase
    defined above. If showShortSlursAndTiesTogether is set to its default value of
    False, then the slur on either side of the phrase is reduced by the amount that
    ties are present, as shown below.

    >>> short.recurse().notes[0].tie = tie.Tie('start')
    >>> shortB = copy.deepcopy(short)
    >>> segment.prepareSlurredNotes(shortB)
    >>> shortB.recurse().notes[0].shortSlur
    Traceback (most recent call last):
    AttributeError: 'Note' object has no attribute 'shortSlur'
    >>> shortB.recurse().notes[0].tie
    <music21.tie.Tie start>
    >>> shortB.recurse().notes[1].shortSlur
    True

    If showShortSlursAndTiesTogether is set to True, then the slurs and ties are
    shown together (i.e. the note has both a shortSlur and a tie).

    >>> shortC = copy.deepcopy(short)
    >>> segment.prepareSlurredNotes(shortC, showShortSlursAndTiesTogether=True)
    >>> shortC.recurse().notes[0].shortSlur
    True
    >>> shortC.recurse().notes[0].tie
    <music21.tie.Tie start>

    TODO: This should not add attributes to Note objects but instead return a collection
    of sets of notes that have each element applied to it.
    Nr9   Ústartri  T)ÚspannerBundleÚflattenÚnotesr   Ú
getByClassr   ÚSlurÚgetFirstÚgetLastÚindexr   ÚStreamExceptionÚabsÚSEGMENT_MAXNOTESFORSHORTSLURrn  ro  rF  rp  ÚbeginLongBracketSlurÚendLongBracketSlurÚbeginLongDoubleSlurÚendLongDoubleSlur)rÐ  rÊ  rÉ  rÈ  r  Úslurr  r¥   Ú
beginIndexÚendIndexÚdeltaÚ	noteIndexs               r$   rÎ  rÎ  <  sV  € ðj Ô$ð ØˆØ#Ð+Ø'AÐ$à×"Ò"Ñ$Ô$Ô*×1Ò1Ñ3Ô3€HØÔ)×4Ò4µW´\ÑBÔBð (@ñ (@ˆØ—M’M‘O”Oˆ	Ø—<’<‘>”>ˆð	Ø!Ÿš¨	Ñ2Ô2ˆJØ—~’~ hÑ/Ô/ˆHˆHøÝÔ+ð 	ð 	ð 	ð ˆHð		øøøõ �H˜zÑ)Ñ*Ô*¨QÑ.ˆà,ð 	°Õ:VÒ1VÐ1Vð ˜Ô$Ô(Ð4Ø  Ô,Ô0Ô5¸Ò@Ð@Ø˜a‘�
Ø˜Ô!Ô%Ð1°h¸xÔ6HÔ6LÔ6QÐU[Ò6[Ð6[Ø˜A‘�à+ð 	°Õ8TÒ0TÐ0TØ˜Ô$Ô(Ð4Ø  Ô,Ô0Ô5¸Ò@Ð@Ø˜a‘�
Ø˜Ô!Ô%Ð1°h¸xÔ6HÔ6LÔ6QÐU[Ò6[Ð6[Ø˜A‘�àÕ0Ò0Ð0Ý" :¨xÑ8Ô8ð 5ð 5�	Ø04�˜Ô#Ô-Ð-ñ5ð *ð @Ø<@�˜Ô$Ô9Ø8<�˜Ô"Ô5Ñ5à?C�˜ a™Ô(Ô<Ø;?�˜ A™Ô&Ô8Ñ8ðQ(@ð (@s   Â	*B4Â4CÃCrÍ  rð   rP   c               óä  — g }t          |¬¦  «        }d}d}|                      t          j        ¦  «        D �]£}t	          |¦  «         t          |¦  «        }d}	t          j        }
|D �]p}|r`|j        dk    rd|_	        | 
                    |¦  «         t          |¬¦  «        }|j        dk    rd|_        d}|
t          j        ur|	dz  }	d}d|j        v rd|j        v r|t          k    rn|dk    rd}ŒŒt          |t          j        ¦  «        r|t          k    r|j        d	v rd}|j        j        |
k     r|	dz  }	|j        j        }|t          j        k    rt          j        }n|t          j        k    rt          j        }t1          |j        |	||¦  «        }||vrt5          ¦   «         ||<   ||         }| 
                    |¦  «         |dz  }|j        j        }
�Œr�Œ¥| 
                    |¦  «         |S )
aŒ  
    Takes in a :class:`~music21.stream.Part`, divides it up into segments (i.e. instances of
    :class:`~music21.braille.segment.BrailleSegment`). This function assumes
    that the Part is already divided up into measures
    (see :class:`~music21.stream.Measure`). An acceptable input is shown below.

    This will automatically find appropriate segment breaks at
    :class:`~music21.braille.objects.BrailleSegmentDivision`
    or :class:`~music21.braille.objects.BrailleOptionalSegmentDivision`
    or after 48 elements if a double bar or repeat sign is encountered.

    Two functions are called for each measure during the creation of segments:

    * :func:`~music21.braille.segment.prepareBeamedNotes`
    * :func:`~music21.braille.segment.extractBrailleElements`

    >>> tn = converter.parse("tinynotation: 3/4 c4 c c e e e g g g c'2.")
    >>> tn = tn.makeNotation(cautionaryNotImmediateRepeat=False)
    >>> tn.show('text')
    {0.0} <music21.stream.Measure 1 offset=0.0>
        {0.0} <music21.clef.TrebleClef>
        {0.0} <music21.meter.TimeSignature 3/4>
        {0.0} <music21.note.Note C>
        {1.0} <music21.note.Note C>
        {2.0} <music21.note.Note C>
    {3.0} <music21.stream.Measure 2 offset=3.0>
        {0.0} <music21.note.Note E>
        {1.0} <music21.note.Note E>
        {2.0} <music21.note.Note E>
    {6.0} <music21.stream.Measure 3 offset=6.0>
        {0.0} <music21.note.Note G>
        {1.0} <music21.note.Note G>
        {2.0} <music21.note.Note G>
    {9.0} <music21.stream.Measure 4 offset=9.0>
        {0.0} <music21.note.Note C>
        {3.0} <music21.bar.Barline type=final>

    By default, there is no break anywhere within the Part,
    and a segmentList of size 1 is returned.

    >>> import copy
    >>> from music21.braille import segment
    >>> tnA = copy.deepcopy(tn)
    >>> rawSegments = segment.getRawSegments(tnA)
    >>> len(rawSegments)
    1
    >>> rawSegments[0]
    <music21.braille.segment.BrailleSegment 1 line, 0 headings, 40 cols>

    >>> print(rawSegments[0])
    ---begin segment---
    <music21.braille.segment BrailleSegment>
    Measure 1, Signature Grouping 1:
    <music21.meter.TimeSignature 3/4>
    ===
    Measure 1, Note Grouping 1:
    <music21.clef.TrebleClef>
    <music21.note.Note C>
    <music21.note.Note C>
    <music21.note.Note C>
    ===
    Measure 2, Note Grouping 1:
    <music21.note.Note E>
    <music21.note.Note E>
    <music21.note.Note E>
    ===
    Measure 3, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note G>
    <music21.note.Note G>
    ===
    Measure 4, Note Grouping 1:
    <music21.note.Note C>
    <music21.bar.Barline type=final>
    ===
    ---end segment---

    Now, a segment break occurs at measure 2, offset 1.0 within that measure.
    The two segments are shown below.

    >>> tnB = copy.deepcopy(tn)
    >>> tnB.measure(2).insert(1.0, braille.objects.BrailleSegmentDivision())
    >>> allSegments = segment.getRawSegments(tnB)
    >>> len(allSegments)
    2

    >>> allSegments[0]
    <music21.braille.segment.BrailleSegment 1 line, 0 headings, 40 cols>

    >>> print(allSegments[0])
    ---begin segment---
    <music21.braille.segment BrailleSegment>
    Measure 1, Signature Grouping 1:
    <music21.meter.TimeSignature 3/4>
    ===
    Measure 1, Note Grouping 1:
    <music21.clef.TrebleClef>
    <music21.note.Note C>
    <music21.note.Note C>
    <music21.note.Note C>
    ===
    Measure 2, Note Grouping 1:
    <music21.note.Note E>
    ===
    ---end segment---

    >>> allSegments[1]
    <music21.braille.segment.BrailleSegment 1 line, 0 headings, 40 cols>

    >>> print(allSegments[1])
    ---begin segment---
    <music21.braille.segment BrailleSegment>
    Measure 2, Note Grouping 2:
    <music21.note.Note E>
    <music21.note.Note E>
    ===
    Measure 3, Note Grouping 1:
    <music21.note.Note G>
    <music21.note.Note G>
    <music21.note.Note G>
    ===
    Measure 4, Note Grouping 1:
    <music21.note.Note C>
    <music21.bar.Barline type=final>
    ===
    ---end segment---

    If we insert an optional division, the division
    only appears if there are 48 elements in the current segment:

    >>> tnC = copy.deepcopy(tn)
    >>> tnC.measure(1).insert(1.0, braille.objects.BrailleOptionalSegmentDivision())
    >>> allSegments = segment.getRawSegments(tnC)
    >>> len(allSegments)
    1

    If by happenstance a segment division object is encountered where a division
    has just been created (or the very beginning),
    no unnecessary empty segment will be created:

    >>> tnD = copy.deepcopy(tn)
    >>> tnD.measure(1).insert(0, braille.objects.BrailleSegmentDivision())
    >>> allSegments = segment.getRawSegments(tnD)
    >>> len(allSegments)
    1
    rŸ   r   Fç        Tr9   ÚBrailleSegmentDivisionÚBrailleOptionalSegmentDivision)ÚdoubleÚfinal)r“   ÚgetElementsByClassr   ÚMeasureÚprepareBeamedNotesr   r&   r0   Úoffsetr›   r‚   rœ   ÚclassesÚMAX_ELEMENTS_IN_SEGMENTr€   r   ÚBarlinero  r…   ÚaffinityCoder6   r5   r8   r7   rO   ÚnumberrV   )rÐ  rÆ  rð   rÑ  ÚcurrentSegmentÚelementsInCurrentSegmentÚstartANewSegmentÚmusic21MeasureÚbrailleElementsrR   ÚpreviousAffinityCoderc  r÷  r¡  ÚbrailleElementGroupings                  r$   rÏ  rÏ  â  sg  € ðp €Kå#¨}Ð=Ñ=Ô=€Nà$%Ðà"Ðà%×8Ò8½¼ÑHÔHð AIñ AIˆÝ˜>Ñ*Ô*Ð*Ý0°Ñ@Ô@ˆØˆÝ'Ô/Ðà-ð ;	Iñ ;	IˆNØð )à!Ô(¨CÒ/Ð/ð 04�NÔ,ð ×"Ò" >Ñ2Ô2Ð2Ý!/¸=Ð!IÑ!IÔ!I�Ø!Ô(¨CÒ/Ð/Ø6:�NÔ3à+,Ð(Ø'­xÔ/?Ð?Ð?Ø˜q‘L�Gà#(Ð Ø'¨>Ô+AÐAÐAØ4¸Ô8NÐNÐNØ4Õ8OÒOÐOàà-°Ò1Ð1Ø'+Ð$àå˜>­3¬;Ñ7Ô7ð(à,Õ/FÒFÐFØ"Ô'Ð+>Ð>Ð>ð $(Ð ð Ô'Ô4Ð7KÒKÐKØ˜1‘�à)Ô3Ô@ˆLØ�xÔ8Ò8Ð8Ý'Ô0��Ø¥Ô!:Ò:Ð:Ý'Ô1�å# NÔ$9Ø$+Ø$0Ø$+ñ&ô &ˆJð
  Ð/Ð/Ý-CÑ-EÔ-E�˜zÑ*Ø%3°JÔ%?Ð"Ø"×)Ò)¨.Ñ9Ô9Ð9Ø$¨Ñ)Ð$ð $2Ô#;Ô#HÐ Ñ ñw;	Iðx ×Ò�~Ñ&Ô&Ð&ØÐr#   Úmusic21MeasureOrVoiceústream.Measure | stream.Voicerz   c                óü  ‡— t          ¦   «         }d}| D �]XŠt          ‰t          j        ¦  «        r‰}Œ 	 t          ‰t          j        ¦  «        r‰j        dk    rŒGt          ‰¦  «         |�|t          ‰t          j	        t          j        f¦  «        rVt          |¦  «         ‰j        j        |j        _        t          |¦  «        g|j        _        |                     |¦  «         d}|                     ‰¦  «         t          ‰¦  «        g‰j        _        �Œ# t"          $ rH}ˆfd„t$          D ¦   «         }t'          |¦  «        st(                               |› ¦  «         Y d}~�ŒRd}~ww xY w|                     d„ ¬¦  «         t/          |¦  «        dk    rdt          |d         t0          j        ¦  «        rDt          |d         t          j        ¦  «        r$d|d         _        |                     d	„ ¬¦  «         |S )
a0  
    Takes in a :class:`~music21.stream.Measure` or :class:`~music21.stream.Voice`
    and returns a :class:`~music21.braille.segment.BrailleElementGrouping` of correctly ordered
    :class:`~music21.base.Music21Object` instances which can be directly transcribed to
    braille.

    >>> from music21.braille import segment
    >>> tn = converter.parse('tinynotation: 2/4 c16 c c c d d d d', makeNotation=False)
    >>> tn = tn.makeNotation(cautionaryNotImmediateRepeat=False)
    >>> measure = tn[0]
    >>> measure.append(spanner.Slur(measure.notes[0],measure.notes[-1]))
    >>> measure.show('text')
    {0.0} <music21.clef.TrebleClef>
    {0.0} <music21.meter.TimeSignature 2/4>
    {0.0} <music21.note.Note C>
    {0.25} <music21.note.Note C>
    {0.5} <music21.note.Note C>
    {0.75} <music21.note.Note C>
    {1.0} <music21.note.Note D>
    {1.25} <music21.note.Note D>
    {1.5} <music21.note.Note D>
    {1.75} <music21.note.Note D>
    {2.0} <music21.spanner.Slur <music21.note.Note C><music21.note.Note D>>
    {2.0} <music21.bar.Barline type=final>

    Spanners are dealt with in :func:`~music21.braille.segment.prepareSlurredNotes`,
    so they are not returned by this function, as seen below.

    >>> print(segment.extractBrailleElements(measure))
    <music21.meter.TimeSignature 2/4>
    <music21.clef.TrebleClef>
    <music21.note.Note C>
    <music21.note.Note C>
    <music21.note.Note C>
    <music21.note.Note C>
    <music21.note.Note D>
    <music21.note.Note D>
    <music21.note.Note D>
    <music21.note.Note D>
    <music21.bar.Barline type=final>
    NÚregularc                ó0   •— g | ]}t          ‰|¦  «        ‘ŒS r"   )r€   )r¼   Úmusic21ClassÚmusic21Objects     €r$   r  z*extractBrailleElements.<locals>.<listcomp>  s9   ø€ ð Hð Hð HØ(õ # =°,Ñ?Ô?ð Hð Hð Hr#   c                ó   — | j         | j        fS re   ©ró  ÚclassSortOrder©Úxs    r$   ú<lambda>z(extractBrailleElements.<locals>.<lambda>  s   €  A¤H¨aÔ.>Ð#?€ r#   r   r:   r'   éþÿÿÿc                ó   — | j         | j        fS re   r  r
  s    r$   r  z(extractBrailleElements.<locals>.<lambda>  s   € ¨A¬H°aÔ6FÐ+G€ r#   )rV   r€   r	   rý   r   rö  ro  ÚsetAffinityCoder   rW  r   r�   r…   r÷  r{   r†   r‚   r   r=   rò   rþ   rÿ   Úsortrs   r
   ÚDynamicr	  )r   ÚallElementsr  ÚnotSupportedExceptionÚisExemptr  s        @r$   r   r   È  s  ø€ õX )Ñ*Ô*€KØ $€IØ.ð >ñ >ˆå�m¥T¤YÑ/Ô/ð 	Ø%ˆIØð	>Ý˜-­¬Ñ5Ô5ð Ø Ô%¨Ò2Ð2ØÝ˜MÑ*Ô*Ð*àÐ$­Ø!¥DÔ$4µf´lÐ#Cñ*Eô *EÐ$õ   	Ñ*Ô*Ð*à3@Ô3JÔ3W�	Ô#Ô0Ý69¸)±n´nÐ5E�	Ô#Ô2Ø×"Ò" 9Ñ-Ô-Ð-Ø �	à×Ò˜}Ñ-Ô-Ð-Ý69¸-Ñ6HÔ6HÐ5IˆMÔ#Ô2Ñ2øå&ð 	>ð 	>ð 	>ðHð Hð Hð HÝ,FðHñ Hô HˆHå�x‘=”=ð >Ý×!Ò!Ð%:Ð"<Ñ=Ô=Ð=øøøøùøøøøð		>øøøð ×ÒÐ?Ð?ÐÑ@Ô@Ð@Ý
ˆ;ÑÔ˜1ÒÐ¥¨K¸¬O½XÔ=MÑ!NÔ!NÐÝ�k "”o¥s¤{Ñ3Ô3ð 	IØ-/ˆK˜ŒOÔ*Ø×ÒÐ!GÐ!GÐÑHÔHÐHàÐs   µ%DÁB<DÄ
E+Ä#=E&Å&E+c                óÜ  — | j                              ¦   «         }|D ]}d|_        d|_        Œ| j                             ¦   «         }d„ }d„ }d„ }|                     ¦   «                              |¦  «                             |¦  «        }|                     ¦   «                              |¦  «                             |¦  «        }t          |¦  «        t          |¦  «        k    rt           	                    d¦  «         dS t          |¦  «        D �]Ü\  }	}
|
j        dk    rŒ||	         }|                     |
¦  «        }|                     |¦  «        }||z
  dz   }|d	k     rŒSd
}t          |dz   |dz   ¦  «        D ]<}||         j        |
j        k    s t          ||         t          j        ¦  «        rd} nŒ=	 ||dz            }t          |t          j        ¦  «        r,t#          |j        ¦  «        t#          |j        ¦  «        k    rd}n# t&          $ r Y nw xY w|s�Œ	 ||dz            j        dk    r�Œ&n# t&          $ r Y nw xY wd
|
_        	 ||dz
           }t          |t          j        ¦  «        rAt#          |j        ¦  «        t#          |
j        ¦  «        k    r|j        |
j        k    rd
|
_        n# t&          $ r Y nw xY wt          |dz   |dz   ¦  «        D ]}d
||         _        Œ�ŒÞdS )a#  
    Takes in a :class:`~music21.stream.Measure` and labels beamed notes
    of smaller value than an 8th with beamStart and beamContinue keywords
    in accordance with beaming rules in braille music.

    A more in-depth explanation of beaming in braille can be found in
    Chapter 15 of Introduction to Braille Music Transcription, Second
    Edition, by Mary Turner De Garmo.

    >>> from music21.braille import segment
    >>> tn = converter.parse('tinynotation: 2/4 c16 c c c d d d d')
    >>> tn = tn.makeNotation(cautionaryNotImmediateRepeat=False)
    >>> tn.show('text')
    {0.0} <music21.stream.Measure 1 offset=0.0>
        {0.0} <music21.clef.TrebleClef>
        {0.0} <music21.meter.TimeSignature 2/4>
        {0.0} <music21.note.Note C>
        {0.25} <music21.note.Note C>
        {0.5} <music21.note.Note C>
        {0.75} <music21.note.Note C>
        {1.0} <music21.note.Note D>
        {1.25} <music21.note.Note D>
        {1.5} <music21.note.Note D>
        {1.75} <music21.note.Note D>
        {2.0} <music21.bar.Barline type=final>
    >>> measure = tn[0]
    >>> segment.prepareBeamedNotes(measure)
    >>> measure.notes[0].beamStart
    True
    >>> measure.notes[1].beamContinue
    True
    >>> measure.notes[2].beamContinue
    True
    >>> measure.notes[3].beamContinue
    True
    Fc                óD   — | j         d uot          | j         ¦  «        dk    S )Nr   )Úbeamsrs   ©rÝ   Úunuseds     r$   ÚwithBeamFilterz*prepareBeamedNotes.<locals>.withBeamFilterI  s!   € Ø” Ð$Ð;­#¨b¬h©-¬-¸!Ò*;Ð;r#   c                óH   — | j                              d¦  «        j        dk    S )Nr9   rÕ  ©r  ÚgetByNumberro  r  s     r$   ÚbeamStartFilterz+prepareBeamedNotes.<locals>.beamStartFilterL  s    € ØŒx×#Ò# AÑ&Ô&Ô+¨wÒ6Ð6r#   c                óH   — | j                              d¦  «        j        dk    S )Nr9   ri  r  r  s     r$   ÚbeamStopFilterz*prepareBeamedNotes.<locals>.beamStopFilterO  s    € ØŒx×#Ò# AÑ&Ô&Ô+¨vÒ5Ð5r#   zDIncorrect beaming: number of start notes != to number of stop notes.Ng      à?r9   r(   T)rØ  r   Ú	beamStartÚbeamContinueÚnotesAndRestsrf   Ú	addFilterrs   rþ   rÿ   Ú	enumerateÚquarterLengthrÝ  rF  r€   r   r]  rP   Úbeatr³  )rü  r  Ú
sampleNoteÚallNotesAndRestsr  r  r   ÚallStartIterÚallStopIterÚ	beamIndexÚ	startNoteÚstopNoteÚ
startIndexÚ	stopIndexrè  ÚallNotesOfSameValueré  ÚafterStopNoteÚbeforeStartNotes                      r$   rò  rò    sx  € ðJ Ô#×*Ò*Ñ,Ô,€Hàð (ð (ˆ
Ø$ˆ
ÔØ"'ˆ
ÔÐØ%Ô3×:Ò:Ñ<Ô<Ðð<ð <ð <ð7ð 7ð 7ð6ð 6ð 6ð —=’=‘?”?×,Ò,¨^Ñ<Ô<×FÒFÀÑWÔW€LØ—-’-‘/”/×+Ò+¨NÑ;Ô;×EÒEÀnÑUÔU€Kå
ˆ<ÑÔ�C Ñ,Ô,Ò,Ð,Ý×ÒÐ`ÑaÔaÐaØˆå )¨,Ñ 7Ô 7ð 2<ñ 2<Ñˆ	�9ð Ô" cÒ)Ð)Øà˜yÔ)ˆØ%×+Ò+¨IÑ6Ô6ˆ
Ø$×*Ò*¨8Ñ4Ô4ˆ	à˜JÑ&¨Ñ*ˆØ�1Š9ˆ9Øð #ÐÝ˜z¨A™~¨y¸1©}Ñ=Ô=ð 	ð 	ˆIØ  Ô+Ô9¸YÔ=TÒTÐTÝ!Ð"2°9Ô"=½t¼yÑIÔIð Uà&+Ð#Ø�ð Uð	Ø,¨Y¸©]Ô;ˆMÝ˜=­$¬)Ñ4Ô4ð ,Ý˜]Ô/Ñ0Ô0µC¸¼Ñ4FÔ4FÒFÐFØ&+Ð#øøÝð 	ð 	ð 	ØˆDð	øøøà"ð 	Ùð	ð   	¨A¡Ô.Ô<ÀÒCÐCÙð Døåð 	ð 	ð 	ØˆDð	øøøð #ˆ	Ôð	Ø.¨z¸A©~Ô>ˆOÝ˜?­D¬IÑ6Ô6ð .Ý˜OÔ0Ñ1Ô1µS¸¼Ñ5HÔ5HÒHÐHØ'Ô5¸Ô9PÒPÐPØ)-�	Ô&øøÝð 	ð 	ð 	ØˆDð	øøøå˜z¨A™~¨y¸1©}Ñ=Ô=ð 	<ð 	<ˆIØ7;Ð˜YÔ'Ô4Ð4ñ	<ðc2<ð 2<s8   Æ7AH	È	
HÈHÈH5È5
IÉIÉA&J4Ê4
KË Kr  úbase.Music21Objectc                ó®  — t           D ],\  }}}t          | |¦  «        r|| j        _        || _         dS Œ-t          | t
          j        ¦  «        r_t          j        | j        _        t          | j
                             ¦   «         ¦  «        dk    rt          j        | j        _        d| _        dS t          | t          ¦  «        rdS t          | › d�¦  «        ‚)ab  
    Takes in a :class:`~music21.base.Music21Object`, and does two things:

    * Modifies the :attr:`~music21.base.Music21Object.classSortOrder` attribute of the
      object to fit the slightly modified ordering of objects in braille music.

    * Adds an affinity code to the Editorial for the object.
      This code indicates which surrounding objects the object should be grouped with.

    A BrailleSegmentException is raised if an affinity code cannot be assigned to
    the object.

    As seen in the following example, the affinity code of a :class:`~music21.note.Note`
    and a :class:`~music21.clef.TrebleClef` are the same, because they should be grouped
    together. However, the classSortOrder indicates that the TrebleClef should come first
    in the braille.

    >>> n1 = note.Note('D5')
    >>> braille.segment.setAffinityCode(n1)
    >>> n1.editorial.affinityCode
    <Affinity.NOTEGROUP: 9>
    >>> n1.classSortOrder
    10
    >>> c1 = clef.TrebleClef()
    >>> braille.segment.setAffinityCode(c1)
    >>> c1.editorial.affinityCode
    <Affinity.NOTEGROUP: 9>
    >>> c1.classSortOrder
    7
    Nr9   r-   z" cannot be transcribed to braille.)r;   r€   r…   r÷  r	  r   ÚTextExpressionr&   r7   rs   ÚcontentÚsplitr4   r   r   )r  r  ÚcodeÚ	sortOrders       r$   r  r  Ž  sÜ   € õ> ,9ð ð Ñ'ˆ�t˜YÝ�m \Ñ2Ô2ð 	Ø37ˆMÔ#Ô0Ø+4ˆMÔ(ØˆFˆFð	õ
 �-¥Ô!;Ñ<Ô<ð Ý/7Ô/AˆÔÔ,Ýˆ}Ô$×*Ò*Ñ,Ô,Ñ-Ô-°Ò1Ð1Ý3;Ô3IˆMÔ#Ô0Ø'(ˆÔ$Øˆå�-Õ!;Ñ<Ô<ð Øˆå
! ]Ð"VÐ"VÐ"VÑ
WÔ
WÐWr#   c                óˆ   — t          | ¦  «        t          |¦  «        k    r!t          | |¦  «        D ]\  }}||k    r dS ŒdS dS )a3  
    Takes in two note groupings, noteGroupingA and noteGroupingB. Returns True
    if both groupings have identical contents. False otherwise.

    Helper for numRepeats.

    Needs two identical length groupings.

    >>> a = [note.Note('C4'), note.Note('D4')]
    >>> b = [note.Note('C4'), note.Note('D4')]
    >>> braille.segment.areGroupingsIdentical(a, b)
    True

    >>> d = b.pop()
    >>> braille.segment.areGroupingsIdentical(a, b)
    False
    >>> c = [note.Rest(), note.Note('D4')]
    >>> braille.segment.areGroupingsIdentical(a, c)
    False
    FT)rs   rÂ   )ÚnoteGroupingAÚnoteGroupingBÚelementAÚelementBs       r$   rX  rX  À  s^   € õ* ˆ=ÑÔ�S Ñ/Ô/Ò/Ð/Ý$'¨°}Ñ$EÔ$Eð 	ð 	Ñ ˆX�xØ˜8Ò#Ð#Ø�u�uð $àˆtØˆ5r#   c                óv  — t          j        ¦   «         }| D ]}|                     |j        |¦  «         Œt	          ||| j        ¦  «        \  }}t          j        | ¦  «        }g |_        |D ]}|                     |¦  «         Œt          j        | ¦  «        }g |_        |D ]}|                     |¦  «         Œ||fS )aù  
    Almost identical to :func:`~music21.braille.segment.splitMeasure`, but
    functions on a :class:`~music21.braille.segment.BrailleElementGrouping`
    instead.

    >>> from music21.braille import segment
    >>> bg = segment.BrailleElementGrouping()
    >>> bg.timeSignature = meter.TimeSignature('2/2')
    >>> s = converter.parse('tinyNotation: 2/2 c4 d r e')
    >>> for n in s.recurse().notesAndRests:
    ...     bg.append(n)
    >>> left, right = segment.splitNoteGrouping(bg)
    >>> left
    <music21.braille.segment.BrailleElementGrouping
        [<music21.note.Note C>, <music21.note.Note D>]>

    >>> print(left)
    <music21.note.Note C>
    <music21.note.Note D>

    >>> right
    <music21.braille.segment.BrailleElementGrouping
        [<music21.note.Rest quarter>, <music21.note.Note E>]>

    Now split one beat division earlier than it should be.  For 2/2 that means
    one half of a beat, or one quarter note earlier:

    >>> left, right = segment.splitNoteGrouping(bg, beatDivisionOffset=1)
    >>> left
    <music21.braille.segment.BrailleElementGrouping
        [<music21.note.Note C>]>
    >>> right
    <music21.braille.segment.BrailleElementGrouping
        [<music21.note.Note D>, <music21.note.Rest quarter>, <music21.note.Note E>]>
    )	r   rñ  r  ró  ÚsplitMeasurerA   Úcopyr_   r‚   )r   r(  rü  rc  ÚleftMeasureÚrightMeasureÚleftBrailleElementsÚrightBrailleElementss           r$   r-  r-  à  sì   € õH ”^Ñ%Ô%€NØ&ð Eð EˆØ×Ò˜nÔ3°^ÑDÔDÐDÐDÝ".¨~Ø/AØ/;Ô/Iñ#Kô #KÑ€[�,õ œ) LÑ1Ô1ÐØ')ÐÔ$Ø%ð 3ð 3ˆØ×"Ò" >Ñ2Ô2Ð2Ð2åœ9 \Ñ2Ô2ÐØ(*ÐÔ%Ø&ð 4ð 4ˆØ×#Ò# NÑ3Ô3Ð3Ð3àÐ 4Ð4Ð4r#   c                óÌ  — |�|}n|                       ¦   «         }d}|dk    rÉt          |¦  «        t          |j        ¦  «        k    rt	          d|› d|j        › �¦  «        ‚t          |j        ¦  «        t          |¦  «        z
  }	 |t          |j        |         j        ¦  «        z  }t          |¦  «        }n3# t          $ r& t           	                    d| j
        › d�¦  «         Y nw xY wt          j        |j        ¦  «        }d}	 |                     |d	¬
¦  «         |                     ¦   «         d         \  }}	nq# t           j        $ r_ |dz  }|                     |d	¬
¦  «         |                     ¦   «         d         d         }|                     ¦   «         d         d         }	Y nw xY w|	|z  }	t%          j        ¦   «         }
t%          j        ¦   «         }| D ]t}|j        |k    rL|j        |	k     s%|j        |	k    r6t+          |t,          j        ¦  «        r|
                     |j        |¦  «         ŒY|                     |j        |¦  «         Œu|j        D ]C}|j        �:|
                     |¦  «         |                     |¦  «         |	|j        j        z  }	ŒC | j        j        |	z
  }t=          j        |¬¦  «        }|
                     |	|¦  «         t=          j        |	¬¦  «        }|                     d|¦  «         d	}|
j         €	d}||
_         ||_         |
 !                    | ¦  «         | !                    | ¦  «         |
 "                    d¬¦  «         | "                    d¬¦  «         tG          |
¦  «         tG          |¦  «         |
                     |¦  «         |                     |¦  «         |r|
                     |¦  «         |                     |¦  «         |
|fS )aS  
    Takes a :class:`~music21.stream.Measure`, divides it in two parts, and returns a
    two-tuple of (leftMeasure, rightMeasure). The parameters are as
    follows:

    * beatDivisionOffset => Adjusts the end offset of the first partition by a certain amount
      of beats to the left.
    * useTimeSignature => In the event that the Measure comes from the middle of a Part
      and thus does not define an explicit :class:`~music21.meter.TimeSignature`. If not
      provided, a TimeSignature is retrieved by
      using :meth:`~music21.stream.Measure.bestTimeSignature`.

    >>> m = stream.Measure()
    >>> m.append(note.Note('C4'))
    >>> m.append(note.Note('D4'))
    >>> left, right = braille.segment.splitMeasure(m)
    >>> left.show('text')
    {0.0} <music21.note.Note C>
    >>> right.show('text')
    {1.0} <music21.note.Note D>
    Nrë  r   zbeatDivisionOffset z( is outside of ts.beatDivisionDurations z2Problem in converting a time signature in measure z, offset may be wrongr:   F)ÚloadDefaultr9   r  r'   )r&  T)ÚinPlace)$ÚbestTimeSignaturerß  rs   ÚbeatDivisionDurationsr   r   r&  r³  rþ   rÿ   rø  rB  ÚdeepcopyÚbeatSequenceÚpartitionByCountÚgetLevelSpanr   ÚMeterExceptionr   rñ  ró  r€   r   rö  r  rØ  rn  r‚   rq  Údurationr   r]  rA   ÚmergeAttributesÚ	makeBeamsrò  )rü  r(  ÚuseTimeSignatureÚtsró  Úduration_indexÚbsÚnumberOfPartitionsÚstartOffsetZeroÚendOffsetZerorC  rD  r  r  Úrest0LengthÚr0Úr1Ú
ts0_deletes                     r$   rA  rA  	  s_  € ð, Ð#Øˆˆà×-Ò-Ñ/Ô/ˆà€FØ˜QÒÐÝÐ!Ñ"Ô"¥S¨Ô)AÑ%BÔ%BÒBÐBÝ)ðJÐ&8ð Jð JØ/1Ô/GðJð Jñô ð õ ˜RÔ5Ñ6Ô6½Ð=OÑ9PÔ9PÑPˆð	OØ•f˜RÔ5°nÔEÔSÑTÔTÑTˆFÝ˜F‘^”^ˆFˆFøÝð 	Oð 	Oð 	OÝ×Òð NØ!/Ô!6ðNð Nð Nñ Oô Oð Oð Oð Oð	Oøøøõ 
Œ�r”Ñ	'Ô	'€BàÐð2Ø
×ÒÐ.¸EÐÑBÔBÐBØ+-¯?ª?Ñ+<Ô+<¸QÔ+?Ñ(ˆ˜-˜-øÝÔð 2ð 2ð 2Ø˜aÑÐØ
×ÒÐ.¸EÐÑBÔBÐBØŸ/š/Ñ+Ô+¨AÔ.¨qÔ1ˆØŸšÑ)Ô)¨"Ô-¨bÔ1ˆˆˆð	2øøøð
 �VÑ€Må”.Ñ"Ô"€KÝ”>Ñ#Ô#€LØð -ð -ˆØŒH˜Ò'Ð'Ø”X Ò-Ð-Øœ ]Ò2Ð2Ý'¨­3¬;Ñ7Ô7ð 3à×Ò˜qœx¨Ñ+Ô+Ð+Ð+à×Ò ¤¨!Ñ,Ô,Ð,Ð,ØÔð ð ˆØŒ5ÐØ×Ò˜qÑ!Ô!Ð!Ø×Ò Ñ"Ô"Ð"Ø˜QœZÔ5Ñ5ˆMØØà Ô)Ô7¸-ÑG€KÝ	Œ Ð	-Ñ	-Ô	-€BØ×Ò�} bÑ)Ô)Ð)å	Œ Ð	/Ñ	/Ô	/€BØ×Ò˜˜RÑ Ô Ð à€JØÔ Ð(Øˆ
Ø$&ˆÔ!Ø!#€LÔØ×Ò Ñ/Ô/Ð/Ø× Ò  Ñ0Ô0Ð0Ø×Ò $ÐÑ'Ô'Ð'Ø×Ò 4ÐÑ(Ô(Ð(Ý�{Ñ#Ô#Ð#Ý�|Ñ$Ô$Ð$Ø×Ò�rÑÔÐØ×Ò˜ÑÔÐØð Ø×Ò˜2ÑÔÐØ×Ò˜ÑÔÐØ˜Ð&Ð&s%   Â1B8 Â8-C(Ã'C(Ä4D< Ä<A+F*Æ)F*c                  ó   — e Zd Zd„ ZdS )ÚTestc                ó°   — ddl m} |                     d¦  «        }|                     d¬¦  «        }t	          |¦  «        }t          |d         ¦  «        }d S )Nr   )Ú	converterz)tinynotation: 3/4 c4 c c e e e g g g c'2.F)ÚcautionaryNotImmediateRepeat)r~  rb  ÚparseÚmakeNotationrÏ  r{   )ra   rb  ÚtnÚ
rawSegListr  s        r$   ÚtestGetRawSegmentszTest.testGetRawSegments~	  s[   € Ø%Ð%Ð%Ð%Ð%Ð%à�_Š_ÐHÑIÔIˆØ�_Š_¸%ˆ_Ñ@Ô@ˆå# BÑ'Ô'ˆ
Ý�Z ”]Ñ#Ô#ˆˆˆr#   N)r   r    r!   rh  r"   r#   r$   r`  r`  |	  s#   € € € € € ð$ð $ð $ð $ð $r#   r`  Ú__main__)rÈ  rË  )rð   rP   )r   r  rz   rV   )r  r4  )r   )r   N)or‘   Ú
__future__r   Úcollectionsr   r   rB  ÚenumÚtypingÚtÚunittestr~  r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   Úmusic21.prebaser   Úmusic21.brailler   r   r   r  r   Úmusic21.braille.objectsr   Úmusic21.common.numberToolsr   rƒ   ÚEnvironmentrþ   ÚMusic21Exceptionr   ÚIntEnumr&   ÚCSO_NOTEÚCSO_RESTÚ	CSO_CHORDÚCSO_DYNAMICÚCSO_CLEFÚCSO_BARLINEÚ
CSO_KEYSIGÚCSO_TIMESIGÚ	CSO_TTEXTÚ	CSO_MMARKÚ	CSO_VOICEr  r7   r]  ÚChordr  rý   rö  r8   rF   r1   rG   Ú	TempoTextr2   ÚMetronomeMarkr3   r�   r5   r;   rB   r4   r6   r<   rÚ  ÚSystemLayoutÚ
PageLayoutÚStaffLayoutr=   Ú	TypedDictr?   rC   rH   rà  rõ  rJ   Ú
NamedTuplerO   rV   rµ   r“   rŽ  rŒ  rÓ  rÎ  rÏ  r   rò  r  rX  r-  rA  ÚTestCaser`  r   ÚmainTestr"   r#   r$   ú<module>rŒ     sþ  ððð ð ð #Ð "Ð "Ð "Ð "Ð "à )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *à !Ð !Ð !Ð !Ð !Ð !Ø "Ð "Ð "Ð "Ð "Ð "Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø  Ð  Ð  Ð  Ð  Ð  Ø >Ð >Ð >Ð >Ð >Ð >à -Ð -Ð -Ð -Ð -Ð -ð Œ.€Ø&ˆ{Ô& |Ñ4Ô4€ð	ð 	ð 	ð 	ð 	˜lÔ;ñ 	ô 	ð 	ð
ð 
ð 
ð 
ð 
ˆtŒ|ñ 
ô 
ð 
ð €Ø€Ø€	Ø€Ø€Ø€Ø€
Ø€Ø€	Ø€	Ø€	ð 
„Y�Ô" HÐ-Ø	„Y�Ô" HÐ-Ø
„[�(Ô$ iÐ0ØÔ�xÔ)¨;Ð7Ø	„Y�Ô" HÐ-Ø„[�(Ô+¨[Ð9ØÔ�xÔ)¨:Ð6Ø
Ô˜(Ô,¨kÐ:Ø
„_�h”n iÐ0Ø
Ô˜(œ.¨)Ð4Ø„\�8Ô$ iÐ0ðG€ð ð ð ñ ð ÔÐ,Ø„NÐ)Ø„NÐ-ØÔÐ;ØÔÐ*ØÔ˜ØÔÐ6ØÔÐ6ð	&€ð 	ð 	ð 	ñ 	ð „LØ
ÔØ
ÔØ
Ôð	>Ð ð ð ð ñ ð,ð ,ð ,ð ,ð ,�a”kñ ,ô ,ð ,ð Øð%ð %Ð ð ð ð ñ ðGð Gð Gð  !Ð àÐ à�JÐ2Ð4PÐ4PÐ4PÑQÔQÐ ðð ð ð ð �”ñ ô ð ðt'ð t'ð t'ð t'ð t'˜^ñ t'ô t'ð t'ðnmð mð mð mð m�TÔ%ñ mô mð mð`nJð nJð nJð nJð nJ˜.¨$Ô*>ñ nJô nJð nJðD
 Ø&*Ø"&Ø!%Ø!Ø#Ø$Ø(,ØØ!Ø;?Ø/4Ø,0Ø%*Ø+/ð!tð tð tð tð tð tðr 48Ø6;ØBFð	c@ð c@ð c@ð c@ð c@ð c@ðP  Ø(*ðcð cð cð cð cð cðLRð Rð Rð Rðjn<ð n<ð n<ðb/Xð /Xð /Xð /Xðdð ð ð@45ð 45ð 45ð 45ðn_'ð _'ð _'ð _'ðJ	$ð 	$ð 	$ð 	$ð 	$ˆ8Ôñ 	$ô 	$ð 	$ð ˆzÒÐØ€N€N€NØ€GÔ�TÑÔÐÐÐð Ðr#   