§
    ƒØjÑ  ã                  óX   — d dl mZ d dlZdd„Zedk    rd dlZ ej        ¦   «          dS dS )é    )ÚannotationsNÚnamec                ó€   — t          j        ¦   «         }| j        D ]"}t          ||¦  «        }||xx         dz  cc<   Œ#|S )a  
    Return a collections.Counter of pitch class usage (count)
    by selecting an attribute of the Pitch object.

    * Changed in v4: Returns a collections.Counter object.

    >>> bach = corpus.parse('bach/bwv324.xml')
    >>> pcCount = analysis.pitchAnalysis.pitchAttributeCount(bach, 'pitchClass')
    >>> for n in sorted(pcCount):
    ...     print(f'{n:2d}: {pcCount[n]:2d}')
     0:  3
     2: 26
     3:  3
     4: 13
     6: 15
     7: 13
     9: 17
    11: 14

    List in most common order:

    >>> nameCount = analysis.pitchAnalysis.pitchAttributeCount(bach, 'name')
    >>> for n, count in nameCount.most_common(3):
    ...     print(f'{n:>2s}: {nameCount[n]:2d}')
     D: 26
     A: 17
    F#: 15

    >>> nameOctaveCount = analysis.pitchAnalysis.pitchAttributeCount(bach, 'nameWithOctave')
    >>> for n in sorted(nameOctaveCount):
    ...     print(f'{n:>3s}: {nameOctaveCount[n]:2d}')
     A2:  2
     A3:  5
     A4: 10
     B2:  3
     B3:  4
     B4:  7
     C3:  2
     C5:  1
    D#3:  1
    D#4:  2
    ...
    é   )ÚcollectionsÚCounterÚpitchesÚgetattr)ÚsÚ	pitchAttrÚpostÚpÚks        ú“/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/music21/analysis/pitchAnalysis.pyÚpitchAttributeCountr      sO   € õX ÔÑ Ô €DØŒYð ð ˆÝ�A�yÑ!Ô!ˆØˆQˆˆŒ�1‰ˆˆ‰ˆØ€Kó    Ú__main__)r   )Ú
__future__r   r   r   Ú__name__Úmusic21ÚmainTest© r   r   ú<module>r      so   ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð ð0ð 0ð 0ð 0ðf ˆzÒÐØ€N€N€NØ€GÔÑÔÐÐÐð Ðr   