§
    ƒØjú  ã                  óô   — d Z ddlmZ ddlmZ ddlZddlZddlm	Z	 ddlm
Z
 ddlmZ ej        rddlmZ  G d	„ d
e
j        ¦  «        Z G d„ dej        ¦  «        Zedk    rddlZ ej        e¦  «         dS dS )zà
This module contains classes for representing unpitched events such as percussion.
For backwards compatibility reasons, the module does not contain the actual
:class:`~music21.note.Unpitched` which is in the `note` module.
é    )Úannotations)ÚIterableN)Úcommon)Úchord)Únote)Úpitchc                  ó¸   ‡ — e Zd ZdZdZdˆ fd„	Zˆ fd„Zd„ Zedd	„¦   «         Z	e	j
        dd„¦   «         Z	dˆ fd„Zedd„¦   «         Zej
        dd„¦   «         Zˆ xZS )ÚPercussionChordaÈ  
    A representation of one or (normally) more than one unpitched object sharing a stem
    and treated like a "chord."  It may also contain standard notes (pitches) for cases
    such as a percussionist playing a cymbal and marimba at the same time.

    It is a :class:`~music21.chord.ChordBase` and `:class:`~music21.note.NotRest` subclass
    that is NOT a :class:`~music21.chord.Chord` because one or more
    notes is an :class:`~music21.note.Unpitched`
    object.

    >>> vibraslapNote = note.Unpitched(displayName='D4', storedInstrument=instrument.Vibraslap())
    >>> pChord = percussion.PercussionChord([vibraslapNote, note.Note('E5')])
    >>> pChord
    <music21.percussion.PercussionChord [Vibraslap E5]>

    >>> pChord.isChord
    False

    A PercussionChord has "notes," just like anything deriving from ChordBase.  Some of these
    are Unpitched objects.

    >>> pChord.notes
    (<music21.note.Unpitched 'Vibraslap'>, <music21.note.Note E>)

    The same notes can also be assigned to another PercussionChord:

    >>> pChord2 = percussion.PercussionChord()
    >>> pChord2.notes = pChord.notes
    >>> pChord2.notes
    (<music21.note.Unpitched 'Vibraslap'>, <music21.note.Note E>)

    Don't attempt setting anything but Note or Unpitched objects as notes:

    >>> pChord2.notes = [note.Rest()]
    Traceback (most recent call last):
    TypeError: every element of notes must be a note.Note or note.Unpitched object

    **Equality**

    Two PercussionChord objects are equal if their notes are equal *and in the same
    order* (this is different from Chord, but necessary because we cannot compare
    based just on pitch equality)

    >>> pChord == pChord2
    True
    >>> pChord3 = percussion.PercussionChord([note.Unpitched('D4')])
    >>> pChord == pChord3
    False

    OMIT_FROM_DOCS

    See the repr of an empty percussion chord:

    >>> percussion.PercussionChord()
    <music21.percussion.PercussionChord object at 0x...>

    This is in OMIT
    FNc                ón   •— t          ¦   «                              |¬¦  «        }|j        D ]	}||_        Œ
|S )N)Úmemo)ÚsuperÚ__deepcopy__Ú_notesÚ_chordAttached)Úselfr   ÚnewÚnÚ	__class__s       €ú‡/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/music21/percussion.pyr   zPercussionChord.__deepcopy__]   s>   ø€ Ý‰gŒg×"Ò"¨Ð"Ñ-Ô-ˆØ”ð 	#ð 	#ˆAØ"ˆAÔÐØˆ
ó    c                ó    •— t          ¦   «                              |¦  «        sdS t          | j        |j        ¦  «        D ]\  }}||k    r dS ŒdS )zP
        Returns True if all the notes are equal and in the same order.
        FT)r   Ú__eq__ÚzipÚnotes)r   ÚotherÚmy_nÚother_nr   s       €r   r   zPercussionChord.__eq__c   s]   ø€ õ ‰wŒw�~Š~˜eÑ$Ô$ð 	Ø�5å  ¤¨U¬[Ñ9Ô9ð 	ð 	‰MˆD�'Ø�wŠˆØ�u�uð àˆtr   c                ó&   — t          | ¦  «        dz	  S )Né   )Úid©r   s    r   Ú__hash__zPercussionChord.__hash__o   s   € Ý�$‰xŒx˜1‰}Ðr   Úreturnútuple[note.NotRest, ...]c                ó*   — t          | j        ¦  «        S ©N©Útupler   r!   s    r   r   zPercussionChord.notesr   s   € å�T”[Ñ!Ô!Ð!r   ÚnewNotesú$Iterable[note.Unpitched | note.Note]ÚNonec                óø   — t          j        |¦  «        st          d¦  «        ‚t          d„ |D ¦   «         ¦  «        st          d¦  «        ‚| j                             ¦   «          |                      |¦  «         dS )zH
        Sets notes to an iterable of Note or Unpitched objects
        z"notes must be set with an iterablec              3  ób   K  — | ]*}t          |t          j        t          j        f¦  «        V — Œ+d S r&   )Ú
isinstancer   Ú	UnpitchedÚNote)Ú.0r   s     r   ú	<genexpr>z(PercussionChord.notes.<locals>.<genexpr>}   s5   è è € ÐPÐPÀ!•:˜a¥$¤.µ$´)Ð!<Ñ=Ô=ÐPÐPÐPÐPÐPÐPr   zCevery element of notes must be a note.Note or note.Unpitched objectN)r   Ú
isIterableÚ	TypeErrorÚallr   ÚclearÚadd)r   r)   s     r   r   zPercussionChord.notesv   s‚   € õ
 Ô  Ñ*Ô*ð 	BÝÐ@ÑAÔAÐAÝÐPÐPÀxÐPÑPÔPÑPÔPð 	cÝÐaÑbÔbÐbØŒ×ÒÑÔÐØ�Š�ÑÔÐÐÐr   Ústrc                óâ  •— | j         s t          ¦   «                              ¦   «         S g }| j         D ]£}t          |t          j        ¦  «        r|                     |j        ¦  «         Œ7t          |t          j        ¦  «        rR|j	        r-|                     t          |j	        j        ¦  «        ¦  «         Œ…|                     d|j        › d�¦  «         Œ¤dd                     |¦  «        z   dz   S )Nz
unpitched[ú]ú[ú )r   r   Ú_reprInternalr.   r   r0   ÚappendÚnameWithOctaver/   ÚstoredInstrumentr8   ÚinstrumentNameÚdisplayNameÚjoin)r   ÚallNotesÚthisNoter   s      €r   r=   zPercussionChord._reprInternal‚   sê   ø€ ØŒzð 	+Ý‘7”7×(Ò(Ñ*Ô*Ð*àˆØœ
ð 	Jð 	JˆHÝ˜(¥D¤IÑ.Ô.ð JØ—’ Ô 7Ñ8Ô8Ð8Ð8Ý˜H¥d¤nÑ5Ô5ð JØÔ,ð JØ—O’O¥C¨Ô(AÔ(PÑ$QÔ$QÑRÔRÐRÐRà—O’OÐ$H°Ô1EÐ$HÐ$HÐ$HÑIÔIÐIøà�S—X’X˜hÑ'Ô'Ñ'¨#Ñ-Ð-r   útuple[pitch.Pitch, ...]c                óB   — t          d„ | j        D ¦   «         ¦  «        }|S )aQ  
        Get or set a list or tuple of all Pitch objects in this PercussionChord.

        Unpitched members (that at most have only display pitches) are ignored.

        >>> pChord = percussion.PercussionChord([note.Unpitched(displayName='D4'), note.Note('E5')])
        >>> pChord.pitches
        (<music21.pitch.Pitch E5>,)

        >>> pChord.pitches = [60]
        >>> pChord.pitches
        (<music21.pitch.Pitch C4>,)

        Notice that setting pitches has now just cleared any existing notes, pitched or unpitched:

        >>> pChord.notes
        (<music21.note.Note C>,)
        c              3  óX   K  — | ]%}t          |t          j        ¦  «        ¯|j        V — Œ&d S r&   )r.   r   r0   r   )r1   Ú	components     r   r2   z*PercussionChord.pitches.<locals>.<genexpr>§   sT   è è € ð 1^ð 1^Ø )½JÀyÕRVÔR[Ñ<\Ô<\ð1^ØŒOð1^ð 1^ð 1^ð 1^ð 1^ð 1^r   r'   )r   Úpitchess     r   rJ   zPercussionChord.pitches“   s=   € õ( ,1ð 1^ð 1^Ø-1¬[ð1^ñ 1^ô 1^ñ ,^ô ,^ˆàˆr   Úvalueút.Iterable[pitch.Pitch]c                óv   — g | _         |D ].}| j                              t          j        |¦  «        ¦  «         Œ/d S r&   )r   r>   r   r0   )r   rK   Úps      r   rJ   zPercussionChord.pitches«   sC   € àˆŒàð 	-ð 	-ˆAàŒK×Ò�tœy¨™|œ|Ñ,Ô,Ð,Ð,ð	-ð 	-r   r&   )r#   r$   )r)   r*   r#   r+   )r#   r8   )r#   rF   )rK   rL   r#   r+   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚisChordr   r   r"   Úpropertyr   Úsetterr=   rJ   Ú__classcell__)r   s   @r   r
   r
       s  ø€ € € € € ð9ð 9ðt €Gðð ð ð ð ð ð
ð 
ð 
ð 
ð 
ðð ð ð ð"ð "ð "ñ „Xð"ð „\ð	ð 	ð 	ñ „\ð	ð.ð .ð .ð .ð .ð .ð" ðð ð ñ „Xðð. „^ð-ð -ð -ñ „^ð-ð -ð -ð -ð -r   r
   c                  ó   — e Zd ZdS )ÚTestN)rO   rP   rQ   © r   r   rX   rX   ´   s   € € € € € Ø€Dr   rX   Ú__main__)rR   Ú
__future__r   Úcollections.abcr   ÚtypingÚtÚunittestÚmusic21r   r   r   ÚTYPE_CHECKINGr   Ú	ChordBaser
   ÚTestCaserX   rO   ÚmainTestrY   r   r   ú<module>re      s7  ððð ð
 #Ð "Ð "Ð "Ð "Ð "à $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð „?ð ØÐÐÐÐÐðQ-ð Q-ð Q-ð Q-ð Q-�e”oñ Q-ô Q-ð Q-ðh	ð 	ð 	ð 	ð 	ˆ8Ôñ 	ô 	ð 	ð ˆzÒÐØ€N€N€NØ€GÔ�TÑÔÐÐÐð Ðr   