§
    ƒØj1� ã            !      óˆ  — 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Zddl	m
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  ej        d¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z  G d „ d!ej        ¦  «        Z! G d"„ d#ej        ¦  «        Z" G d$„ d%ej        ¦  «        Z# G d&„ d'ej        ¦  «        Z$ G d(„ d)ej        ¦  «        Z% G d*„ d+ej        ¦  «        Z& G d,„ d-ej        ¦  «        Z' G d.„ d/ej        ¦  «        Z( G d0„ d1ej        ¦  «        Z) G d2„ d3ej        ¦  «        Z* G d4„ d5ej        ¦  «        Z+ G d6„ d7ej        ¦  «        Z, G d8„ d9ej        ¦  «        Z- G d:„ d;ej        ¦  «        Z. G d<„ d=ej        ¦  «        Z/ G d>„ d?ej        ¦  «        Z0 G d@„ dAej        ¦  «        Z1 G dB„ dCej        ¦  «        Z2 G dD„ dEej        ¦  «        Z3 G dF„ dGej        ¦  «        Z4 G dH„ dIej        ¦  «        Z5 G dJ„ dKej        ¦  «        Z6 G dL„ dMej        ¦  «        Z7 G dN„ dOej        ¦  «        Z8 G dP„ dQej        ¦  «        Z9 G dR„ dSej        ¦  «        Z: G dT„ dUej        ¦  «        Z; G dV„ dWej        ¦  «        Z< G dX„ dYej        ¦  «        Z= G dZ„ d[ej        ¦  «        Z> G d\„ d]ej        ¦  «        Z? G d^„ d_ej        ¦  «        Z@ G d`„ daej        ¦  «        ZA G db„ dcej        ¦  «        ZB G dd„ deej        ¦  «        ZC G df„ dgej        ¦  «        ZD G dh„ diej        ¦  «        ZE G dj„ dkej        ¦  «        ZF G dl„ dmej        ¦  «        ZG G dn„ doej        ¦  «        ZH G dp„ dqej        ¦  «        ZI G dr„ dsej        ¦  «        ZJ G dt„ duej        ¦  «        ZK G dv„ dwej        ¦  «        ZL G dx„ dyej        ¦  «        ZM G dz„ d{ej        ¦  «        ZN G d|„ d}ej        ¦  «        ZO G d~„ dej        ¦  «        ZP G d€„ d�ej        ¦  «        ZQ G d‚„ dƒej        ¦  «        ZR G d„„ d…ej        ¦  «        ZS G d†„ d‡ej        ¦  «        ZT G dˆ„ d‰ej        ¦  «        ZU G dŠ„ d‹ej        ¦  «        ZV G dŒ„ d�ej        ¦  «        ZW G dŽ„ d�ej        ¦  «        ZX G d�„ d‘ej        ¦  «        ZY G d’„ d“ej        ¦  «        ZZ G d”„ d•ej        ¦  «        Z[ G d–„ d—ej        ¦  «        Z\ G d˜„ d™ej        ¦  «        Z] G dš„ d›ej        ¦  «        Z^ G dœ„ d�ej        ¦  «        Z_ G dž„ dŸej        ¦  «        Z` G d „ d¡ej        ¦  «        Za G d¢„ d£ej        ¦  «        Zb G d¤„ d¥ej        ¦  «        Zc G d¦„ d§ej        ¦  «        Zd G d¨„ d©ej        ¦  «        Ze G dª„ d«ej        ¦  «        Zf G d¬„ d­ej        ¦  «        Zg G d®„ d¯ej        ¦  «        Zh G d°„ d±ej        ¦  «        Zi G d²„ d³ej        ¦  «        Zj G d´„ dµej        ¦  «        Zk G d¶„ d·ej        ¦  «        Zl G d¸„ d¹ej        ¦  «        Zm G dº„ d»ej        ¦  «        Zn G d¼„ d½ej        ¦  «        Zo G d¾„ d¿ej        ¦  «        Zp G dÀ„ dÁej        ¦  «        Zq G dÂ„ dÃej        ¦  «        Zr G dÄ„ dÅej        ¦  «        Zs G dÆ„ dÇej        ¦  «        Zt G dÈ„ dÉej        ¦  «        Zu G dÊ„ dËej        ¦  «        Zv G dÌ„ dÍej        ¦  «        Zw G dÎ„ dÏej        ¦  «        Zx G dÐ„ dÑej        ¦  «        Zy G dÒ„ dÓej        ¦  «        Zz G dÔ„ dÕej        ¦  «        Z{ G dÖ„ d×ej        ¦  «        Z| G dØ„ dÙej        ¦  «        Z} G dÚ„ dÛej        ¦  «        Z~ G dÜ„ dÝe~¦  «        Z G dÞ„ dße~¦  «        Z€ G dà„ dáe~¦  «        Z� G dâ„ dãe~¦  «        Z‚ G dä„ dåe~¦  «        Zƒ G dæ„ dçe~¦  «        Z„ G dè„ dée~¦  «        Z… G dê„ dëe~¦  «        Z† G dì„ díe~¦  «        Z‡ G dî„ dïe~¦  «        Zˆ G dð„ dñej‰        ¦  «        ZŠ edòdebecedeegfdódeteuevewexeyeze{e|e}ee€e�e‚eƒe„e…e†e‡eˆgfdôdeeeeeeeeee e!e"e#e$e%de&e'e(dgfdõde)e*e+e,e-e.e/e0e1e2e3e4e5e6e7e8e9e:e;e<e=e>e?e@eAdgfdög d‘eC‘eD‘eE‘eF‘eG‘eH‘eI‘eJ‘eK‘eL‘eM‘eN‘eO‘eP‘eQ‘d‘eR‘eS‘eT‘eU‘eV‘eW‘eX‘eY‘eZ‘d‘d‘d‘d‘e[‘e\‘e]‘e^‘e_‘e`‘ea‘fd÷defegeheiejekelemeneodepeqderddddesgfdøg dù¢fg¦  «        Z‹dú„ ZŒg e‘e‘e‘e‘e‘e‘e‘e‘e‘e ‘e!‘e"‘e#‘e$‘e%‘e&‘e'‘e(‘et‘ev‘ey‘e{‘e‘e€‘e�‘e‚‘eƒ‘e„‘e…‘e†‘e‡‘eˆ‘eQ‘eR‘eS‘eT‘eU‘eV‘eW‘eX‘eY‘eZ‘e[‘e\‘e]‘e^‘e_‘e`‘ea‘ef‘eg‘eh‘e)‘e*‘e+‘e,‘e-‘e.‘e/‘e0‘e1‘e2‘e3‘e4‘e5‘e6‘e7‘e8‘e;‘e<‘e=‘e>‘Z�dû„ ZŽ G dü„ dýej�        ¦  «        Z�e‘dþk    rddlZ ej’        e�¦  «         dS dS )ÿz 
The features implemented here are based on those found in jSymbolic and
defined in Cory McKay's MA Thesis, "Automatic Genre Classification of MIDI Recordings"
é    )Úannotations)ÚOrderedDictN)Úisclose)Údedent)Úbase)Úenvironment)Úexceptions21)Ú
Instrumentzfeatures.jSymbolicc                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMelodicIntervalHistogramFeatureaE  
    A features array with bins corresponding to the values of the melodic interval histogram.

    128 dimensions

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MelodicIntervalHistogramFeature(s)
    >>> f = fe.extract()
    >>> f.vector[0:5]
    [0.144..., 0.220..., 0.364..., 0.062..., 0.050...]
    ÚM1Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )NÚdataOrStreamzMelodic Interval HistogramzYA features array with bins corresponding to the values of the melodic interval histogram.Té€   © ©ÚsuperÚ__init__ÚnameÚdescriptionÚisSequentialÚ
dimensionsÚ	normalize©Úselfr   ÚkeywordsÚ	__class__s      €ú�/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/music21/features/jSymbolic.pyr   z(MelodicIntervalHistogramFeature.__init__6   sQ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à0ˆŒ	ðLˆÔà ˆÔØˆŒØˆŒˆˆó    c                ód   — t          | j        d         ¦  «        D ]\  }}|| j        j        |<   ŒdS )úE
        Do processing necessary, storing result in feature.
        ÚmidiIntervalHistogramN)Ú	enumerateÚdataÚfeatureÚvector)r   ÚiÚvalues      r   Úprocessz'MelodicIntervalHistogramFeature.process@   sC   € õ " $¤)Ð,CÔ"DÑEÔEð 	+ð 	+‰HˆAˆuØ%*ˆDŒLÔ Ñ"Ð"ð	+ð 	+r   ©N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úidr   r)   Ú__classcell__©r   s   @r   r   r   (   s]   ø€ € € € € ð
ð 
ð 
€Bðð ð ð ð ð ð+ð +ð +ð +ð +ð +ð +r   r   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚAverageMelodicIntervalFeaturezÐ
    Average melodic interval (in semitones).

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.AverageMelodicIntervalFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [2.44...]
    ÚM2Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zAverage Melodic Intervalz(Average melodic interval (in semitones).Té   r   ©r   r   r   r   r   r   r   s      €r   r   z&AverageMelodicIntervalFeature.__init__T   sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ØEˆÔØ ˆÔØˆŒˆˆr   c                ó  — g }| j         d         }t          |¦  «        D ],\  }}t          |¦  «        D ]}|                     |¦  «         ŒŒ-|st	          d¦  «        ‚t          |¦  «        t          |¦  «        z  | j        j        d<   dS ©r!   r"   úinput lacks notesr   N)	r$   r#   ÚrangeÚappendÚJSymbolicFeatureExceptionÚsumÚlenr%   r&   )r   ÚvaluesÚhistor'   r(   Újs         r   r)   z%AverageMelodicIntervalFeature.process\   sž   € ð ˆà”	Ð1Ô2ˆÝ! %Ñ(Ô(ð 	!ð 	!‰HˆAˆuÝ˜5‘\”\ð !ð !�Ø—’˜aÑ Ô Ð Ð ð!àð 	AÝ+Ð,?Ñ@Ô@Ð@Ý!$ V¡¤­s°6©{¬{Ñ!:ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r4   r4   H   s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð;ð ;ð ;ð ;ð ;ð ;ð ;r   r4   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú MostCommonMelodicIntervalFeaturez 

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MostCommonMelodicIntervalFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [2]
    ÚM3Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMost Common Melodic Intervalz,Melodic interval with the highest frequency.Tr7   r   r8   r   s      €r   r   z)MostCommonMelodicIntervalFeature.__init__v   sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à2ˆŒ	ØIˆÔØ ˆÔØˆŒˆˆr   c                ó†   — | j         d         }t          |¦  «        }|                     |¦  «        }|| j        j        d<   dS ©r!   r"   r   N)r$   ÚmaxÚindexr%   r&   )r   rB   ÚmaxValueÚmaxIndexs       r   r)   z(MostCommonMelodicIntervalFeature.process~   sB   € ð
 ”	Ð1Ô2ˆÝ�u‘:”:ˆØ—;’;˜xÑ(Ô(ˆØ!)ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rE   rE   k   s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð*ð *ð *ð *ð *ð *ð *r   rE   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú0DistanceBetweenMostCommonMelodicIntervalsFeaturez°

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.DistanceBetweenMostCommonMelodicIntervalsFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [1]
    ÚM4Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z.Distance Between Most Common Melodic IntervalszvAbsolute value of the difference between the most common melodic interval and the second most common melodic interval.Tr7   r   r8   r   s      €r   r   z9DistanceBetweenMostCommonMelodicIntervalsFeature.__init__•   sK   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àDˆŒ	ð7ˆÔð !ˆÔØˆŒˆˆr   c                ó  — t          j        | j        d         ¦  «        }t          |¦  «        }|                     |¦  «        }d||<   t          |¦  «        }|                     |¦  «        }t          ||z
  ¦  «        | j        j        d<   dS rI   )ÚcopyÚdeepcopyr$   rJ   rK   Úabsr%   r&   )r   rB   rL   rM   ÚsecondValueÚsecondIndexs         r   r)   z8DistanceBetweenMostCommonMelodicIntervalsFeature.processŸ   s~   € õ
 ”˜dœiÐ(?Ô@ÑAÔAˆÝ�u‘:”:ˆØ—;’;˜xÑ(Ô(ˆØˆˆh‰Ý˜%‘j”jˆØ—k’k +Ñ.Ô.ˆå!$ X°Ñ%;Ñ!<Ô!<ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rO   rO   ‰   s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð=ð =ð =ð =ð =ð =ð =r   rO   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú*MostCommonMelodicIntervalPrevalenceFeaturezü
    Fraction of melodic intervals that belong to the most common interval.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MostCommonMelodicIntervalPrevalenceFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.364...]
    ÚM5Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z'Most Common Melodic Interval PrevalencezFFraction of melodic intervals that belong to the most common interval.Tr7   r   r8   r   s      €r   r   z3MostCommonMelodicIntervalPrevalenceFeature.__init__»   sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à=ˆŒ	ØcˆÔØ ˆÔØˆŒˆˆr   c                óÆ   — t          j        | j        d         ¦  «        }t          |¦  «        }t	          |¦  «        }|st          d¦  «        ‚||z  | j        j        d<   dS r:   )rS   rT   r$   rJ   r?   r>   r%   r&   )r   rB   rL   Úcounts       r   r)   z2MostCommonMelodicIntervalPrevalenceFeature.processÃ   sc   € õ
 ”˜dœiÐ(?Ô@ÑAÔAˆÝ�u‘:”:ˆÝ�E‘
”
ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@Ø!)¨EÑ!1ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rY   rY   ®   s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð
2ð 
2ð 
2ð 
2ð 
2ð 
2ð 
2r   rY   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú,RelativeStrengthOfMostCommonIntervalsFeaturez³

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.RelativeStrengthOfMostCommonIntervalsFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.603...]
    ÚM6Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z*Relative Strength of Most Common Intervalsz Fraction of melodic intervals that belong to the second most common interval divided by the fraction of melodic intervals belonging to the most common interval.Tr7   r   r8   r   s      €r   r   z5RelativeStrengthOfMostCommonIntervalsFeature.__init__Ü   sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à@ˆŒ	ðcˆÔð !ˆÔØˆŒˆˆr   c                ó$  — t          j        | j        d         ¦  «        }t          |¦  «        }t	          |¦  «        }|                     |¦  «        }d||<   t	          |¦  «        }|st          d¦  «        ‚||z  ||z  z  | j        j        d<   dS )r!   r"   r   r;   N)	rS   rT   r$   r?   rJ   rK   r>   r%   r&   )r   rB   r]   rL   rM   rV   s         r   r)   z4RelativeStrengthOfMostCommonIntervalsFeature.processæ   s’   € õ
 ”˜dœiÐ(?Ô@ÑAÔAˆÝ�E‘
”
ˆÝ�u‘:”:ˆØ—;’;˜xÑ(Ô(ˆØˆˆh‰Ý˜%‘j”jˆàð 	AÝ+Ð,?Ñ@Ô@Ð@Ø"-°Ñ"5¸(ÀUÑ:JÑ!KˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r_   r_   Ð   sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðLð Lð Lð Lð Lð Lð Lr   r_   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú%NumberOfCommonMelodicIntervalsFeaturezú
    Number of melodic intervals that represent at least 9% of all melodic intervals.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.NumberOfCommonMelodicIntervalsFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [3]
    ÚM7Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z"Number of Common Melodic IntervalszPNumber of melodic intervals that represent at least 9% of all melodic intervals.Tr7   r   r8   r   s      €r   r   z.NumberOfCommonMelodicIntervalsFeature.__init__  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à8ˆŒ	ðDˆÔà ˆÔØˆŒˆˆr   c                óÈ   — | j         d         }t          |¦  «        }|st          d¦  «        ‚d}t          |¦  «        D ]\  }}||z  dk    r|dz  }Œ|| j        j        d<   dS )r!   r"   r;   r   ç
×£p=
·?r7   N)r$   r?   r>   r#   r%   r&   )r   rB   ÚtotalÚpostr'   r]   s         r   r)   z-NumberOfCommonMelodicIntervalsFeature.process  s‚   € ð ”	Ð1Ô2ˆÝ�E‘
”
ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆÝ! %Ñ(Ô(ð 	ð 	‰HˆAˆuØ�u‰} Ò$Ð$Ø˜‘	�øØ!%ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rd   rd   ÷   s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð&ð &ð &ð &ð &ð &ð &r   rd   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚAmountOfArpeggiationFeatureaƒ  
    Fraction of horizontal intervals that are repeated notes, minor thirds, major thirds,
    perfect fifths, minor sevenths, major sevenths, octaves, minor tenths or major tenths.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.AmountOfArpeggiationFeature(s)
    >>> f = fe.extract()
    >>> f.name
    'Amount of Arpeggiation'
    >>> f.vector
    [0.333...]
    ÚM8Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zAmount of Arpeggiationz¬Fraction of horizontal intervals that are repeated notes, minor thirds, major thirds, perfect fifths, minor sevenths, major sevenths, octaves, minor tenths or major tenths.Tr7   r   r8   r   s      €r   r   z$AmountOfArpeggiationFeature.__init__*  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à,ˆŒ	ðUˆÔð !ˆÔØˆŒˆˆr   c                óÞ   — | j         d         }t          |¦  «        }|dk    rdS g d¢}t          |¦  «        }d}|D ]}|||         z  }Œ|st          d¦  «        ‚||z  | j        j        d<   dS )r!   r"   r   N)	r   é   é   é   é
   é   é   é   é   r;   ©r$   r?   r>   r%   r&   ©r   rB   ri   Útargetsr]   Úts         r   r)   z#AmountOfArpeggiationFeature.process4  s•   € ð ”	Ð1Ô2ˆÝ�E‘
”
ˆØ�AŠ:ˆ:ØˆFà2Ð2Ð2ˆÝ�E‘
”
ˆØˆØð 	ð 	ˆAØ�U˜1”XÑˆEˆEØð 	AÝ+Ð,?Ñ@Ô@Ð@Ø!&¨¡ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rl   rl     s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð/ð /ð /ð /ð /ð /ð /r   rl   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚRepeatedNotesFeaturezÏ
    Fraction of notes that are repeated melodically

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.RepeatedNotesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.144...]
    ÚM9Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zRepeated Notesz0Fraction of notes that are repeated melodically.Tr7   r   r8   r   s      €r   r   zRepeatedNotesFeature.__init__S  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à$ˆŒ	ØMˆÔØ ˆÔØˆŒˆˆr   c                óÜ   — | j         d         }t          |¦  «        }|dk    rdS dg}t          |¦  «        }|st          d¦  «        ‚d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r   Nr;   rx   ry   s         r   r)   zRepeatedNotesFeature.process[  s‘   € ð ”	Ð1Ô2ˆÝ�E‘
”
ˆØ�AŠ:ˆ:ØˆFà�#ˆÝ�E‘
”
ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆØð 	ð 	ˆAØ�U˜1”XÑˆEˆEØ!&¨¡ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r}   r}   G  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð/ð /ð /ð /ð /ð /ð /r   r}   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚChromaticMotionFeaturezÜ
    Fraction of melodic intervals corresponding to a semitone.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.ChromaticMotionFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.220...]
    Úm10Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zChromatic Motionz;Fraction of melodic intervals corresponding to a semi-tone.Tr7   r   r8   r   s      €r   r   zChromaticMotionFeature.__init__z  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à&ˆŒ	ØXˆÔØ ˆÔØˆŒˆˆr   c                ó®   — | j         d         }t          |¦  «        }|st          d¦  «        ‚dg}d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r;   r7   r   Nrx   ry   s         r   r)   zChromaticMotionFeature.process‚  óx   € ð ”	Ð1Ô2ˆÝ�E‘
”
ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@à�#ˆØˆØð 	ð 	ˆAØ�U˜1”XÑˆEˆEØ!&¨¡ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r‚   r‚   n  ó]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð/ð /ð /ð /ð /ð /ð /r   r‚   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚStepwiseMotionFeaturezë
    Fraction of melodic intervals that corresponded to a minor or major second

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.StepwiseMotionFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.584...]
    ÚM11Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zStepwise MotionzKFraction of melodic intervals that corresponded to a minor or major second.Tr7   r   r8   r   s      €r   r   zStepwiseMotionFeature.__init__ž  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à%ˆŒ	ð:ˆÔà ˆÔØˆŒˆˆr   c                ó°   — | j         d         }t          |¦  «        }|st          d¦  «        ‚ddg}d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r;   r7   é   r   Nrx   ry   s         r   r)   zStepwiseMotionFeature.process§  óz   € ð ”	Ð1Ô2ˆÝ�E‘
”
ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@à�a�&ˆØˆØð 	ð 	ˆAØ�U˜1”XÑˆEˆEØ!&¨¡ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r‰   r‰   ’  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð/ð /ð /ð /ð /ð /ð /r   r‰   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMelodicThirdsFeaturezÜ
    Fraction of melodic intervals that are major or minor thirds

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MelodicThirdsFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.113...]
    ÚM12Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMelodic Thirdsz=Fraction of melodic intervals that are major or minor thirds.Tr7   r   r8   r   s      €r   r   zMelodicThirdsFeature.__init__Ã  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à$ˆŒ	ØZˆÔØ ˆÔØˆŒˆˆr   c                ó°   — | j         d         }t          |¦  «        }|st          d¦  «        ‚ddg}d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r;   rp   rq   r   Nrx   ry   s         r   r)   zMelodicThirdsFeature.processË  rŽ   r   r*   r+   r2   s   @r   r�   r�   ·  r‡   r   r�   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMelodicFifthsFeaturezÕ
    Fraction of melodic intervals that are perfect fifths

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MelodicFifthsFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.056...]
    ÚM13Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMelodic Fifthsz6Fraction of melodic intervals that are perfect fifths.Tr7   r   r8   r   s      €r   r   zMelodicFifthsFeature.__init__ç  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à$ˆŒ	ØSˆÔØ ˆÔØˆŒˆˆr   c                ó®   — | j         d         }t          |¦  «        }|st          d¦  «        ‚dg}d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r;   rr   r   Nrx   ry   s         r   r)   zMelodicFifthsFeature.processï  r†   r   r*   r+   r2   s   @r   r•   r•   Û  r‡   r   r•   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMelodicTritonesFeaturezÑ
    Fraction of melodic intervals that are tritones

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MelodicTritonesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.012...]
    ÚM14Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMelodic Tritonesz0Fraction of melodic intervals that are tritones.Tr7   r   r8   r   s      €r   r   zMelodicTritonesFeature.__init__  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à&ˆŒ	ØMˆÔØ ˆÔØˆŒˆˆr   c                ó®   — | j         d         }t          |¦  «        }|st          d¦  «        ‚dg}d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r;   é   r   Nrx   ry   s         r   r)   zMelodicTritonesFeature.process  r†   r   r*   r+   r2   s   @r   rš   rš   ÿ  r‡   r   rš   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMelodicOctavesFeaturezÏ
    Fraction of melodic intervals that are octaves

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MelodicOctavesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.018...]
    ÚM15Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMelodic Octavesz/Fraction of melodic intervals that are octaves.Tr7   r   r8   r   s      €r   r   zMelodicOctavesFeature.__init__/  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à%ˆŒ	ØLˆÔØ ˆÔØˆŒˆˆr   c                ó°   — | j         d         }t          |¦  «        }|st          d¦  «        ‚g d¢}d}|D ]}|||         z  }Œ||z  | j        j        d<   dS )r!   r"   r;   )	ru   é   é0   é<   éH   éT   é`   él   éx   r   Nrx   ry   s         r   r)   zMelodicOctavesFeature.process7  s|   € ð ”	Ð1Ô2ˆÝ�E‘
”
ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@à8Ð8Ð8ˆØˆØð 	ð 	ˆAØ�U˜1”XÑˆEˆEØ!&¨¡ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r    r    #  r‡   r   r    c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚDirectionOfMotionFeaturea  
    Returns the fraction of melodic intervals that are rising rather than falling.
    Unisons are omitted.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.DirectionOfMotionFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.470...]
    Úm17Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zDirection of MotionzBFraction of melodic intervals that are rising rather than falling.Tr7   r   r8   r   s      €r   r   z!DirectionOfMotionFeature.__init__T  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à)ˆŒ	Ø_ˆÔØ ˆÔØˆŒˆˆr   c                óž  — d}d}g }| j         j        dk    rKt          | j         j        ¦  «        D ]0}| j         d         |         d         }|                     |¦  «         Œ1n"| j         d         }|                     |¦  «         |D ]}|D ]}|dk    r|dz  }Œ|dk     r|dz  }ŒŒ|s|st	          d¦  «        ‚|||z   z  | j        j        d<   dS )r!   r   ÚpartsÚcontourListr7   r;   N)r$   Ú
partsCountr<   r=   r>   r%   r&   )r   ÚrisingÚfallingÚcBundler'   ÚcListÚcs          r   r)   z DirectionOfMotionFeature.process\  s  € ð ˆØˆØˆØŒ9Ô !Ò#Ð#Ý˜4œ9Ô/Ñ0Ô0ð &ð &�Øœ	 'Ô*¨1Ô-¨mÔ<�Ø—’˜uÑ%Ô%Ð%Ð%ð&ð ”I˜mÔ,ˆEØ�NŠN˜5Ñ!Ô!Ð!àð 	!ð 	!ˆEØð !ð !�Ø�q’5�5Ø˜a‘K�F�FØ˜’U�UØ˜q‘L�Gøð	!ð
 ð 	A˜6ð 	AÝ+Ð,?Ñ@Ô@Ð@Ø!'¨7°VÑ+;Ñ!<ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r­   r­   G  s]   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ð=ð =ð =ð =ð =ð =ð =r   r­   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚDurationOfMelodicArcsFeaturea  
    Average number of notes that separate melodic peaks and troughs
    in any part. This is calculated as the total number of intervals
    (not counting unisons) divided by the number of times the melody
    changes direction.

    Example: C D E D C D E C C
    Intervals: [0] 2 2 -2 -2 2 2 -4 0
    Changes direction (equivalent to +/- sign) three times.
    There are seven non-unison (nonzero) intervals.
    Thus, the duration of arcs is 7/3 ~= 2.333...

    >>> s = converter.parse("tinyNotation: c' d' e' d' c' d' e'2 c'2 c'2")
    >>> fe = features.jSymbolic.DurationOfMelodicArcsFeature(s)
    >>> fe.extract().vector
    [2.333...]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.DurationOfMelodicArcsFeature(s)
    >>> fe.extract().vector
    [1.74...]
    ÚM18Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zDuration of Melodic ArcszÔAverage number of notes that separate melodic peaks and troughs in any part. This is calculated as the total number of intervals (not counting unisons) divided by the number of times the melody changes direction.Tr7   r   r8   r   s      €r   r   z%DurationOfMelodicArcsFeature.__init__�  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ðSˆÔð !ˆÔØˆŒˆˆr   c                óò  — g }| j         j        dk    rKt          | j         j        ¦  «        D ]0}| j         d         |         d         }|                     |¦  «         Œ1n"| j         d         }|                     |¦  «         d}d}d}d}d}|D ]M}|}	|D ]F}
|
dk    r|dz  }|	|k    r|
dk     r|dz  }|}	Œ!|	|k    r|
dk    r|dz  }|}	Œ5|
dk    r|}	Œ>|
dk     r|}	ŒGŒN|dk    rd}n||z  }|| j        j        d<   dS ©r!   r   r±   r²   r7   éÿÿÿÿN)r$   r³   r<   r=   r%   r&   )r   r¶   r'   r·   Údirection_changesÚnonUnison_intervalsÚ	ASCENDINGÚ
DESCENDINGÚ
STATIONARYÚcurrent_directionÚintervalÚduration_of_melodic_arcss               r   r)   z$DurationOfMelodicArcsFeature.processš  s„  € ð ˆØŒ9Ô !Ò#Ð#Ý˜4œ9Ô/Ñ0Ô0ð &ð &�Øœ	 'Ô*¨1Ô-¨mÔ<�Ø—’˜uÑ%Ô%Ð%Ð%ð&ð ”I˜mÔ,ˆEØ�NŠN˜5Ñ!Ô!Ð!àÐØÐð ˆ	Øˆ
Øˆ
Øð 	7ð 	7ˆEØ *ÐØ!ð 7ð 7�Ø˜q’=�=Ø'¨1Ñ,Ð'Ø$¨	Ò1Ð1Ø !’|�|Ø)¨QÑ.Ð)Ø,6Ð)øØ&¨*Ò4Ð4Ø !’|�|Ø)¨QÑ.Ð)Ø,5Ð)øà !’|�|Ø,5Ð)Ð)Ø! Aš˜Ø,6Ð)øð7ð"  Ò!Ð!Ø'(Ð$Ð$à':Ð=NÑ'NÐ$Ø!9ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rº   rº   v  s]   ø€ € € € € ðð ð, 
€Bð	ð 	ð 	ð 	ð 	ð 	ð/:ð /:ð /:ð /:ð /:ð /:ð /:r   rº   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚSizeOfMelodicArcsFeatureaE  
    Average span (in semitones) between melodic peaks and troughs
    in any part. Each time the melody changes direction begins a
    new arc. The average size of melodic arcs is defined as the
    total size of melodic intervals between changes of directions -
    or between the start of the melody and the first change of
    direction - divided by the number of direction changes.

    Example: C D E D C E D C C
    Intervals: [0] 2 2 -2 -2 2 2 -4 0
    Changes direction (equivalent to +/- sign) three times.
    The total sum of interval distance up to the last change
    of direction is 12. We don't count the last interval,
    the descending major third, because it is not between
    changes of direction.
    Thus, the average size of melodic arcs is 12/3 = 4.

    >>> s = converter.parse("tinyNotation: c' d' e' d' c' d' e'2 c'2 c'2")
    >>> fe = features.jSymbolic.SizeOfMelodicArcsFeature(s)
    >>> fe.extract().vector
    [4.0]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.SizeOfMelodicArcsFeature(s)
    >>> fe.extract().vector
    [4.84...]
    ÚM19Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zSize of Melodic Arcsae  Average span (in semitones) between melodic peaks and troughs in any part. Each time the melody changes direction begins a new arc. The average size ofmelodic arcs is defined as the total size of melodicintervals between changes of directions - or betweenthe start of the melody and the first change ofdirection - divided by the number of direction changes.Tr7   r   r8   r   s      €r   r   z!SizeOfMelodicArcsFeature.__init__ê  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à*ˆŒ	ðVˆÔð !ˆÔØˆŒˆˆr   c                óÜ  — g }| j         j        dk    rKt          | j         j        ¦  «        D ]0}| j         d         |         d         }|                     |¦  «         Œ1n"| j         d         }|                     |¦  «         d}d}d}d}d}|D ]Â}|}	d}
|D ]¹}|	|k    r;|dk    r|
t	          |¦  «        z  }
Œ!|dk     r||
z  }|dz  }|}	t	          |¦  «        }
ŒC|	|k    r;|dk     r|
t	          |¦  «        z  }
Œb|dk    r||
z  }|dz  }|}	t	          |¦  «        }
Œ„|dk    r|}	|
t	          |¦  «        z  }
ŒŸ|dk     r|}	|
t	          |¦  «        z  }
ŒºŒÃ|dk    rd}n||z  }|| j        j        d<   dS r¾   )r$   r³   r<   r=   rU   r%   r&   )r   r¶   r'   r·   rÀ   Úsum_of_intervalsrÂ   rÃ   rÄ   rÅ   Úthis_arc_intervalrÆ   Úsize_of_melodic_arcss                r   r)   z SizeOfMelodicArcsFeature.processø  s  € ð ˆØŒ9Ô !Ò#Ð#Ý˜4œ9Ô/Ñ0Ô0ð &ð &�Øœ	 'Ô*¨1Ô-¨mÔ<�Ø—’˜uÑ%Ô%Ð%Ð%ð&ð ”I˜mÔ,ˆEØ�NŠN˜5Ñ!Ô!Ð!àÐØÐð ˆ	Øˆ
Øˆ
Øð 	;ð 	;ˆEØ *ÐØ !ÐØ!ð ;ð ;�Ø$¨	Ò1Ð1Ø !’|�|Ø)­S°©]¬]Ñ:Ð)Ð)Ø! Aš˜à(Ð,=Ñ=Ð(Ø)¨QÑ.Ð)Ø,6Ð)å,/°©M¬MÐ)øØ&¨*Ò4Ð4Ø !’|�|Ø)­S°©]¬]Ñ:Ð)Ð)Ø! Aš˜à(Ð,=Ñ=Ð(Ø)¨QÑ.Ð)Ø,5Ð)å,/°©M¬MÐ)øà !’|�|Ø,5Ð)Ø)­S°©]¬]Ñ:Ð)Ð)Ø! Aš˜Ø,6Ð)Ø)­S°©]¬]Ñ:Ð)øð7;ð<  Ò!Ð!Ø#$Ð Ð à#3Ð6GÑ#GÐ Ø!5ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rÉ   rÉ   Ì  s]   ø€ € € € € ðð ð6 
€Bðð ð ð ð ð ð=6ð =6ð =6ð =6ð =6ð =6ð =6r   rÉ   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú MostCommonPitchPrevalenceFeaturezØ
    Fraction of Notes corresponding to the most common pitch.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MostCommonPitchPrevalenceFeature(s)
    >>> fe.extract().vector[0]
    0.116...
    ÚP1Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zMost Common Pitch Prevalencez<Fraction of Note Ons corresponding to the most common pitch.Tr7   Fr   ©r   r   r   r   r   r   Údiscreter   s      €r   r   z)MostCommonPitchPrevalenceFeature.__init__G  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à2ˆŒ	ØYˆÔØ ˆÔØˆŒØˆŒˆˆr   c                óê   — | j         d         }|st          d¦  «        ‚t          |                     ¦   «         ¦  «        }t	          |                     ¦   «         ¦  «        }||z  | j        j        d<   dS ©r!   úpitches.midiPitchHistogramr;   r   N)r$   r>   rJ   rA   r?   r%   r&   )r   rB   ÚpcMaxÚpcCounts       r   r)   z(MostCommonPitchPrevalenceFeature.processP  sn   € ð ”	Ð6Ô7ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@õ �E—L’L‘N”NÑ#Ô#ˆÝ�e—l’l‘n”nÑ%Ô%ˆà!&¨¡ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rÑ   rÑ   <  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð1ð 1ð 1ð 1ð 1ð 1ð 1r   rÑ   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú%MostCommonPitchClassPrevalenceFeaturezâ
    Fraction of Notes corresponding to the most common pitch class.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MostCommonPitchClassPrevalenceFeature(s)
    >>> fe.extract().vector
    [0.196...]
    ÚP2Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   z"Most Common Pitch Class PrevalencezBFraction of Note Ons corresponding to the most common pitch class.Tr7   Fr   rÔ   r   s      €r   r   z.MostCommonPitchClassPrevalenceFeature.__init__j  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à8ˆŒ	Ø_ˆÔØ ˆÔØˆŒØˆŒˆˆr   c                óÔ   — | j         d         }|                     t          |¦  «        ¦  «        }t          |¦  «        }|st	          d¦  «        ‚||         |z  | j        j        d<   dS ©r!   úpitches.pitchClassHistogramr;   r   N)r$   rK   rJ   r?   r>   r%   r&   )r   rB   ÚpcrÚ   s       r   r)   z-MostCommonPitchClassPrevalenceFeature.processs  sk   € ð ”	Ð7Ô8ˆð �[Š[�˜U™œÑ$Ô$ˆÝ�e‘*”*ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@à!& r¤¨WÑ!4ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rÜ   rÜ   _  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð5ð 5ð 5ð 5ð 5ð 5ð 5r   rÜ   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú#RelativeStrengthOfTopPitchesFeaturezþ
    The frequency of the 2nd most common pitch divided by the frequency of the most common pitch.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.RelativeStrengthOfTopPitchesFeature(s)
    >>> fe.extract().vector
    [0.947...]
    ÚP3Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   z Relative Strength of Top Pitchesz]The frequency of the 2nd most common pitch divided by the frequency of the most common pitch.Tr7   Fr   rÔ   r   s      €r   r   z,RelativeStrengthOfTopPitchesFeature.__init__�  sQ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à6ˆŒ	ðQˆÔà ˆÔØˆŒØˆŒˆˆr   c                ó6  — | j         d         }	 |                     d¦  «        dd…         \  }}t          |d         |d         z  ¦  «        | j        j        d<   dS # t
          $ r t          d¦  «        ‚t          t          f$ r d| j        j        d<   Y dS w xY w)r!   rØ   r�   Nr7   r   r;   ç        )	r$   Úmost_commonÚfloatr%   r&   ÚZeroDivisionErrorr>   Ú
IndexErrorÚ
ValueError©r   rB   ÚpMaxÚpSeconds       r   r)   z+RelativeStrengthOfTopPitchesFeature.process—  s¼   € ð ”	Ð6Ô7ˆð	)Ø!×-Ò-¨aÑ0Ô0°°!°Ô4‰MˆD�'Ý%*¨7°1¬:¸¸Q¼Ñ+?Ñ%@Ô%@ˆDŒLÔ Ñ"Ð"Ð"øÝ ð 	Að 	Að 	AÝ+Ð,?Ñ@Ô@Ð@Ý�JÐ'ð 	)ð 	)ð 	)Ø%(ˆDŒLÔ Ñ"Ð"Ð"Ð"ð	)øøøs   �AA Á8BÂBr*   r+   r2   s   @r   rä   rä   ‚  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð)ð )ð )ð )ð )ð )ð )r   rä   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú(RelativeStrengthOfTopPitchClassesFeaturez¡

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.RelativeStrengthOfTopPitchClassesFeature(s)
    >>> fe.extract().vector
    [0.906...]
    ÚP4Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   z&Relative Strength of Top Pitch ClassesziThe frequency of the 2nd most common pitch class divided by the frequency of the most common pitch class.Tr7   Fr   rÔ   r   s      €r   r   z1RelativeStrengthOfTopPitchClassesFeature.__init__±  sQ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à<ˆŒ	ðWˆÔà ˆÔØˆŒØˆŒˆˆr   c                ó<  — t          j        | j        d         ¦  «        }|                     t	          |¦  «        ¦  «        }||         }|st          d¦  «        ‚d||<   |                     t	          |¦  «        ¦  «        }||         }||z  | j        j        d<   dS rà   )rS   rT   r$   rK   rJ   r>   r%   r&   )r   rB   Ú	pIndexMaxÚ	pCountMaxÚpIndexSecondÚpCountSeconds         r   r)   z0RelativeStrengthOfTopPitchClassesFeature.process»  s›   € õ
 ”˜dœiÐ(EÔFÑGÔGˆð —K’K¥ E¡
¤
Ñ+Ô+ˆ	Ø˜)Ô$ˆ	Øð 	AÝ+Ð,?Ñ@Ô@Ð@àˆˆiÑØ—{’{¥3 u¡:¤:Ñ.Ô.ˆØ˜\Ô*ˆà!-°	Ñ!9ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rò   rò   §  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð:ð :ð :ð :ð :ð :ð :r   rò   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú&IntervalBetweenStrongestPitchesFeaturezö
    Absolute value of the difference between the pitches of the two most common MIDI pitches.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.IntervalBetweenStrongestPitchesFeature(s)
    >>> fe.extract().vector
    [5]
    ÚP5Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z"Interval Between Strongest PitcheszYAbsolute value of the difference between the pitches of the two most common MIDI pitches.Tr7   r   r8   r   s      €r   r   z/IntervalBetweenStrongestPitchesFeature.__init__Ú  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à8ˆŒ	ðOˆÔà ˆÔØˆŒˆˆr   c                ó  — | j         d         }	 |                     d¦  «        dd…         \  }}t          |d         |d         z
  ¦  «        | j        j        d<   dS # t
          t          f$ r d| j        j        d<   Y dS w xY w)r!   rØ   r�   Nr   rè   )r$   ré   rU   r%   r&   rì   rí   rî   s       r   r)   z.IntervalBetweenStrongestPitchesFeature.processã  s˜   € ð ”	Ð6Ô7ˆð	)Ø!×-Ò-¨aÑ0Ô0°°!°Ô4‰MˆD�'Ý%(¨°¬°d¸1´gÑ)=Ñ%>Ô%>ˆDŒLÔ Ñ"Ð"Ð"øå�JÐ'ð 	)ð 	)ð 	)Ø%(ˆDŒLÔ Ñ"Ð"Ð"Ð"ð	)øøøs   �AA Á B Á?B r*   r+   r2   s   @r   rû   rû   Ï  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð)ð )ð )ð )ð )ð )ð )r   rû   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú+IntervalBetweenStrongestPitchClassesFeaturez�

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.IntervalBetweenStrongestPitchClassesFeature(s)
    >>> fe.extract().vector
    [5]
    ÚP6Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z(Interval Between Strongest Pitch ClasseszeAbsolute value of the difference between the pitch classes of the two most common MIDI pitch classes.Tr7   r   r8   r   s      €r   r   z4IntervalBetweenStrongestPitchClassesFeature.__init__ý  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à>ˆŒ	ðQˆÔà ˆÔØˆŒˆˆr   c                ó  — t          j        | j        d         ¦  «        }|                     t	          |¦  «        ¦  «        }d||<   |                     t	          |¦  «        ¦  «        }t          ||z
  ¦  «        | j        j        d<   dS ©r!   rá   r   N)rS   rT   r$   rK   rJ   rU   r%   r&   )r   rB   rö   rø   s       r   r)   z3IntervalBetweenStrongestPitchClassesFeature.process  sy   € õ ”˜dœiÐ(EÔFÑGÔGˆð —K’K¥ E¡
¤
Ñ+Ô+ˆ	àˆˆiÑØ—{’{¥3 u¡:¤:Ñ.Ô.ˆõ "% Y°Ñ%=Ñ!>Ô!>ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r   r   ò  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   r   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚNumberOfCommonPitchesFeaturezÜ
    Number of pitches that account individually for at least 9% of all notes.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.NumberOfCommonPitchesFeature(s)
    >>> fe.extract().vector
    [3]
    ÚP7Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zNumber of Common PitcheszINumber of pitches that account individually for at least 9% of all notes.Tr7   r   r8   r   s      €r   r   z%NumberOfCommonPitchesFeature.__init__!  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ð<ˆÔà ˆÔØˆŒˆˆr   c                óÎ   — | j         d         }t          |                     ¦   «         ¦  «        }d}|                     ¦   «         D ]}||z  dk    r|dz  }Œ|| j        j        d<   dS )r!   rØ   r   rh   r7   N)r$   r?   rA   r%   r&   )r   rB   ri   rj   r]   s        r   r)   z$NumberOfCommonPitchesFeature.process*  sp   € ð ”	Ð6Ô7ˆÝ�E—L’L‘N”NÑ#Ô#ˆØˆØ—\’\‘^”^ð 	ð 	ˆEØ�u‰} Ò$Ð$Ø˜‘	�øØ!%ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r    s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð
&ð 
&ð 
&ð 
&ð 
&ð 
&ð 
&r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚPitchVarietyFeaturez°
    Number of pitches used at least once.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.PitchVarietyFeature(s)
    >>> fe.extract().vector
    [24]
    ÚP8Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zPitch Varietyz%Number of pitches used at least once.Tr7   r   r8   r   s      €r   r   zPitchVarietyFeature.__init__B  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à#ˆŒ	ØBˆÔØ ˆÔØˆŒˆˆr   c                ó‚   — | j         d         }d}t          |¦  «        D ]\  }}|dk    r|dz  }Œ|| j        j        d<   dS )r!   rØ   r   r7   N©r$   r#   r%   r&   ©r   rB   rj   r'   r]   s        r   r)   zPitchVarietyFeature.processJ  sY   € ð ”	Ð6Ô7ˆØˆÝ! %Ñ(Ô(ð 	ð 	‰HˆAˆuØ˜ŠzˆzØ˜‘	�øØ!%ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  7  ó]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð	&ð 	&ð 	&ð 	&ð 	&ð 	&ð 	&r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚPitchClassVarietyFeaturez»
    Number of pitch classes used at least once.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.PitchClassVarietyFeature(s)
    >>> fe.extract().vector
    [10]
    ÚP9Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zPitch Class Varietyz+Number of pitch classes used at least once.Tr7   r   r8   r   s      €r   r   z!PitchClassVarietyFeature.__init__a  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à)ˆŒ	ØHˆÔØ ˆÔØˆŒˆˆr   c                ó‚   — | j         d         }d}t          |¦  «        D ]\  }}|dk    r|dz  }Œ|| j        j        d<   dS )r!   rá   r   r7   Nr  r  s        r   r)   z PitchClassVarietyFeature.processi  sY   € ð ”	Ð7Ô8ˆØˆÝ! %Ñ(Ô(ð 	ð 	‰HˆAˆuØ˜ŠzˆzØ˜‘	�øØ!%ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  V  r  r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚRangeFeaturez¿
    Difference between highest and lowest pitches. In semitones

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.RangeFeature(s)
    >>> fe.extract().vector
    [34]
    ÚP10Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   ÚRangez.Difference between highest and lowest pitches.Tr7   r   r8   r   s      €r   r   zRangeFeature.__init__€  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àˆŒ	ØKˆÔØ ˆÔØˆŒˆˆr   c                óê   — | j         d         }|st          d¦  «        ‚t          |                     ¦   «         ¦  «        }t	          |                     ¦   «         ¦  «        }||z
  | j        j        d<   dS r×   )r$   r>   ÚminÚkeysrJ   r%   r&   )r   rB   ÚminIndexrM   s       r   r)   zRangeFeature.processˆ  sm   € ð ”	Ð6Ô7ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@Ý�u—z’z‘|”|Ñ$Ô$ˆÝ�u—z’z‘|”|Ñ$Ô$ˆà!)¨HÑ!4ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  u  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð
5ð 
5ð 
5ð 
5ð 
5ð 
5ð 
5r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMostCommonPitchFeaturez±
    Bin label of the most common pitch.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MostCommonPitchFeature(s)
    >>> fe.extract().vector
    [61]
    ÚP11Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zMost Common Pitchz#Bin label of the most common pitch.Tr7   Fr   rÔ   r   s      €r   r   zMostCommonPitchFeature.__init__   sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à'ˆŒ	Ø@ˆÔØ ˆÔØˆŒØˆŒˆˆr   c                óÂ   — | j         d         }	 |                     d¦  «        d         d         }|| j        j        d<   dS # t          $ r d| j        j        d<   Y dS w xY w)r!   rØ   r7   r   rè   N)r$   ré   r%   r&   rì   )r   rB   Ú
pNumberMaxs      r   r)   zMostCommonPitchFeature.process©  s{   € ð ”	Ð6Ô7ˆð	)Ø×*Ò*¨1Ñ-Ô-¨aÔ0°Ô3ˆJØ%/ˆDŒLÔ Ñ"Ð"Ð"øÝð 	)ð 	)ð 	)Ø%(ˆDŒLÔ Ñ"Ð"Ð"Ð"ð	)øøøs   �0A ÁAÁAr*   r+   r2   s   @r   r!  r!  •  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)r   r!  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚPrimaryRegisterFeaturez§
    Average MIDI pitch.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.PrimaryRegisterFeature(s)
    >>> fe.extract().vector
    [61.12...]
    ÚP12Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zPrimary RegisterzAverage MIDI pitch.Tr7   Fr   rÔ   r   s      €r   r   zPrimaryRegisterFeature.__init__À  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à&ˆŒ	Ø0ˆÔØ ˆÔØˆŒØˆŒˆˆr   c                ó˜   — | j         d         }|st          d¦  «        ‚t          j        d„ |D ¦   «         ¦  «        | j        j        d<   dS )r!   Úpitchesr;   c                ó   — g | ]	}|j         ‘Œ
S r   )Úps)Ú.0Úps     r   ú
<listcomp>z2PrimaryRegisterFeature.process.<locals>.<listcomp>Ð  s   € Ð1FÐ1FÐ1F¸1°!´$Ð1FÐ1FÐ1Fr   r   N)r$   r>   Ú
statisticsÚmeanr%   r&   )r   rB   s     r   r)   zPrimaryRegisterFeature.processÉ  sV   € ð ”	˜)Ô$ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@Ý!+¤Ð1FÐ1FÀÐ1FÑ1FÔ1FÑ!GÔ!GˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r'  r'  µ  sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðHð Hð Hð Hð Hð Hð Hr   r'  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚImportanceOfBassRegisterFeaturezÍ
    Fraction of Notes between MIDI pitches 0 and 54.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.ImportanceOfBassRegisterFeature(s)
    >>> fe.extract().vector
    [0.184...]
    ÚP13Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zImportance of Bass Registerz3Fraction of Note Ons between MIDI pitches 0 and 54.Tr7   Fr   rÔ   r   s      €r   r   z(ImportanceOfBassRegisterFeature.__init__Þ  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à1ˆŒ	ØPˆÔØ ˆÔØˆŒØˆŒˆˆr   c                ó0  — | j         d         }|st          d¦  «        ‚g }|                     ¦   «         D ] \  }}|dk    r|                     |¦  «         Œ!t	          |¦  «        }|t	          |                     ¦   «         ¦  «        z  | j        j        d<   dS )r!   rØ   r;   é6   r   N©r$   r>   Úitemsr=   r?   rA   r%   r&   ©r   rB   Úmatchesr'   r]   Ú
matchedSums         r   r)   z'ImportanceOfBassRegisterFeature.processç  óš   € ð ”	Ð6Ô7ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆàŸš™œð 	&ð 	&‰HˆAˆuØ�BŠwˆwØ—’˜uÑ%Ô%Ð%øÝ˜‘\”\ˆ
à!+­c°%·,²,±.´.Ñ.AÔ.AÑ!AˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r4  r4  Ó  ód   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðBð Bð Bð Bð Bð Bð Br   r4  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú!ImportanceOfMiddleRegisterFeaturezÏ
    Fraction of Notes between MIDI pitches 55 and 72

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.ImportanceOfMiddleRegisterFeature(s)
    >>> fe.extract().vector
    [0.766...]
    ÚP14Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zImportance of Middle Registerz4Fraction of Note Ons between MIDI pitches 55 and 72.Tr7   Fr   rÔ   r   s      €r   r   z*ImportanceOfMiddleRegisterFeature.__init__  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à3ˆŒ	ØQˆÔØ ˆÔØˆŒØˆŒˆˆr   c                óD  — | j         d         }|st          d¦  «        ‚g }|                     ¦   «         D ]*\  }}d|cxk    rdk    rn Œ|                     |¦  «         Œ+t	          |¦  «        }|t	          |                     ¦   «         ¦  «        z  | j        j        d<   dS )r!   rØ   r;   é7   r§   r   Nr9  r;  s         r   r)   z)ImportanceOfMiddleRegisterFeature.process  sª   € ð ”	Ð6Ô7ˆØð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆàŸš™œð 	&ð 	&‰HˆAˆuØ�Qˆ}ˆ}Š}ˆ}˜"Š}ˆ}ˆ}ˆ}ˆ}Ø—’˜uÑ%Ô%Ð%øÝ˜‘\”\ˆ
à!+­c°%·,²,±.´.Ñ.AÔ.AÑ!AˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rA  rA  ø  r?  r   rA  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚImportanceOfHighRegisterFeaturezÏ
    Fraction of Notes between MIDI pitches 73 and 127.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.ImportanceOfHighRegisterFeature(s)
    >>> fe.extract().vector
    [0.049...]
    ÚP15Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zImportance of High Registerz5Fraction of Note Ons between MIDI pitches 73 and 127.Tr7   Fr   rÔ   r   s      €r   r   z(ImportanceOfHighRegisterFeature.__init__(  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à1ˆŒ	ØRˆÔØ ˆÔØˆŒØˆŒˆˆr   c                ó0  — | j         d         }|st          d¦  «        ‚g }|                     ¦   «         D ] \  }}|dk    r|                     |¦  «         Œ!t	          |¦  «        }|t	          |                     ¦   «         ¦  «        z  | j        j        d<   dS )r!   rØ   r;   éI   r   Nr9  r;  s         r   r)   z'ImportanceOfHighRegisterFeature.process1  r>  r   r*   r+   r2   s   @r   rG  rG    r?  r   rG  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMostCommonPitchClassFeaturez»
    Bin label of the most common pitch class.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MostCommonPitchClassFeature(s)
    >>> fe.extract().vector
    [1]
    ÚP16Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMost Common Pitch Classz)Bin label of the most common pitch class.Tr7   r   r8   r   s      €r   r   z$MostCommonPitchClassFeature.__init__M  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à-ˆŒ	ØFˆÔØ ˆÔØˆŒˆˆr   c                ó‚   — | j         d         }|                     t          |¦  «        ¦  «        }|| j        j        d<   dS r  ©r$   rK   rJ   r%   r&   )r   rB   rö   s      r   r)   z#MostCommonPitchClassFeature.processU  s=   € ð ”	Ð7Ô8ˆØ—K’K¥ E¡
¤
Ñ+Ô+ˆ	Ø!*ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rM  rM  B  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð+ð +ð +ð +ð +ð +ð +r   rM  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚDominantSpreadFeaturezš
    Not implemented

    Largest number of consecutive pitch classes separated by perfect
    5ths that accounted for at least 9% each of the notes.
    ÚP17Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zDominant SpreadzwLargest number of consecutive pitch classes separated by perfect 5ths that accounted for at least 9% each of the notes.Tr7   r   r8   r   s      €r   r   zDominantSpreadFeature.__init__g  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à%ˆŒ	ð]ˆÔà ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚©Nznot yet implemented©r>   ©r   s    r   r)   zDominantSpreadFeature.processp  ó   € Ý'Ð(=Ñ>Ô>Ð>r   r*   r+   r2   s   @r   rS  rS  ^  ó]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   rS  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚStrongTonalCentresFeaturezƒ
    Not implemented

    Number of peaks in the fifths pitch histogram that each account
    for at least 9% of all Note Ons.
    ÚP18Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zStrong Tonal Centresz`Number of peaks in the fifths pitch histogram that each account for at least 9% of all Note Ons.Tr7   r   r8   r   s      €r   r   z"StrongTonalCentresFeature.__init__~  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à*ˆŒ	ð?ˆÔà ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z!StrongTonalCentresFeature.process‡  rZ  r   r*   r+   r2   s   @r   r]  r]  u  r[  r   r]  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚBasicPitchHistogramFeatureaB  
    A feature extractor that finds a features array with bins corresponding
    to the values of the basic pitch histogram.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.BasicPitchHistogramFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.006..., 0.0, 0.0, 0.006..., 0.006..., 0.030...,
     0.0, 0.036..., 0.012..., 0.0, 0.006..., 0.018..., 0.061..., 0.0,
     0.042..., 0.073..., 0.012..., 0.092..., 0.0, 0.116..., 0.061...,
     0.006..., 0.085..., 0.018..., 0.110..., 0.0, 0.042..., 0.055...,
     0.0, 0.049..., 0.0, 0.042..., 0.0, 0.0, 0.006..., 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
     0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    ÚP19Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zBasic Pitch HistogramzTA features array with bins corresponding to the values of the basic pitch histogram.Tr   r   r   r   s      €r   r   z#BasicPitchHistogramFeature.__init__¤  sQ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ðCˆÔà ˆÔØˆŒØˆŒˆˆr   c                ón   — | j         d                              ¦   «         D ]\  }}|| j        j        |<   ŒdS )r!   rØ   N)r$   r:  r%   r&   ©r   r'   r]   s      r   r)   z"BasicPitchHistogramFeature.process®  sG   € ð œ	Ð">Ô?×EÒEÑGÔGð 	+ð 	+‰HˆAˆuØ%*ˆDŒLÔ Ñ"Ð"ð	+ð 	+r   r*   r+   r2   s   @r   rb  rb  Œ  s]   ø€ € € € € ðð ð* 
€Bðð ð ð ð ð ð+ð +ð +ð +ð +ð +ð +r   rb  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚPitchClassDistributionFeaturea  
    A feature array with 12 entries where the first holds the frequency
    of the bin of the pitch class histogram with the highest frequency,
    and the following entries holding the successive bins of the histogram,
    wrapping around if necessary.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.PitchClassDistributionFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.196..., 0.073..., 0.006..., 0.098..., 0.036..., 0.177..., 0.0,
     0.085..., 0.134..., 0.018..., 0.171..., 0.0]
    ÚP20Nc                ó’   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d| _        d S )Nr   zPitch Class DistributionzíA feature array with 12 entries where the first holds the frequency of the bin of the pitch class histogram with the highest frequency, and the following entries holding the successive bins of the histogram, wrapping around if necessary.Tru   Fr   )r   r   r   r   r   r   rÕ   r   r   s      €r   r   z&PitchClassDistributionFeature.__init__Æ  sZ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ðbˆÔð !ˆÔØˆŒØˆŒØˆŒˆˆr   c                ó  — dg| j         z  }t          | j        d         ¦  «        D ]
\  }}|||<   Œ|                     t	          |¦  «        ¦  «        }t          |¦  «        D ]\  }}|| j        j        ||z
  | j         z  <   Œ dS )r!   r   rá   N)r   r#   r$   rK   rJ   r%   r&   )r   Útempr'   r]   ÚmÚvals         r   r)   z%PitchClassDistributionFeature.processÓ  s�   € ð
 ˆs�T”_Ñ$ˆÝ! $¤)Ð,IÔ"JÑKÔKð 	ð 	‰HˆAˆuØˆD�‰GˆGð �JŠJ•s˜4‘y”yÑ!Ô!ˆå ‘o”oð 	Að 	A‰FˆAˆsØ=@ˆDŒLÔ  Q¡¨$¬/Ñ 9Ñ:Ð:ð	Að 	Ar   r*   r+   r2   s   @r   rh  rh  ¶  sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðAð Að Að Að Að Að Ar   rh  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚFifthsPitchHistogramFeaturea¿  
    A feature array with bins corresponding to the values of the 5ths pitch class
    histogram. Instead of the bins being arranged according to semitones --
    [C, C#, D, etc.] -- they are arranged according to the circle of fifths:
    [C, G, D, A, E, B, F#, C#, G#, D#, A#, F]. Viewing such a histogram
    may draw attention to the prevalence of a tonal center, including the
    prevalence of dominant relationships in the piece.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.FifthsPitchHistogramFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.0, 0.0, 0.073..., 0.134..., 0.098..., 0.171..., 0.177..., 0.196...,
     0.085..., 0.006..., 0.018..., 0.036...]
    ÚP21Nc                óÖ   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        i | _        t          d¦  «        D ]}d|z  dz  | j        |<   Œd S )Nr   zFifths Pitch HistogramzXA feature array with bins corresponding to the values of the 5ths pitch class histogram.Tru   rr   r   )	r   r   r   r   r   r   r   Ú_mappingr<   )r   r   r   r'   r   s       €r   r   z$FifthsPitchHistogramFeature.__init__õ  s‹   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à,ˆŒ	ð:ˆÔà ˆÔØˆŒØˆŒð ˆŒÝ�r‘”ð 	,ð 	,ˆAØ ! A¡¨™|ˆDŒM˜!ÑÐð	,ð 	,r   c                óz   — t          | j        d         ¦  «        D ]\  }}|| j        j        | j        |         <   Œ dS )r!   rá   N)r#   r$   r%   r&   rs  rf  s      r   r)   z#FifthsPitchHistogramFeature.process  sJ   € õ " $¤)Ð,IÔ"JÑKÔKð 	:ð 	:‰HˆAˆuØ49ˆDŒLÔ ¤¨aÔ 0Ñ1Ð1ð	:ð 	:r   r*   r+   r2   s   @r   rp  rp  ã  s]   ø€ € € € € ðð ð 
€Bð,ð ,ð ,ð ,ð ,ð ,ð:ð :ð :ð :ð :ð :ð :r   rp  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚQualityFeaturea�  
    Set to 0 if the key signature indicates that
    a recording is major, set to 1 if it indicates
    that it is minor.  In jSymbolic, this is set to 0 if key signature is unknown.

    See features.native.QualityFeature for a music21 improvement on this method

    Example: Handel, Rinaldo Aria (musicxml) is explicitly encoded as being in Major:

    >>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga')
    >>> fe = features.jSymbolic.QualityFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.QualityFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [1]
    ÚP22Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   ÚQualityzÈ
            Set to 0 if the key signature indicates that
            a recording is major, set to 1 if it indicates
            that it is minor and set to 0 if key signature is unknown.
            Tr7   r   r8   r   s      €r   r   zQualityFeature.__init__$  sK   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àˆŒ	ðˆÔð
 !ˆÔØˆŒˆˆr   c                ó�   — | j         d         }d}|D ] }|j        dk    rd} n|j        dk    rd} nŒ!|€d}|| j        j        d<   dS )r!   zflat.getElementsByClass(Key)NÚmajorr   Úminorr7   )r$   Úmoder%   r&   )r   ÚallKeysÚ
keyFeatureÚxs       r   r)   zQualityFeature.process0  sz   € ð ”)Ð:Ô;ˆØˆ
Øð 	ð 	ˆAØŒv˜Ò Ð Ø�
Ø�Ø”˜7Ò"Ð"Ø�
Ø�ð #ð ÐØˆJà!+ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rv  rv    s]   ø€ € € € € ðð ð* 
€Bð
ð 
ð 
ð 
ð 
ð 
ð,ð ,ð ,ð ,ð ,ð ,ð ,r   rv  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚGlissandoPrevalenceFeaturez­
    Not yet implemented in music21

    Number of Note Ons that have at least one MIDI Pitch Bend associated
    with them divided by total number of pitched Note Ons.
    ÚP23Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zGlissando Prevalencez{Number of Note Ons that have at least one MIDI Pitch Bend associated with them divided by total number of pitched Note Ons.Tr7   r   r8   r   s      €r   r   z#GlissandoPrevalenceFeature.__init__L  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à*ˆŒ	ð`ˆÔà ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z"GlissandoPrevalenceFeature.processU  rZ  r   r*   r+   r2   s   @r   r‚  r‚  C  r[  r   r‚  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚAverageRangeOfGlissandosFeaturea(  
    Not yet implemented in music21

    Average range of MIDI Pitch Bends, where "range" is defined
    as the greatest value of the absolute difference between 64 and the
    second data byte of all MIDI Pitch Bend messages falling between the
    Note On and Note Off messages of any note
    ÚP24Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zAverage Range Of GlissandoszïAverage range of MIDI Pitch Bends, where "range" is defined as the greatest value of the absolute difference between 64 and the second data byte of all MIDI Pitch Bend messages falling between the Note On and Note Off messages of any note.Tr7   r   r8   r   s      €r   r   z(AverageRangeOfGlissandosFeature.__init__e  sK   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à1ˆŒ	ð+ˆÔð
 !ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z'AverageRangeOfGlissandosFeature.processq  rZ  r   r*   r+   r2   s   @r   r‡  r‡  Z  ó]   ø€ € € € € ðð ð 
€Bð
ð 
ð 
ð 
ð 
ð 
ð?ð ?ð ?ð ?ð ?ð ?ð ?r   r‡  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚVibratoPrevalenceFeaturezÕ
    Not yet implemented in music21

    Number of notes for which Pitch Bend messages change direction at least twice divided by
    total number of notes that have Pitch Bend messages associated with them.

    ÚP25Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zVibrato Prevalencez¢Number of notes for which Pitch Bend messages change direction at least twice divided by total number of notes that have Pitch Bend messages associated with them.Tr7   r   r8   r   s      €r   r   z!VibratoPrevalenceFeature.__init__€  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à(ˆŒ	ðRˆÔð !ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z VibratoPrevalenceFeature.processŠ  rZ  r   r*   r+   r2   s   @r   r�  r�  v  ó]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   r�  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚPrevalenceOfMicrotonesFeaturez¡
    not yet implemented

    Number of Note Ons that are preceded by isolated MIDI Pitch Bend
    messages as a fraction of the total number of Note Ons.'

    ÚP26Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zPrevalence Of MicrotoneszxNumber of Note Ons that are preceded by isolated MIDI Pitch Bend messages as a fraction of the total number of Note Ons.Tr7   r   r8   r   s      €r   r   z&PrevalenceOfMicrotonesFeature.__init__™  sY   ø€ Ø�‰ŒÔð 	%ð 	% lð 	%Ø#ð	%ð 	%ð 	%ð /ˆŒ	ð[ˆÔà ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z%PrevalenceOfMicrotonesFeature.process£  rZ  r   r*   r+   r2   s   @r   r“  r“  �  r‘  r   r“  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚStrongestRhythmicPulseFeatureaè  
    Bin label of the beat bin of the peak with the highest frequency.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.StrongestRhythmicPulseFeature(sch)
    >>> f = fe.extract()
    >>> f.vector[0]
    140

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.StrongestRhythmicPulseFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [96]
    ÚR1Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zStrongest Rhythmic Pulsez5Bin label of the beat bin with the highest frequency.Tr7   r   r8   r   s      €r   r   z&StrongestRhythmicPulseFeature.__init__À  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ØRˆÔØ ˆÔØˆŒˆˆr   c                ó~   — | j         d         }|                     t          |¦  «        ¦  «        | j        j        d<   d S ©Nzflat.secondsMap.beatHistogramr   rQ  ©r   Ú	beatHistos     r   r)   z%StrongestRhythmicPulseFeature.processÈ  s6   € Ø”IÐ=Ô>ˆ	Ø!*§¢µ°Y±´Ñ!@Ô!@ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r˜  r˜  «  sd   ø€ € € € € ðð ð$ 
€Bðð ð ð ð ð ðAð Að Að Að Að Að Ar   r˜  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú#SecondStrongestRhythmicPulseFeatureaü  
    Bin label of the beat bin of the peak with the second-highest frequency.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.SecondStrongestRhythmicPulseFeature(sch)
    >>> f = fe.extract()
    >>> f.vector[0]
    70

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.SecondStrongestRhythmicPulseFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [192]

    ÚR2Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zSecond Strongest Rhythmic PulsezHBin label of the beat bin of the peak with the second highest frequency.Tr7   r   r8   r   s      €r   r   z,SecondStrongestRhythmicPulseFeature.__init__â  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à5ˆŒ	ðAˆÔà ˆÔØˆŒˆˆr   c                óð   — t          j         | j        d         ¦  «        }|                     t          |¦  «        ¦  «        }d||<   |                     t          |¦  «        ¦  «        | j        j        d<   d S rœ  )rS   r$   rK   rJ   r%   r&   )r   rž  ÚhighestIndexs      r   r)   z+SecondStrongestRhythmicPulseFeature.processë  sa   € Ý”I˜dœiÐ(GÔHÑIÔIˆ	Ø —’¥s¨9¡~¤~Ñ6Ô6ˆØ"#ˆ	�,Ñà!*§¢µ°Y±´Ñ!@Ô!@ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r   r   Í  sd   ø€ € € € € ðð ð$ 
€Bðð ð ð ð ð ðAð Að Að Að Að Að Ar   r   c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú.HarmonicityOfTwoStrongestRhythmicPulsesFeatureaf  
    The bin label of the higher (in terms of bin label) of the two beat bins of the
    peaks with the highest frequency divided by the bin label of the lower.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.HarmonicityOfTwoStrongestRhythmicPulsesFeature(sch)
    >>> f = fe.extract()
    >>> f.vector[0]
    2.0

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.HarmonicityOfTwoStrongestRhythmicPulsesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.5]

    ÚR3Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z,Harmonicity of Two Strongest Rhythmic Pulsesz—The bin label of the higher (in terms of bin label) of the two beat bins of the peaks with the highest frequency divided by the bin label of the lower.Tr7   r   r8   r   s      €r   r   z7HarmonicityOfTwoStrongestRhythmicPulsesFeature.__init__
  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àBˆŒ	ðEˆÔð !ˆÔØˆŒˆˆr   c                ó  — t          j         | j        d         ¦  «        }|                     t          |¦  «        ¦  «        }d||<   |                     t          |¦  «        ¦  «        }t	          ||z  ¦  «        | j        j        d<   d S rœ  )rS   r$   rK   rJ   rê   r%   r&   )r   rž  r¤  ÚsecondHighests       r   r)   z6HarmonicityOfTwoStrongestRhythmicPulsesFeature.process  ss   € Ý”I˜dœiÐ(GÔHÑIÔIˆ	Ø —’¥s¨9¡~¤~Ñ6Ô6ˆØ"#ˆ	�,Ñà!Ÿš­¨I©¬Ñ7Ô7ˆÝ!& |°mÑ'CÑ!DÔ!DˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r¦  r¦  ó  sd   ø€ € € € € ðð ð& 
€Bðð ð ð ð ð ðEð Eð Eð Eð Eð Eð Er   r¦  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú'StrengthOfStrongestRhythmicPulseFeatureaD  
    Frequency of the beat bin with the highest frequency.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.StrengthOfStrongestRhythmicPulseFeature(sch)
    >>> fe.extract().vector[0]
    0.853...
    ÚR4Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z$Strength of Strongest Rhythmic Pulsez5Frequency of the beat bin with the highest frequency.Tr7   r   r8   r   s      €r   r   z0StrengthOfStrongestRhythmicPulseFeature.__init__*  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à:ˆŒ	ØRˆÔØ ˆÔØˆŒˆˆr   c                óx   — | j         d         }t          |¦  «        t          |¦  «        z  | j        j        d<   d S rœ  )r$   rJ   r?   r%   r&   r�  s     r   r)   z/StrengthOfStrongestRhythmicPulseFeature.process2  s5   € Ø”IÐ=Ô>ˆ	Ý!$ Y¡¤µ#°i±.´.Ñ!@ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r¬  r¬    sd   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ðAð Að Að Að Að Að Ar   r¬  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú-StrengthOfSecondStrongestRhythmicPulseFeaturea]  
    Frequency of the beat bin of the peak with the second-highest frequency.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.StrengthOfSecondStrongestRhythmicPulseFeature(sch)
    >>> fe.extract().vector[0]
    0.121...
    ÚR5Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z+Strength of Second Strongest Rhythmic PulsezHFrequency of the beat bin of the peak with the second highest frequency.Tr7   r   r8   r   s      €r   r   z6StrengthOfSecondStrongestRhythmicPulseFeature.__init__E  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àAˆŒ	ðAˆÔà ˆÔØˆŒˆˆr   c                óò   — t          j         | j        d         ¦  «        }t          |¦  «        }|                     t	          |¦  «        ¦  «        }d||<   t	          |¦  «        }||z  | j        j        d<   d S rœ  )rS   r$   r?   rK   rJ   r%   r&   )r   rž  ÚsumHistor¤  rª  s        r   r)   z5StrengthOfSecondStrongestRhythmicPulseFeature.processN  sj   € Ý”I˜dœiÐ(GÔHÑIÔIˆ	Ý�y‘>”>ˆà —’¥s¨9¡~¤~Ñ6Ô6ˆØ"#ˆ	�,Ñå˜I™œˆØ!.°Ñ!9ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r±  r±  7  s]   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ð:ð :ð :ð :ð :ð :ð :r   r±  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú0StrengthRatioOfTwoStrongestRhythmicPulsesFeaturea½  
    The frequency of the higher (in terms of frequency) of the two beat bins
    corresponding to the peaks with the highest frequency divided by the frequency of the lower.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.StrengthRatioOfTwoStrongestRhythmicPulsesFeature(sch)
    >>> fe.extract().vector[0]
    7.0

    ÚR6Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z/Strength Ratio of Two Strongest Rhythmic Pulsesz¥The frequency of the higher (in terms of frequency) of the two beat bins corresponding to the peaks with the highest frequency divided by the frequency of the lower.Tr7   r   r8   r   s      €r   r   z9StrengthRatioOfTwoStrongestRhythmicPulsesFeature.__init__i  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àEˆŒ	ðOˆÔð !ˆÔØˆŒˆˆr   c                óØ   — t          j         | j        d         ¦  «        }t          |¦  «        }|                     |¦  «        }d||<   t          |¦  «        }||z  | j        j        d<   d S rœ  )rS   r$   rJ   rK   r%   r&   )r   rž  Ú
theHighestr¤  rª  s        r   r)   z8StrengthRatioOfTwoStrongestRhythmicPulsesFeature.processs  sd   € Ý”I˜dœiÐ(GÔHÑIÔIˆ	å˜‘^”^ˆ
Ø —’ zÑ2Ô2ˆØ"#ˆ	�,Ñå˜I™œˆØ!+¨mÑ!;ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r·  r·  Y  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð<ð <ð <ð <ð <ð <ð <r   r·  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú3CombinedStrengthOfTwoStrongestRhythmicPulsesFeatureau  
    The sum of the frequencies of the two beat bins of the peaks with the highest frequencies.

    >>> sch = corpus.parse('schoenberg/opus19', 2)
    >>> for p in sch.parts:
    ...     p.insert(0, tempo.MetronomeMark('Langsam', 70))
    >>> fe = features.jSymbolic.CombinedStrengthOfTwoStrongestRhythmicPulsesFeature(sch)
    >>> fe.extract().vector[0]
    0.975...
    ÚR7Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z2Combined Strength of Two Strongest Rhythmic PulseszZThe sum of the frequencies of the two beat bins of the peaks with the highest frequencies.Tr7   r   r8   r   s      €r   r   z<CombinedStrengthOfTwoStrongestRhythmicPulsesFeature.__init__Œ  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àHˆŒ	ðIˆÔà ˆÔØˆŒˆˆr   c                óü   — t          j         | j        d         ¦  «        }t          |¦  «        }t          |¦  «        }|                     |¦  «        }d||<   t          |¦  «        }||z   |z  | j        j        d<   d S rœ  )rS   r$   r?   rJ   rK   r%   r&   )r   rž  rµ  r»  r¤  rª  s         r   r)   z;CombinedStrengthOfTwoStrongestRhythmicPulsesFeature.process•  st   € Ý”I˜dœiÐ(GÔHÑIÔIˆ	Ý�y‘>”>ˆå˜‘^”^ˆ
Ø —’ zÑ2Ô2ˆØ"#ˆ	�,Ñå˜I™œˆØ",¨}Ñ"<ÀÑ!HˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r½  r½  ~  sd   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ð	Ið 	Ið 	Ið 	Ið 	Ið 	Ið 	Ir   r½  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚNumberOfStrongPulsesFeaturez^
    Not yet implemented

    Number of beat peaks with normalized frequencies over 0.1.

    ÚR8Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zNumber of Strong Pulsesz:Number of beat peaks with normalized frequencies over 0.1.Tr7   r   r8   r   s      €r   r   z$NumberOfStrongPulsesFeature.__init__ª  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à-ˆŒ	ØWˆÔØ ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z#NumberOfStrongPulsesFeature.process²  rZ  r   r*   r+   r2   s   @r   rÂ  rÂ  ¡  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   rÂ  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚNumberOfModeratePulsesFeaturez^
    Not yet implemented

    Number of beat peaks with normalized frequencies over 0.01.
    ÚR9Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zNumber of Moderate Pulsesz;Number of beat peaks with normalized frequencies over 0.01.Tr7   r   r8   r   s      €r   r   z&NumberOfModeratePulsesFeature.__init__¿  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à/ˆŒ	ØXˆÔØ ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z%NumberOfModeratePulsesFeature.processÇ  rZ  r   r*   r+   r2   s   @r   rÇ  rÇ  ·  s]   ø€ € € € € ðð ð
 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   rÇ  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú%NumberOfRelativelyStrongPulsesFeaturez™
    not yet implemented

    Number of beat peaks with frequencies at least 30% as high as the
    frequency of the bin with the highest frequency.
    ÚR10Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z"Number of Relatively Strong PulseszrNumber of beat peaks with frequencies at least 30% as high as the frequency of the bin with the highest frequency.Tr7   r   r8   r   s      €r   r   z.NumberOfRelativelyStrongPulsesFeature.__init__Õ  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à8ˆŒ	ðSˆÔà ˆÔØˆŒˆˆr   r*   ©r,   r-   r.   r/   r0   r   r1   r2   s   @r   rÌ  rÌ  Ì  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   rÌ  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚRhythmicLoosenessFeaturea8  
    not yet implemented

    Average width of beat histogram peaks (in beats per minute).
    Width is measured for all peaks with frequencies at least 30% as high as the highest peak,
    and is defined by the distance between the points on the peak in question that are
    30% of the height of the peak.
    ÚR11Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zRhythmic Loosenessa:  
            Average width of beat histogram peaks (in beats per minute).
            Width is measured for all peaks with frequencies at least 30% as high as the
            highest peak, and is defined by the distance between the points on the peak in
            question that are 30% of the height of the peak.Tr7   r   ©r   r   r   r   r   r   r   r   s      €r   r   z!RhythmicLoosenessFeature.__init__ê  s[   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à(ˆŒ	Ý!ð #@ñ Aô AˆÔð
 !ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z RhythmicLoosenessFeature.processö  rZ  r   r*   r+   r2   s   @r   rÑ  rÑ  ß  r‹  r   rÑ  c                  ó$   — e Zd ZdZdZdd„Zd„ ZdS )ÚPolyrhythmsFeaturea¹  
    Not yet implemented

    Number of beat peaks with frequencies at least 30% of the highest frequency
    whose bin labels are not integer multiples or factors
    (using only multipliers of 1, 2, 3, 4, 6 and 8) (with an accepted
    error of +/- 3 bins) of the bin label of the peak with the highest frequency.
    This number is then divided by the total number of beat bins with frequencies
    over 30% of the highest frequency.
    ÚR12Nc                óp   — t          j        j        | fd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   ÚPolyrhythmsa³  
        Number of beat peaks with frequencies at least 30% of the highest frequency
        whose bin labels are not integer multiples or factors
        (using only multipliers of 1, 2, 3, 4, 6 and 8) (with an accepted
        error of +/- 3 bins) of the bin label of the peak with the highest frequency.
        This number is then divided by the total number of beat bins with frequencies
        over 30% of the highest frequency.Tr7   )ÚfeaturesModuleÚFeatureExtractorr   r   r   r   r   )r   r   r   s      r   r   zPolyrhythmsFeature.__init__  sY   € ÝÔ'Ô0°ð 	=ð 	=Ø>Jð	=à3;ð	=ð 	=ð 	=ð "ˆŒ	ð.ˆÔð !ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   zPolyrhythmsFeature.process  rZ  r   r*   )r,   r-   r.   r/   r0   r   r)   r   r   r   r×  r×  û  sH   € € € € € ð	ð 	ð 
€Bðð ð ð ð ?ð ?ð ?ð ?ð ?r   r×  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚRhythmicVariabilityFeaturezi
    Not yet implemented

    Standard deviation of the bin values (except the first 40 empty ones).
    ÚR13Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zRhythmic VariabilityzFStandard deviation of the bin values (except the first 40 empty ones).Tr7   r   r8   r   s      €r   r   z#RhythmicVariabilityFeature.__init__%  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à*ˆŒ	ØcˆÔØ ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z"RhythmicVariabilityFeature.process-  rZ  r   r*   r+   r2   s   @r   rß  rß    s]   ø€ € € € € ðð ð
 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   rß  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚBeatHistogramFeaturezÕ
    Not yet implemented

    A feature extractor that finds a feature array with entries corresponding to the frequency
    values of each of the bins of the beat histogram (except the first 40 empty ones).

    ÚR14Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   zBeat HistogramzŽA feature array with entries corresponding to the frequency values of each of the bins of the beat histogram (except the first 40 empty ones).Té¡   Fr   rÔ   r   s      €r   r   zBeatHistogramFeature.__init__<  sS   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à$ˆŒ	ð@ˆÔð !ˆÔØˆŒØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   zBeatHistogramFeature.processG  rZ  r   r*   r+   r2   s   @r   rä  rä  2  s]   ø€ € € € € ðð ð 
€Bð	ð 	ð 	ð 	ð 	ð 	ð?ð ?ð ?ð ?ð ?ð ?ð ?r   rä  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚNoteDensityFeatureaÍ  
    Gives the average number of notes per second, taking into account
    the tempo at any moment in the piece.  Unlike jSymbolic, music21
    quantizes notes from MIDI somewhat before running this test; this
    function is meant to be run on encoded MIDI scores rather than
    recorded MIDI performances.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.NoteDensityFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [7.244...]
    ÚR15Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zNote Densityz#Average number of notes per second.Tr7   r   r8   r   s      €r   r   zNoteDensityFeature.__init__\  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à"ˆŒ	Ø@ˆÔØ ˆÔØˆŒˆˆr   c                óê   — | j         d         }d„ |D ¦   «         }|                     ¦   «          |sd| j        j        d<   d S t	          t          |¦  «        ¦  «        |d         z  | j        j        d<   d S )Núflat.secondsMapc                ó   — g | ]
}|d          ‘ŒS ©ÚendTimeSecondsr   ©r.  Úbundles     r   r0  z.NoteDensityFeature.process.<locals>.<listcomp>i  ó   € ÐGÐGÐG°&�VÐ,Ô-ÐGÐGÐGr   rè   r   r¿   )r$   Úsortr%   r&   rê   r@   ©r   Ú
secondsMapÚ	end_timess      r   r)   zNoteDensityFeature.processd  s   € Ø”YÐ0Ô1ˆ
ð HÐG¸JÐGÑGÔGˆ	Ø�ŠÑÔÐàð 	KØ%(ˆDŒLÔ Ñ"Ð"Ð"å%*­3¨y©>¬>Ñ%:Ô%:¸YÀr¼]Ñ%JˆDŒLÔ Ñ"Ð"Ð"r   r*   r+   r2   s   @r   rê  rê  L  sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðKð Kð Kð Kð Kð Kð Kr   rê  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚAverageNoteDurationFeaturea{  
    Average duration of notes in seconds.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.AverageNoteDurationFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.552...]

    >>> s.insert(0, tempo.MetronomeMark(number=240))
    >>> fe = features.jSymbolic.AverageNoteDurationFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.220858...]
    ÚR17Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zAverage Note Durationz%Average duration of notes in seconds.Tr7   r   r8   r   s      €r   r   z#AverageNoteDurationFeature.__init__…  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ØBˆÔØ ˆÔØˆŒˆˆr   c                ó¤   — | j         d         }|st          d¦  «        ‚d}|D ]}||d         z  }Œ|t          |¦  «        z  | j        j        d<   d S ©Nrî  r;   rè   ÚdurationSecondsr   ©r$   r>   r@   r%   r&   )r   r÷  ri   ró  s       r   r)   z"AverageNoteDurationFeature.process�  sm   € Ø”YÐ0Ô1ˆ
Øð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆØ ð 	/ð 	/ˆFØ�VÐ-Ô.Ñ.ˆEˆEØ!&­¨Z©¬Ñ!8ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rú  rú  r  s]   ø€ € € € € ðð ð  
€Bðð ð ð ð ð ð9ð 9ð 9ð 9ð 9ð 9ð 9r   rú  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú VariabilityOfNoteDurationFeaturear  
    Standard deviation of note durations in seconds.

    # In this piece, we have:
    #     9 half notes or tied pair of quarters
    #     98 untied quarters or tied pair of eighths
    #     56 untied eighths
    # BPM = 120 means a half note is a second.
    # Mean duration should thus be 0.44171779141104295
    # and standard deviation should be  0.17854763448902145

    >>> s = corpus.parse('bwv66.6')
    >>> for p in s.parts:
    ...     p.insert(0, tempo.MetronomeMark(number=120))
    >>> fe = features.jSymbolic.VariabilityOfNoteDurationFeature(s)
    >>> f = fe.extract()
    >>> f.vector[0]
    0.178...
    ÚR18Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zVariability of Note Durationz0Standard deviation of note durations in seconds.Tr7   r   r8   r   s      €r   r   z)VariabilityOfNoteDurationFeature.__init__­  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à2ˆŒ	ØMˆÔØ ˆÔØˆŒˆˆr   c                óÈ   — | j         d         }|st          d¦  «        ‚g }|D ]}|                     |d         ¦  «         Œt          j        |¦  «        | j        j        d<   d S )Nrî  r;   rÿ  r   )r$   r>   r=   r1  Úpstdevr%   r&   )r   r÷  Únote_durationsró  s       r   r)   z(VariabilityOfNoteDurationFeature.processµ  sx   € Ø”YÐ0Ô1ˆ
Øð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆØ ð 	=ð 	=ˆFØ×!Ò! &Ð):Ô";Ñ<Ô<Ð<Ð<Ý!+Ô!2°>Ñ!BÔ!BˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  —  sd   ø€ € € € € ðð ð& 
€Bðð ð ð ð ð ðCð Cð Cð Cð Cð Cð Cr   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMaximumNoteDurationFeaturezÌ
    Duration of the longest note (in seconds).

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MaximumNoteDurationFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [1.25]
    ÚR19Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMaximum Note Durationz*Duration of the longest note (in seconds).Tr7   r   r8   r   s      €r   r   z#MaximumNoteDurationFeature.__init__Ì  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ØGˆÔØ ˆÔØˆŒˆˆr   c                ó–   — | j         d         }|st          d¦  «        ‚d}|D ]}|d         |k    r|d         }Œ|| j        j        d<   d S rþ  ©r$   r>   r%   r&   )r   r÷  Ú
maxSecondsró  s       r   r)   z"MaximumNoteDurationFeature.processÔ  sm   € Ø”YÐ0Ô1ˆ
Øð 	AÝ+Ð,?Ñ@Ô@Ð@Øˆ
Ø ð 	7ð 	7ˆFØÐ'Ô(¨:Ò5Ð5Ø#Ð$5Ô6�
øØ!+ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r	  r	  ¿  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð,ð ,ð ,ð ,ð ,ð ,ð ,r   r	  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚMinimumNoteDurationFeaturezÏ
    Duration of the shortest note (in seconds).

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MinimumNoteDurationFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.3125]
    ÚR20Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zMinimum Note Durationz+Duration of the shortest note (in seconds).Tr7   r   r8   r   s      €r   r   z#MinimumNoteDurationFeature.__init__ë  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ØHˆÔØ ˆÔØˆŒˆˆr   c                ó®   — | j         d         }|st          d¦  «        ‚|d         d         }|D ]}|d         |k     r|d         }Œ|| j        j        d<   d S )Nrî  r;   r   rÿ  r  )r   r÷  Ú
minSecondsró  s       r   r)   z"MinimumNoteDurationFeature.processó  sw   € Ø”YÐ0Ô1ˆ
Øð 	AÝ+Ð,?Ñ@Ô@Ð@à ”]Ð#4Ô5ˆ
Ø ð 	7ð 	7ˆFØÐ'Ô(¨:Ò5Ð5Ø#Ð$5Ô6�
øØ!+ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  ß  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð	,ð 	,ð 	,ð 	,ð 	,ð 	,ð 	,r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚStaccatoIncidenceFeaturea  
    Number of notes with durations of less than a 10th of a second divided by
    the total number of notes in the recording.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.StaccatoIncidenceFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.0]
    ÚR21Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zStaccato IncidencezuNumber of notes with durations of less than a 10th of a second divided by the total number of notes in the recording.Tr7   r   r8   r   s      €r   r   z!StaccatoIncidenceFeature.__init__	  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à(ˆŒ	ðaˆÔà ˆÔØˆŒˆˆr   c                ó°   — | j         d         }|st          d¦  «        ‚d}|D ]}|d         dk     r|dz  }Œ|t          |¦  «        z  | j        j        d<   d S )Nrî  r;   r   rÿ  gš™™™™™¹?r7   r   )r   r÷  r]   ró  s       r   r)   z StaccatoIncidenceFeature.process	  sv   € Ø”YÐ0Ô1ˆ
Øð 	AÝ+Ð,?Ñ@Ô@Ð@ØˆØ ð 	ð 	ˆFØÐ'Ô(¨4Ò/Ð/Ø˜‘
�øØ!&­¨Z©¬Ñ!8ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  ÿ  s]   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ð9ð 9ð 9ð 9ð 9ð 9ð 9r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú AverageTimeBetweenAttacksFeatureaI  
    Average time in seconds between Note On events (regardless of channel).

    >>> s = corpus.parse('bwv66.6')
    >>> for p in s.parts:
    ...     p.insert(0, tempo.MetronomeMark(number=120))
    >>> fe = features.jSymbolic.AverageTimeBetweenAttacksFeature(s)
    >>> f = fe.extract()
    >>> print(f.vector)
    [0.35]
    ÚR22Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zAverage Time Between AttackszGAverage time in seconds between Note On events (regardless of channel).Tr7   r   r8   r   s      €r   r   z)AverageTimeBetweenAttacksFeature.__init__0	  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à2ˆŒ	ØdˆÔØ ˆÔØˆŒˆˆr   c                ó¦  — | j         d         }d„ |D ¦   «         }|st          d¦  «        ‚|                     ¦   «          g }t          |¦  «        D ]T\  }}|t	          |¦  «        dz
  k    r n8||dz            }||z
  }t          |dd¬¦  «        s|                     |¦  «         ŒUt          |¦  «        t	          |¦  «        z  | j        j	        d<   d S )	Nrî  c                ó   — g | ]
}|d          ‘ŒS ©ÚoffsetSecondsr   rò  s     r   r0  z<AverageTimeBetweenAttacksFeature.process.<locals>.<listcomp>;	  ó   € ÐCÐCÐC¨f�&˜Ô)ÐCÐCÐCr   r;   r7   rè   çH¯¼šò×z>©Úabs_tolr   )
r$   r>   rõ  r#   r@   r   r=   r?   r%   r&   ©r   r÷  ÚonsetsÚdifferencesr'   ÚoÚoNextÚdifs           r   r)   z(AverageTimeBetweenAttacksFeature.process8	  sí   € Ø”YÐ0Ô1ˆ
àCÐC¸
ÐCÑCÔCˆØð 	AÝ+Ð,?Ñ@Ô@Ð@Ø�Š‰ŒˆàˆÝ˜fÑ%Ô%ð 	(ð 	(‰DˆAˆqØ•C˜‘K”K !‘OÒ#Ð#Ø�Ø˜1˜q™5”MˆEà˜!‘)ˆCÝ˜3 ¨TÐ2Ñ2Ô2ð (Ø×"Ò" 3Ñ'Ô'Ð'øÝ!$ [Ñ!1Ô!1µC¸Ñ4DÔ4DÑ!DˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  !	  sd   ø€ € € € € ð
ð 
ð 
€Bðð ð ð ð ð ðEð Eð Eð Eð Eð Eð Er   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú&VariabilityOfTimeBetweenAttacksFeaturea  
    Standard deviation of the times, in seconds, between Note On events (regardless of channel).

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.VariabilityOfTimeBetweenAttacksFeature(s)
    >>> f = fe.extract()
    >>> print(f.vector)
    [0.1875]
    ÚR23Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z#Variability of Time Between Attacksz\Standard deviation of the times, in seconds, between Note On events (regardless of channel).Tr7   r   r8   r   s      €r   r   z/VariabilityOfTimeBetweenAttacksFeature.__init__Y	  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à9ˆŒ	ðNˆÔà ˆÔØˆŒˆˆr   c                ó�  — | j         d         }d„ |D ¦   «         }|st          d¦  «        ‚|                     ¦   «          g }t          |¦  «        D ]T\  }}|t	          |¦  «        dz
  k    r n8||dz            }||z
  }t          |dd¬¦  «        s|                     |¦  «         ŒUt          j        |¦  «        | j	        j
        d<   d S )	Nrî  c                ó   — g | ]
}|d          ‘ŒS r   r   rò  s     r   r0  zBVariabilityOfTimeBetweenAttacksFeature.process.<locals>.<listcomp>e	  r"  r   r;   r7   rè   r#  r$  r   )r$   r>   rõ  r#   r@   r   r=   r1  r  r%   r&   r&  s           r   r)   z.VariabilityOfTimeBetweenAttacksFeature.processb	  sã   € Ø”YÐ0Ô1ˆ
àCÐC¸
ÐCÑCÔCˆØð 	AÝ+Ð,?Ñ@Ô@Ð@Ø�Š‰ŒˆØˆÝ˜fÑ%Ô%ð 	(ð 	(‰DˆAˆqØ•C˜‘K”K !‘OÒ#Ð#Ø�Ø˜1˜q™5”MˆEà˜!‘)ˆCÝ˜3 ¨TÐ2Ñ2Ô2ð (Ø×"Ò" 3Ñ'Ô'Ð'øÝ!+Ô!2°;Ñ!?Ô!?ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r-  r-  L	  sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð@ð @ð @ð @ð @ð @ð @r   r-  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú,AverageTimeBetweenAttacksForEachVoiceFeatureaˆ  
    Average of average times in seconds between Note On events on individual channels
    that contain at least one note.

    >>> s = corpus.parse('bwv66.6')
    >>> for p in s.parts:
    ...     p.insert(0, tempo.MetronomeMark(number=120))
    >>> fe = features.jSymbolic.AverageTimeBetweenAttacksForEachVoiceFeature(s)
    >>> f = fe.extract()
    >>> print(f.vector[0])
    0.442...
    ÚR24Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z+Average Time Between Attacks For Each VoicezqAverage of average times in seconds between Note On events on individual channels that contain at least one note.Tr7   r   r8   r   s      €r   r   z5AverageTimeBetweenAttacksForEachVoiceFeature.__init__…	  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àAˆŒ	ðUˆÔà ˆÔØˆŒˆˆr   c                ó  — g }g }| j         j        dk    rWt          | j         j        ¦  «        D ]<}| j         d         |         d         }d„ |D ¦   «         }|                     |¦  «         Œ=n.| j         d         }d„ |D ¦   «         }|                     |¦  «         |D ]¿}|                     ¦   «          g }t          |¦  «        D ]T\  }}|t          |¦  «        dz
  k    r n8||dz            }||z
  }	t          |	dd¬	¦  «        s|                     |	¦  «         ŒU|st          d
¦  «        ‚|                     t          |¦  «        t          |¦  «        z  ¦  «         ŒÀt          |¦  «        t          |¦  «        z  | j
        j        d<   d S )Nr   r±   rî  c                ó   — g | ]
}|d          ‘ŒS r   r   rò  s     r   r0  zHAverageTimeBetweenAttacksForEachVoiceFeature.process.<locals>.<listcomp>”	  ó   € ÐKÐKÐK°f˜& Ô1ÐKÐKÐKr   c                ó   — g | ]
}|d          ‘ŒS r   r   rò  s     r   r0  zHAverageTimeBetweenAttacksForEachVoiceFeature.process.<locals>.<listcomp>˜	  ó   € ÐGÐGÐG°&�f˜_Ô-ÐGÐGÐGr   r7   rè   r#  r$  úat least one part lacks notes)r$   r³   r<   r=   rõ  r#   r@   r   r>   r?   r%   r&   )
r   ÚonsetsByPartÚ	avgByPartr'   r÷  r'  r(  r)  r*  r+  s
             r   r)   z4AverageTimeBetweenAttacksForEachVoiceFeature.processŽ	  s¸  € ØˆØˆ	ØŒ9Ô !Ò#Ð#Ý˜4œ9Ô/Ñ0Ô0ð ,ð ,�Ø!œY wÔ/°Ô2Ð3DÔE�
ØKÐKÀ
ÐKÑKÔK�Ø×#Ò# FÑ+Ô+Ð+Ð+ð,ð
 œÐ#4Ô5ˆJØGÐG¸JÐGÑGÔGˆFØ×Ò Ñ'Ô'Ð'à"ð 	Bð 	BˆFà�KŠK‰MŒMˆMØˆKÝ! &Ñ)Ô)ð ,ð ,‘��1Ø�˜F™œ a™Ò'Ð'Ø�EØ˜q 1™uœ�à˜a‘i�Ý˜s C°Ð6Ñ6Ô6ð ,Ø×&Ò& sÑ+Ô+Ð+øØð QÝ/Ð0OÑPÔPÐPØ×Ò�S Ñ-Ô-µ°KÑ0@Ô0@Ñ@ÑAÔAÐAÐAå!$ Y¡¤µ#°i±.´.Ñ!@ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r3  r3  u	  sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðAð Að Að Að Að Að Ar   r3  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú9AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeaturea™  
    Average standard deviation, in seconds, of time between Note On events on individual
    channels that contain at least one note.

    >>> s = corpus.parse('bwv66.6')
    >>> for p in s.parts:
    ...     p.insert(0, tempo.MetronomeMark(number=120))
    >>> fe = features.jSymbolic.AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.177...]
    ÚR25Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z:Average Variability of Time Between Attacks For Each Voicez}Average standard deviation, in seconds, of time between Note On events on individual channels that contain at least one note.Tr7   r   r8   r   s      €r   r   zBAverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature.__init__¿	  sK   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àPˆŒ	ð1ˆÔð !ˆÔØˆŒˆˆr   c                óþ  — g }g }| j         j        dk    rWt          | j         j        ¦  «        D ]<}| j         d         |         d         }d„ |D ¦   «         }|                     |¦  «         Œ=n.| j         d         }d„ |D ¦   «         }|                     |¦  «         |D ]´}|                     ¦   «          g }t          |¦  «        D ]T\  }}|t          |¦  «        dz
  k    r n8||dz            }||z
  }	t          |	dd¬	¦  «        s|                     |	¦  «         ŒU|st          d
¦  «        ‚|                     t          j
        |¦  «        ¦  «         Œµt          |¦  «        t          |¦  «        z  | j        j        d<   d S )Nr   r±   rî  c                ó   — g | ]
}|d          ‘ŒS r   r   rò  s     r   r0  zUAverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature.process.<locals>.<listcomp>Ð	  r8  r   c                ó   — g | ]
}|d          ‘ŒS r   r   rò  s     r   r0  zUAverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature.process.<locals>.<listcomp>Ô	  r:  r   r7   rè   r#  r$  r;  )r$   r³   r<   r=   rõ  r#   r@   r   r>   r1  r  r?   r%   r&   )
r   r<  ÚstdDeviationByPartr'   r÷  r'  r(  r)  r*  r+  s
             r   r)   zAAverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature.processÉ	  s¸  € ØˆØÐàŒ9Ô !Ò#Ð#Ý˜4œ9Ô/Ñ0Ô0ð ,ð ,�Ø!œY wÔ/°Ô2Ð3DÔE�
ØKÐKÀ
ÐKÑKÔK�Ø×#Ò# FÑ+Ô+Ð+Ð+ð,ð
 œÐ#4Ô5ˆJØGÐG¸JÐGÑGÔGˆFØ×Ò Ñ'Ô'Ð'à"ð 	Fð 	FˆFà�KŠK‰MŒMˆMØˆKÝ! &Ñ)Ô)ð ,ð ,‘��1Ø�˜F™œ a™Ò'Ð'Ø�EØ˜q 1™uœ�Ø˜a‘i�å˜s C°Ð6Ñ6Ô6ð ,Ø×&Ò& sÑ+Ô+Ð+øØð QÝ/Ð0OÑPÔPÐPØ×%Ò%¥jÔ&7¸Ñ&DÔ&DÑEÔEÐEÐEÝ"%Ð&8Ñ"9Ô"9Ý$'Ð(:Ñ$;Ô$;ñ#<ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r?  r?  ®	  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð=ð =ð =ð =ð =ð =ð =r   r?  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚInitialTempoFeaturezà
    Tempo in beats per minute at the start of the recording.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.InitialTempoFeature(s)
    >>> f = fe.extract()
    >>> f.vector  # a default
    [96.0]
    ÚR30Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zInitial Tempoz8Tempo in beats per minute at the start of the recording.Tr7   r   r8   r   s      €r   r   zInitialTempoFeature.__init__6
  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à#ˆŒ	ØUˆÔØ ˆÔØˆŒˆˆr   c                ó~   — | j         d         }|d         d         }|                     ¦   «         | j        j        d<   d S )NÚmetronomeMarkBoundariesr   r�   )r$   ÚgetQuarterBPMr%   r&   )r   ÚtriplesÚmms      r   r)   zInitialTempoFeature.process>
  s=   € Ø”)Ð5Ô6ˆà�QŒZ˜Œ]ˆà!#×!1Ò!1Ñ!3Ô!3ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rG  rG  )
  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð4ð 4ð 4ð 4ð 4ð 4ð 4r   rG  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚInitialTimeSignatureFeaturea=  
    A feature array with two elements. The first is the numerator of the first occurring
    time signature and the second is the denominator of the first occurring time signature.
    Both are set to 0 if no time signature is present.

    >>> s1 = stream.Stream()
    >>> s1.append(meter.TimeSignature('3/4'))
    >>> fe = features.jSymbolic.InitialTimeSignatureFeature(s1)
    >>> fe.extract().vector
    [3, 4]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.InitialTimeSignatureFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [4, 4]
    ÚR31Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zInitial Time SignaturezßA feature array with two elements. The first is the numerator of the first occurring time signature and the second is the denominator of the first occurring time signature. Both are set to 0 if no time signature is present.Tr�   r   r8   r   s      €r   r   z$InitialTimeSignatureFeature.__init__[
  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à,ˆŒ	ð\ˆÔð !ˆÔØˆŒˆˆr   c                óØ   — | j         d         }|sd S |d         }t                               d|g¦  «         |d         j        | j        j        d<   |d         j        | j        j        d<   d S )Nú&flat.getElementsByClass(TimeSignature)r   zfound tsr7   )r$   ÚenvironLocalÚ
printDebugÚ	numeratorr%   r&   Údenominator)r   ÚelementsÚtss      r   r)   z#InitialTimeSignatureFeature.processf
  sp   € Ø”9ÐEÔFˆØð 	ØˆFØ�aŒ[ˆÝ×Ò ¨RÐ 0Ñ1Ô1Ð1Ø!)¨!¤Ô!6ˆŒÔ˜AÑØ!)¨!¤Ô!8ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rP  rP  F
  s]   ø€ € € € € ðð ð$ 
€Bð	ð 	ð 	ð 	ð 	ð 	ð9ð 9ð 9ð 9ð 9ð 9ð 9r   rP  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚCompoundOrSimpleMeterFeatureaº  
    Set to 1 if the initial meter is compound (numerator of time signature
    is greater than or equal to 6 and is evenly divisible by 3) and to 0 if it is simple
    (if the above condition is not fulfilled).

    >>> s1 = stream.Stream()
    >>> s1.append(meter.TimeSignature('3/4'))
    >>> fe = features.jSymbolic.CompoundOrSimpleMeterFeature(s1)
    >>> fe.extract().vector
    [0]

    >>> s2 = stream.Stream()
    >>> s2.append(meter.TimeSignature('9/8'))
    >>> fe.setData(s2)  # change the data
    >>> fe.extract().vector
    [1]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.CompoundOrSimpleMeterFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0]
    ÚR32Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zCompound Or Simple MeterzÆSet to 1 if the initial meter is compound (numerator of time signature is greater than or equal to 6 and is evenly divisible by 3) and to 0 if it is simple (if the above condition is not fulfilled).Tr7   r   r8   r   s      €r   r   z%CompoundOrSimpleMeterFeature.__init__‹
  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ðIˆÔð !ˆÔØˆŒˆˆr   c                ó    — | j         d         }|r<	 |d         j        }n# t          j        $ r Y d S w xY w|dk    rd| j        j        d<   d S d S d S )NrT  r   ÚCompoundr7   )r$   ÚbeatDivisionCountNamer	   ÚTimeSignatureExceptionr%   r&   )r   rY  Ú	countNames      r   r)   z$CompoundOrSimpleMeterFeature.process–
  s�   € Ø”9ÐEÔFˆàð 	+ðØ$ QœKÔ=�	�	øÝÔ6ð ð ð Ø��ðøøøà˜JÒ&Ð&Ø)*�”Ô# AÑ&Ð&Ð&ð	+ð 	+ð
 'Ð&s   ‘ Ÿ2±2r*   r+   r2   s   @r   r\  r\  p
  s]   ø€ € € € € ðð ð0 
€Bð	ð 	ð 	ð 	ð 	ð 	ð	+ð 	+ð 	+ð 	+ð 	+ð 	+ð 	+r   r\  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚTripleMeterFeaturea!  
    Set to 1 if numerator of initial time signature is 3, set to 0 otherwise.

    >>> s1 = stream.Stream()
    >>> s1.append(meter.TimeSignature('5/4'))
    >>> fe = features.jSymbolic.TripleMeterFeature(s1)
    >>> fe.extract().vector
    [0]

    >>> s2 = stream.Stream()
    >>> s2.append(meter.TimeSignature('3/4'))
    >>> fe.setData(s2)  # change the data
    >>> fe.extract().vector
    [1]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.TripleMeterFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0]
    ÚR33Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zTriple MeterzISet to 1 if numerator of initial time signature is 3, set to 0 otherwise.Tr7   r   r8   r   s      €r   r   zTripleMeterFeature.__init__»
  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à"ˆŒ	ð2ˆÔà ˆÔØˆŒˆˆr   c                ól   — | j         d         }|r"|d         j        dk    rd| j        j        d<   d S d S d S )NrT  r   rp   r7   ©r$   rW  r%   r&   ©r   rY  s     r   r)   zTripleMeterFeature.processÄ
  sM   € Ø”9ÐEÔFˆàð 	'˜ œÔ-°Ò2Ð2Ø%&ˆDŒLÔ Ñ"Ð"Ð"ð	'ð 	'Ð2Ð2r   r*   r+   r2   s   @r   re  re  ¢
  s]   ø€ € € € € ðð ð, 
€Bðð ð ð ð ð ð'ð 'ð 'ð 'ð 'ð 'ð 'r   re  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚQuintupleMeterFeaturea'  
    Set to 1 if numerator of initial time signature is 5, set to 0 otherwise.

    >>> s1 = stream.Stream()
    >>> s1.append(meter.TimeSignature('5/4'))
    >>> fe = features.jSymbolic.QuintupleMeterFeature(s1)
    >>> fe.extract().vector
    [1]

    >>> s2 = stream.Stream()
    >>> s2.append(meter.TimeSignature('3/4'))
    >>> fe.setData(s2)  # change the data
    >>> fe.extract().vector
    [0]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.QuintupleMeterFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0]
    ÚR34Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zQuintuple MeterzISet to 1 if numerator of initial time signature is 5, set to 0 otherwise.Tr7   r   r8   r   s      €r   r   zQuintupleMeterFeature.__init__ä
  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à%ˆŒ	ð2ˆÔà ˆÔØˆŒˆˆr   c                ól   — | j         d         }|r"|d         j        dk    rd| j        j        d<   d S d S d S )NrT  r   é   r7   ri  rj  s     r   r)   zQuintupleMeterFeature.processí
  sM   € Ø”9ÐEÔFˆØð 	'˜ œÔ-°Ò2Ð2Ø%&ˆDŒLÔ Ñ"Ð"Ð"ð	'ð 	'Ð2Ð2r   r*   r+   r2   s   @r   rl  rl  Ë
  s]   ø€ € € € € ðð ð, 
€Bðð ð ð ð ð ð'ð 'ð 'ð 'ð 'ð 'ð 'r   rl  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚChangesOfMeterFeatureab  
    Returns 1 if the time signature is changed one or more
    times during the recording.

    >>> s1 = stream.Stream()
    >>> s1.append(meter.TimeSignature('3/4'))
    >>> fe = features.jSymbolic.ChangesOfMeterFeature(s1)
    >>> fe.extract().vector
    [0]

    >>> s2 = stream.Stream()
    >>> s2.append(meter.TimeSignature('3/4'))
    >>> s2.append(meter.TimeSignature('4/4'))
    >>> fe.setData(s2)  # change the data
    >>> fe.extract().vector
    [1]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.ChangesOfMeterFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0]
    ÚR35Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zChanges of MeterzPSet to 1 if the time signature is changed one or more times during the recordingTr7   r   r8   r   s      €r   r   zChangesOfMeterFeature.__init__  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à&ˆŒ	ð9ˆÔà ˆÔØˆŒˆˆr   c                óÂ   — | j         d         }t          |¦  «        dk    rd S |d         }|dd …         D ])}|                     |¦  «        sd| j        j        d<    d S Œ*d S )NrT  r7   r   )r$   r@   Ú
ratioEqualr%   r&   )r   rY  ÚfirstÚes       r   r)   zChangesOfMeterFeature.process  s€   € Ø”9ÐEÔFˆÝˆx‰=Œ=˜AÒÐØˆFØ˜”ˆØ˜!˜"˜"”ð 	ð 	ˆAØ×#Ò# AÑ&Ô&ð Ø)*�”Ô# AÑ&Ø��ðð	ð 	r   r*   r+   r2   s   @r   rr  rr  ó
  s]   ø€ € € € € ðð ð. 
€Bðð ð ð ð ð ðð ð ð ð ð ð r   rr  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )ÚDurationFeaturea2  
    A feature extractor that extracts the duration of the piece in seconds.

    >>> s = corpus.parse('bwv66.6')
    >>> for p in s.parts:
    ...     p.insert(0, tempo.MetronomeMark(number=120))
    >>> fe = features.jSymbolic.DurationFeature(s)
    >>> f = fe.extract()
    >>> f.vector[0]
    18.0
    ÚR36Nc                ó„   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d| _        d S )Nr   ÚDurationz+The total duration in seconds of the music.Fr7   r   rÔ   r   s      €r   r   zDurationFeature.__init__/  sN   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àˆŒ	ØHˆÔØ!ˆÔØˆŒØˆŒˆˆr   c                ó¬   — | j         d         }|st          d¦  «        ‚d„ |D ¦   «         }|                     ¦   «          |d         | j        j        d<   d S )Nrî  zinput lacks durationc                ó   — g | ]
}|d          ‘ŒS rð  r   rò  s     r   r0  z+DurationFeature.process.<locals>.<listcomp>>  rô  r   r¿   r   )r$   r>   rõ  r%   r&   rö  s      r   r)   zDurationFeature.process8  sf   € Ø”YÐ0Ô1ˆ
Øð 	DÝ+Ð,BÑCÔCÐCð HÐG¸JÐGÑGÔGˆ	Ø�ŠÑÔÐØ!*¨2¤ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rz  rz  !  s]   ø€ € € € € ð
ð 
ð 
€Bðð ð ð ð ð ð/ð /ð /ð /ð /ð /ð /r   rz  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚOverallDynamicRangeFeaturezj
    Not implemented

    The maximum loudness minus the minimum loudness value.

    TODO: implement
    ÚD1Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zOverall Dynamic Rangez6The maximum loudness minus the minimum loudness value.Tr7   r   r8   r   s      €r   r   z#OverallDynamicRangeFeature.__init__Q  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ØSˆÔØ ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r�  r�  G  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r�  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚVariationOfDynamicsFeaturezh
    Not implemented

    Standard deviation of loudness levels of all notes.

    TODO: implement

    ÚD2Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zVariation of Dynamicsz3Standard deviation of loudness levels of all notes.Tr7   r   r8   r   s      €r   r   z#VariationOfDynamicsFeature.__init__e  sG   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ØPˆÔØ ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r…  r…  Z  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r…  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú%VariationOfDynamicsInEachVoiceFeaturez§
    Not implemented

    The average of the standard deviations of loudness levels within each
    channel that contains at least one note.

    TODO: implement

    ÚD3Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z#Variation of Dynamics In Each VoiceznThe average of the standard deviations of loudness levels within each channel that contains at least one note.Tr7   r   r8   r   s      €r   r   z.VariationOfDynamicsInEachVoiceFeature.__init__z  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à9ˆŒ	ðZˆÔà ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r‰  r‰  n  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r‰  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú&AverageNoteToNoteDynamicsChangeFeaturez 
    Not implemented

    Average change of loudness from one note to the next note in the
    same channel (in MIDI velocity units).

    TODO: implement

    ÚD4Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z$Average Note To Note Dynamics ChangezgAverage change of loudness from one note to the next note in the same channel (in MIDI velocity units).Tr7   r   r8   r   s      €r   r   z/AverageNoteToNoteDynamicsChangeFeature.__init__‘  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à:ˆŒ	ðLˆÔà ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r�  r�  „  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r�  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú'MaximumNumberOfIndependentVoicesFeatureaá  
    Maximum number of different channels in which notes have sounded simultaneously.
    Here, Parts are treated as channels.

    >>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga')
    >>> fe = features.jSymbolic.MaximumNumberOfIndependentVoicesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [3]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.MaximumNumberOfIndependentVoicesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [4]
    ÚT1Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z$Maximum Number of Independent VoiceszuMaximum number of different channels in which notes have sounded simultaneously. Here, Parts are treated as channels.Tr7   r   r8   r   s      €r   r   z0MaximumNumberOfIndependentVoicesFeature.__init__³  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à:ˆŒ	ð`ˆÔà ˆÔØˆŒˆˆr   c                óú   — d}| j         d         D ][}t          j        ¦   «         }|j        D ]!}|j        D ]}|                     |¦  «         ŒŒ"t          |t          |¦  «        ¦  «        }Œ\|| j        j	        d<   d S )Nr   ú'chordify.flat.getElementsByClass(Chord))
r$   r   ÚGroupsr+  Úgroupsr=   rJ   r@   r%   r&   ©r   Úfoundr¸   Úgr/  ÚgSubs         r   r)   z/MaximumNumberOfIndependentVoicesFeature.process¼  s�   € àˆØ”ÐDÔEð 	'ð 	'ˆAõ ”‘”ˆAØ”Yð #ð #�ØœHð #ð #�DØ—H’H˜T‘N”N�N�Nð#å˜�s 1™vœvÑ&Ô&ˆEˆEØ!&ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r‘  r‘  Ÿ  s]   ø€ € € € € ðð ð" 
€Bðð ð ð ð ð ð'ð 'ð 'ð 'ð 'ð 'ð 'r   r‘  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú'AverageNumberOfIndependentVoicesFeaturea  
    Average number of different channels in which notes have sounded simultaneously.
    Rests are not included in this calculation. Here, Parts are treated as voices

    >>> s = corpus.parse('handel/rinaldo/lascia_chio_pianga')
    >>> fe = features.jSymbolic.AverageNumberOfIndependentVoicesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [1.528...]

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.AverageNumberOfIndependentVoicesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [3.90...]
    ÚT2Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z$Average Number of Independent VoiceszžAverage number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation. Here, Parts are treated as voicesTr7   r   r8   r   s      €r   r   z0AverageNumberOfIndependentVoicesFeature.__init__Ý  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à:ˆŒ	ðMˆÔð !ˆÔØˆŒˆˆr   c                ó`  — g }| j         d         D ]`}t          j        ¦   «         }|j        D ]!}|j        D ]}|                     |¦  «         ŒŒ"|                     t          |¦  «        ¦  «         Œa|st          d¦  «        ‚t          |¦  «        t          |¦  «        z  | j	        j
        d<   d S )Nr•  r;   r   )r$   r   r–  r+  r—  r=   r@   r>   r?   r%   r&   r˜  s         r   r)   z/AverageNumberOfIndependentVoicesFeature.processç  s¼   € àˆØ”ÐDÔEð 	!ð 	!ˆAõ ”‘”ˆAØ”Yð #ð #�ØœHð #ð #�DØ—H’H˜T‘N”N�N�Nð#à�LŠL�˜Q™œÑ Ô Ð Ð Øð 	AÝ+Ð,?Ñ@Ô@Ð@Ý!$ U¡¤­c°%©j¬jÑ!8ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r�  r�  Ê  s]   ø€ € € € € ðð ð  
€Bðð ð ð ð ð ð9ð 9ð 9ð 9ð 9ð 9ð 9r   r�  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú-VariabilityOfNumberOfIndependentVoicesFeatureaG  
    Standard deviation of number of different channels in which notes have sounded simultaneously.
    Rests are not included in this calculation.

    >>> s = corpus.parse('bwv66.6')
    >>> fe = features.jSymbolic.VariabilityOfNumberOfIndependentVoicesFeature(s)
    >>> f = fe.extract()
    >>> f.vector
    [0.449...]
    ÚT3Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z+Variability of Number of Independent VoiceszŠStandard deviation of number of different channels in which notes have sounded simultaneously. Rests are not included in this calculation.Tr7   r   r8   r   s      €r   r   z6VariabilityOfNumberOfIndependentVoicesFeature.__init__  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àAˆŒ	ð@ˆÔð !ˆÔØˆŒˆˆr   c                óJ  — g }| j         d         D ]`}t          j        ¦   «         }|j        D ]!}|j        D ]}|                     |¦  «         ŒŒ"|                     t          |¦  «        ¦  «         Œa|r#t          j        |¦  «        | j	        j
        d<   d S t          d¦  «        ‚)Nr•  r   r;   )r$   r   r–  r+  r—  r=   r@   r1  r  r%   r&   r>   r˜  s         r   r)   z5VariabilityOfNumberOfIndependentVoicesFeature.process  s¶   € àˆØ”ÐDÔEð 	!ð 	!ˆAõ ”‘”ˆAØ”Yð #ð #�ØœHð #ð #�DØ—H’H˜T‘N”N�N�Nð#à�LŠL�˜Q™œÑ Ô Ð Ð Øð 	AÝ%/Ô%6°uÑ%=Ô%=ˆDŒLÔ Ñ"Ð"Ð"å+Ð,?Ñ@Ô@Ð@r   r*   r+   r2   s   @r   r¢  r¢  ÷  sd   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ðAð Að Að Að Að Að Ar   r¢  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú!VoiceEqualityNumberOfNotesFeaturez›
    Not implemented

    TODO: implement

    Standard deviation of the total number of Note Ons in each channel
    that contains at least one note.
    ÚT4Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z Voice Equality - Number of NoteszcStandard deviation of the total number of Note Ons in each channel that contains at least one note.Tr7   r   r8   r   s      €r   r   z*VoiceEqualityNumberOfNotesFeature.__init__+  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à6ˆŒ	ðOˆÔà ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r§  r§     sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r§  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú VoiceEqualityNoteDurationFeatureú/
    Not implemented

    TODO: implement

    ÚT5Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zVoice Equality - Note DurationzmStandard deviation of the total duration of notes in seconds in each channel that contains at least one note.Tr7   r   r8   r   s      €r   r   z)VoiceEqualityNoteDurationFeature.__init__>  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à4ˆŒ	ðOˆÔà ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r«  r«  5  óN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r«  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚVoiceEqualityDynamicsFeaturer¬  ÚT6Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zVoice Equality - DynamicszbStandard deviation of the average volume of notes in each channel that contains at least one note.Tr7   r   r8   r   s      €r   r   z%VoiceEqualityDynamicsFeature.__init__Q  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à/ˆŒ	ðOˆÔà ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r±  r±  H  r¯  r   r±  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú VoiceEqualityMelodicLeapsFeaturer¬  ÚT7Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zVoice Equality - Melodic Leapsz•
            Standard deviation
            of the average melodic leap in MIDI pitches
            for each channel that contains at least one note.Tr7   r   rÔ  r   s      €r   r   z)VoiceEqualityMelodicLeapsFeature.__init__d  s[   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à4ˆŒ	Ý!ð #Añ Bô BˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rµ  rµ  [  sN   ø€ € € € € ðð ð 
€Bð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r   rµ  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚVoiceEqualityRangeFeaturez 
    Not implemented

    Standard deviation of the differences between the highest and lowest
    pitches in each channel that contains at least one note.
    ÚT8Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zVoice Equality - Rangez–
            Standard deviation of the differences between the
            highest and lowest pitches in each channel that contains at least one note.Tr7   r   rÔ  r   s      €r   r   z"VoiceEqualityRangeFeature.__init__y  s[   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à,ˆŒ	Ý!ð #[ñ \ô \ˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r¹  r¹  p  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r¹  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚImportanceOfLoudestVoiceFeatureú.
    Not implemented

    TODO: implement
    ÚT9Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zImportance of Loudest Voicez²
            Difference between the average loudness
            of the loudest channel and the average loudness of the other channels
            that contain at least one note.Tr7   r   rÔ  r   s      €r   r   z(ImportanceOfLoudestVoiceFeature.__init__Œ  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à1ˆŒ	Ý!ð #/ñ 0ô 0ˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r½  r½  „  sN   ø€ € € € € ðð ð
 
€Bð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r   r½  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú"RelativeRangeOfLoudestVoiceFeaturer¾  ÚT10Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zRelative Range of Loudest Voicezñ
            Difference between the highest note and the lowest note
            played in the channel with the highest average loudness divided by the difference
            between the highest note and the lowest note overall in the piece.Tr7   r   rÔ  r   s      €r   r   z+RelativeRangeOfLoudestVoiceFeature.__init__   s[   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à5ˆŒ	Ý!ð #Rñ Sô SˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rÂ  rÂ  ˜  óN   ø€ € € € € ðð ð
 
€Bð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r   rÂ  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚRangeOfHighestLineFeaturer¾  ÚT12Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zRange of Highest Linezæ
            Difference between the highest note and the lowest note
            played in the channel with the highest average pitch divided by the difference
            between the highest note and the lowest note in the piece.Tr7   r   rÔ  r   s      €r   r   z"RangeOfHighestLineFeature.__init__´  s[   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	Ý!ð #Jñ Kô KˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rÇ  rÇ  ¬  rÅ  r   rÇ  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú'RelativeNoteDensityOfHighestLineFeaturer¬  ÚT13Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   z%Relative Note Density of Highest Linez¿
            Number of Note Ons in the channel with the highest average
            pitch divided by the average number of Note Ons in all channels that contain at
            least one note.Tr7   r   rÔ  r   s      €r   r   z0RelativeNoteDensityOfHighestLineFeature.__init__É  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à;ˆŒ	Ý!ð #ñ  ô  ˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rË  rË  À  óN   ø€ € € € € ðð ð 
€Bð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r   rË  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú#MelodicIntervalsInLowestLineFeaturer¾  ÚT15Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   z Melodic Intervals in Lowest LinezÐ
            Average melodic interval in semitones of the channel
            with the lowest average pitch divided by the average melodic interval of all
            channels that contain at least two notes.Tr7   r   rÔ  r   s      €r   r   z,MelodicIntervalsInLowestLineFeature.__init__Ý  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à6ˆŒ	Ý!ð #9ñ :ô :ˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rÐ  rÐ  Õ  rÅ  r   rÐ  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚVoiceSeparationFeaturez¾
    Not implemented

    Average separation in semitones between the average pitches of consecutive
    channels (after sorting based/non-average pitch) that contain at least one note.
    ÚT20Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zVoice SeparationzÁ
            Average separation in semi-tones between the average pitches of
            consecutive channels (after sorting based/non average pitch) that contain at
            least one note.Tr7   r   rÔ  r   s      €r   r   zVoiceSeparationFeature.__init__ò  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à&ˆŒ	Ý!ð #ñ  ô  ˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rÔ  rÔ  é  rÎ  r   rÔ  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú PitchedInstrumentsPresentFeaturea‚  
    Which pitched General MIDI Instruments are present. There is one entry
    for each instrument, which is set to 1.0 if there is at least one Note On
    in the recording corresponding to the instrument and to 0.0 if there is not.

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.AcousticGuitar())
    >>> s1.append(note.Note())
    >>> s1.append(instrument.Tuba())
    >>> s1.append(note.Note())
    >>> fe = features.jSymbolic.PitchedInstrumentsPresentFeature(s1)
    >>> fe.extract().vector
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

    Default instruments will lack a `.midiProgram`, so they raise exceptions:

    >>> i = instrument.Instrument()
    >>> i.midiProgram is None
    True
    >>> s2 = stream.Stream()
    >>> s2.append(i)
    >>> s2.append(note.Note())
    >>> fe2 = features.jSymbolic.PitchedInstrumentsPresentFeature(s2)
    >>> fe2.extract()
    Traceback (most recent call last):
    music21.features.jSymbolic.JSymbolicFeatureException:
    <music21.instrument.Instrument ''> lacks a midiProgram
    ÚI1Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zPitched Instruments Presenta  
            Which pitched General MIDI Instruments are present.
            There is one entry for each instrument, which is set to 1.0 if there is at
            least one Note On in the recording corresponding to the instrument and to
            0.0 if there is not.Tr   r   rÔ  r   s      €r   r   z)PitchedInstrumentsPresentFeature.__init__&  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à1ˆŒ	Ý!ð #$ñ %ô %ˆÔð
 !ˆÔØˆŒˆˆr   c                óv  — | j         d         }|st          d¦  «        ‚|j        D ]’}|                     t          ¦  «                             ¦   «         }|                     ¦   «         j        rK|j        €0t          |¦  «        pt          |¦  «        }t          |› d�¦  «        ‚d| j        j        |j        <   Œ“dS )r!   ÚpartitionByInstrumentúinput lacks instrumentsNú lacks a midiProgramr7   )r$   r>   r±   ÚgetElementsByClassr
   rw  ÚrecurseÚnotesÚmidiProgramÚstrÚreprr%   r&   )r   Úsr/  r'   ÚiStrs        r   r)   z(PitchedInstrumentsPresentFeature.process2  s¿   € ð ŒIÐ-Ô.ˆð ð 	GÝ+Ð,EÑFÔFÐFØ”ð 	7ð 	7ˆAà×$Ò$¥ZÑ0Ô0×6Ò6Ñ8Ô8ˆAØ�yŠy‰{Œ{Ô ð 7Ø”=Ð(Ý˜q™6œ6Ð,¥T¨!¡W¤W�DÝ3°tÐ4QÐ4QÐ4QÑRÔRÐRØ56�”Ô# A¤MÑ2øð	7ð 	7r   r*   r+   r2   s   @r   rØ  rØ    s^   ø€ € € € € ð ð  ðB 
€Bð
ð 
ð 
ð 
ð 
ð 
ð7ð 7ð 7ð 7ð 7ð 7ð 7r   rØ  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú"UnpitchedInstrumentsPresentFeatureaÊ  
    Not yet implemented

    Which unpitched MIDI Percussion Key Map instruments are present.
    There is one entry for each instrument, which is set to 1.0 if there is
    at least one Note On in the recording corresponding to the instrument and to
    0.0 if there is not. It should be noted that only instruments 35 to 81 are included here,
    as they are the ones that meet the official standard. They are numbered in this
    array from 0 to 46.
    ÚI2Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   zUnpitched Instruments PresentaÐ  
            Which unpitched MIDI Percussion Key Map instruments are present.
            There is one entry for each instrument, which is set to 1.0 if there is at least one
            Note On in the recording corresponding to the instrument and to 0.0 if there is not.
            It should be noted that only instruments 35 to 81 are included here, as they are the
            ones that meet the official standard. They are numbered in this array from 0 to 46.Té/   r   rÔ  r   s      €r   r   z+UnpitchedInstrumentsPresentFeature.__init__U  s[   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à3ˆŒ	Ý!ð #cñ dô dˆÔð !ˆÔØˆŒˆˆr   c                ó    — t          d¦  «        ‚rW  rX  rY  s    r   r)   z*UnpitchedInstrumentsPresentFeature.processb  rZ  r   r*   r+   r2   s   @r   rè  rè  E  s]   ø€ € € € € ð	ð 	ð 
€Bðð ð ð ð ð ð?ð ?ð ?ð ?ð ?ð ?ð ?r   rè  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú)NotePrevalenceOfPitchedInstrumentsFeaturea  

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.AcousticGuitar())
    >>> s1.repeatAppend(note.Note(), 4)
    >>> s1.append(instrument.Tuba())
    >>> s1.append(note.Note())
    >>> fe = features.jSymbolic.NotePrevalenceOfPitchedInstrumentsFeature(s1)
    >>> fe.extract().vector
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0.8..., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2...,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

    `.midiProgram` cannot be None:

    >>> s1.getInstruments().first().midiProgram = None
    >>> fe2 = features.jSymbolic.NotePrevalenceOfPitchedInstrumentsFeature(s1)
    >>> fe2.extract()
    Traceback (most recent call last):
    music21.features.jSymbolic.JSymbolicFeatureException: Acoustic Guitar lacks a midiProgram
    ÚI3Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z&Note Prevalence of Pitched InstrumentszúThe fraction of (pitched) notes played by each General MIDI Instrument. There is one entry for each instrument, which is set to the number of Note Ons played using the corresponding MIDI patch divided by the total number of Note Ons in the recording.Tr   r   r8   r   s      €r   r   z2NotePrevalenceOfPitchedInstrumentsFeature.__init__„  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à<ˆŒ	ðXˆÔð
 !ˆÔØˆŒˆˆr   c                óÎ  — | j         d         }t          | j         d         ¦  «        }|st          d¦  «        ‚|j        D ]¤}|                     t
          ¦  «                             ¦   «         }|                     ¦   «         j        }|r[|j	        €0t          |¦  «        pt          |¦  «        }t          |› d�¦  «        ‚t          |¦  «        |z  | j        j        |j	        <   Œ¥dS )r!   rÜ  rá   r;   NrÞ  )r$   r?   r>   r±   rß  r
   rw  rà  rá  râ  rã  rä  r@   r%   r&   )r   rå  ri   r/  r'   ÚpNotesræ  s          r   r)   z1NotePrevalenceOfPitchedInstrumentsFeature.process�  sé   € ð ŒIÐ-Ô.ˆÝ�D”IÐ;Ô<Ñ=Ô=ˆð ð 	AÝ+Ð,?Ñ@Ô@Ð@Ø”ð 	Ið 	IˆAà×$Ò$¥ZÑ0Ô0×6Ò6Ñ8Ô8ˆAØ—Y’Y‘[”[Ô&ˆFØð IØ”=Ð(Ý˜q™6œ6Ð,¥T¨!¡W¤W�DÝ3°tÐ4QÐ4QÐ4QÑRÔRÐRÝ58¸±[´[À5Ñ5H�”Ô# A¤MÑ2øð	Ið 	Ir   r*   r+   r2   s   @r   rî  rî  g  sd   ø€ € € € € ðð ð2 
€Bð
ð 
ð 
ð 
ð 
ð 
ðIð Ið Ið Ið Ið Ið Ir   rî  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú+NotePrevalenceOfUnpitchedInstrumentsFeaturer¬  ÚI4Nc                ó�   •—  t          ¦   «         j        dd|i|¤Ž d| _        t          d¦  «        | _        d| _        d| _        d S )Nr   z(Note Prevalence of Unpitched Instrumentsa  
            The fraction of (unpitched) notes played by each General MIDI
            Percussion Key Map Instrument. There is one entry for each instrument, which is set
            to the number of Note Ons played using the corresponding MIDI note value divided by
            the total number of Note Ons in the recording. It should be noted that only instruments
            35 to 81 are included here, as they are the ones that meet the official standard.
            They are numbered in this array from 0 to 46.Trë  r   rÔ  r   s      €r   r   z4NotePrevalenceOfUnpitchedInstrumentsFeature.__init__¯  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à>ˆŒ	Ý!ð #=ñ >ô >ˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rô  rô  ¥  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   rô  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú)TimePrevalenceOfPitchedInstrumentsFeatureaˆ  
    Not implemented

    The fraction of the total time of the recording in
    which a note was sounding for each (pitched) General
    MIDI Instrument. There is one entry for each instrument,
    which is set to the total time in seconds during which a
    given instrument was sounding one or more notes divided by the total length
    in seconds of the piece.'

    TODO: implement

    ÚI5Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z&Time Prevalence of Pitched Instrumentsa>  The fraction of the total time of the recording in which a note was sounding for each (pitched) General MIDI Instrument. There is one entry for each instrument, which is set to the total time in seconds during which a given instrument was sounding one or more notes divided by the total length in seconds of the piece.Tr   r   r8   r   s      €r   r   z2TimePrevalenceOfPitchedInstrumentsFeature.__init__Ñ  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à<ˆŒ	ðaˆÔð
 !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   rø  rø  À  sN   ø€ € € € € ðð ð 
€Bð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   rø  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú6VariabilityOfNotePrevalenceOfPitchedInstrumentsFeatureaÛ  
    Standard deviation of the fraction of Note Ons played
    by each (pitched) General MIDI instrument that is
    used to play at least one note.

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.AcousticGuitar())
    >>> s1.repeatAppend(note.Note(), 5)
    >>> s1.append(instrument.Tuba())
    >>> s1.append(note.Note())
    >>> fe = features.jSymbolic.VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature(s1)
    >>> fe.extract().vector
    [0.33333...]

    ÚI6Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z5Variability of Note Prevalence of Pitched Instrumentsz‡Standard deviation of the fraction of Note Ons played by each (pitched) General MIDI instrument that is used to play at least one note.Tr7   r   r8   r   s      €r   r   z?VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature.__init__ò  sK   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àKˆŒ	ð>ˆÔð !ˆÔØˆŒˆˆr   c                ó`  ‡— | j         d         }t          | j         d         ¦  «        }|st          d¦  «        ‚|st          d¦  «        ‚g }|j        D ]n}|                     t
          ¦  «                             ¦   «         }|                     ¦   «         j        }|r%| 	                    t          |¦  «        |z  ¦  «         Œot          |¦  «        t          |¦  «        z  Šˆfd„|D ¦   «         }t          j        t          |¦  «        t          |¦  «        z  ¦  «        | j        j        d<   d S )NrÜ  rá   rÝ  r;   c                ó6   •— g | ]}t          |‰z
  d ¦  «        ‘ŒS )r�   )Úpow)r.  Únr2  s     €r   r0  zRVariabilityOfNotePrevalenceOfPitchedInstrumentsFeature.process.<locals>.<listcomp>  s'   ø€ Ð2Ð2Ð2¨•3�q˜4‘x Ñ#Ô#Ð2Ð2Ð2r   r   )r$   r?   r>   r±   rß  r
   rw  rà  rá  r=   r@   ÚmathÚsqrtr%   r&   )	r   rå  ri   Úcollr/  r'   rò  Úpartialr2  s	           @r   r)   z>VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature.processü  s!  ø€ ØŒIÐ-Ô.ˆÝ�D”IÐ;Ô<Ñ=Ô=ˆØð 	GÝ+Ð,EÑFÔFÐFØð 	AÝ+Ð,?Ñ@Ô@Ð@àˆØ”ð 	1ð 	1ˆAà×$Ò$¥ZÑ0Ô0×6Ò6Ñ8Ô8ˆAØ—Y’Y‘[”[Ô&ˆFØð 1Ø—’�C ™KœK¨%Ñ/Ñ0Ô0Ð0øõ �4‰yŒy�3˜t™9œ9Ñ$ˆà2Ð2Ð2Ð2¨TÐ2Ñ2Ô2ˆÝ!%¤­3¨w©<¬<½#¸g¹,¼,Ñ+FÑ!GÔ!GˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   rü  rü  ß  sd   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ðHð Hð Hð Hð Hð Hð Hr   rü  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú8VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeaturea[  
    Not implemented

    Standard deviation of the fraction of Note Ons played by each (unpitched) MIDI Percussion Key
    Map instrument that is used to play at least one note. It should be noted that only
    instruments 35 to 81 are included here, as they are the ones that are included in the
    official standard.

    TODO: implement

    ÚI7Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   z7Variability of Note Prevalence of Unpitched Instrumentsa  Standard deviation of the fraction of Note Ons played by each (unpitched) MIDI Percussion Key Map instrument that is used to play at least one note. It should be noted that only instruments 35 to 81 are included here, as they are the ones that are included in the official standard.Tr7   r   r8   r   s      €r   r   zAVariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature.__init__"  sO   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?àMˆŒ	ðOð 	Ôð
 !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r  r    sN   ø€ € € € € ð
ð 
ð 
€Bð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   r  c                  ó.   ‡ — e Zd ZdZdZdˆ fd„	Zd„ Zˆ xZS )Ú!NumberOfPitchedInstrumentsFeaturear  
    Total number of General MIDI patches that are used to play at least one note.

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.AcousticGuitar())
    >>> s1.append(note.Note())
    >>> s1.append(instrument.Tuba())
    >>> s1.append(note.Note())
    >>> fe = features.jSymbolic.NumberOfPitchedInstrumentsFeature(s1)
    >>> fe.extract().vector
    [2]

    ÚI8Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zNumber of Pitched InstrumentszMTotal number of General MIDI patches that are used to play at least one note.Tr7   r   r8   r   s      €r   r   z*NumberOfPitchedInstrumentsFeature.__init__?  sI   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à3ˆŒ	ð6ˆÔà ˆÔØˆŒˆˆr   c                ó´   — | j         d         }d}|st          d¦  «        ‚|j        D ] }|                     ¦   «         j        r|dz  }Œ!|| j        j        d<   dS )r!   rÜ  r   rÝ  r7   N)r$   r>   r±   rà  rá  r%   r&   )r   rå  r]   r/  s       r   r)   z)NumberOfPitchedInstrumentsFeature.processH  sq   € ð ŒIÐ-Ô.ˆàˆØð 	GÝ+Ð,EÑFÔFÐFØ”ð 	ð 	ˆAØ�yŠy‰{Œ{Ô ð Ø˜‘
�øØ!&ˆŒÔ˜AÑÐÐr   r*   r+   r2   s   @r   r  r  /  s]   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð'ð 'ð 'ð 'ð 'ð 'ð 'r   r  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú#NumberOfUnpitchedInstrumentsFeaturea  
    Not implemented

    Number of distinct MIDI Percussion Key Map patches that were used to play at
    least one note. It should be noted that only instruments 35 to 81 are
    included here, as they are the ones that are included in the official standard.

    TODO: implement
    ÚI9Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zNumber of Unpitched InstrumentszâNumber of distinct MIDI Percussion Key Map patches that were used to play at least one note. It should be noted that only instruments 35 to 81 are included here, as they are the ones that are included in the official standard.Tr7   r   r8   r   s      €r   r   z,NumberOfUnpitchedInstrumentsFeature.__init__d  sL   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à5ˆŒ	ðJˆÔð !ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r  r  W  sN   ø€ € € € € ðð ð 
€Bð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	r   r  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚPercussionPrevalenceFeaturez§
    Not implemented

    Total number of Note Ons corresponding to unpitched percussion instruments
    divided by the total number of Note Ons in the recording.
    ÚI10Nc                óv   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        d S )Nr   zPercussion Prevalencez€Total number of Note Ons corresponding to unpitched percussion instruments divided by total number of Note Ons in the recording.Tr7   r   r8   r   s      €r   r   z$PercussionPrevalenceFeature.__init__z  sJ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à+ˆŒ	ð`ˆÔà ˆÔØˆŒˆˆr   r*   rÏ  r2   s   @r   r  r  p  sN   ø€ € € € € ðð ð 
€Bðð ð ð ð ð ð ð ð ð r   r  c                  ó*   ‡ — e Zd ZdZdˆ fd„	Zd„ Zˆ xZS )ÚInstrumentFractionFeaturez¥
    TODO: Add description of feature

    This subclass is in-turn subclassed by all FeatureExtractors that
    look at the proportional usage of an Instrument
    Nc                óL   •—  t          ¦   «         j        dd|i|¤Ž g | _        d S )Nr   r   )r   r   Ú_targetProgramsr   s      €r   r   z"InstrumentFractionFeature.__init__Œ  s5   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?ð  "ˆÔÐÐr   c                óš  — | j         d         }t          | j         d         ¦  «        }d}|st          d¦  «        ‚|st          d¦  «        ‚|j        D ]e}|                     t
          ¦  «                             ¦   «         }|j        | j        v r)|t          | 
                    ¦   «         j        ¦  «        z  }Œf||z  | j        j        d<   dS )r!   rÜ  rá   r   rÝ  r;   N)r$   r?   r>   r±   rß  r
   rw  râ  r  r@   rà  rá  r%   r&   )r   rå  ri   r]   r/  r'   s         r   r)   z!InstrumentFractionFeature.process’  sÒ   € ð ŒIÐ-Ô.ˆÝ�D”IÐ;Ô<Ñ=Ô=ˆØˆØð 	GÝ+Ð,EÑFÔFÐFØð 	AÝ+Ð,?Ñ@Ô@Ð@Ø”ð 	0ð 	0ˆAØ×$Ò$¥ZÑ0Ô0×6Ò6Ñ8Ô8ˆAØŒ} Ô 4Ð4Ð4Ø�˜QŸYšY™[œ[Ô.Ñ/Ô/Ñ/�øØ!&¨¡ˆŒÔ˜AÑÐÐr   r*   )r,   r-   r.   r/   r   r)   r1   r2   s   @r   r  r  „  sV   ø€ € € € € ðð ð"ð "ð "ð "ð "ð "ð/ð /ð /ð /ð /ð /ð /r   r  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚStringKeyboardFractionFeaturea…  
    Fraction of all Note Ons belonging to string keyboard patches
    (General MIDI patches 1 to 8).

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.Piano())
    >>> s1.repeatAppend(note.Note(), 9)
    >>> s1.append(instrument.Tuba())
    >>> s1.append(note.Note())
    >>> fe = features.jSymbolic.StringKeyboardFractionFeature(s1)
    >>> fe.extract().vector
    [0.9...]
    ÚI11Nc                óž   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        t          d¦  «        | _        d S )Nr   zString Keyboard Fractionz\Fraction of all Note Ons belonging to string keyboard patches (General MIDI patches 1 to 8).Tr7   é   r   )r   r   r   r   r   r   r<   r  r   s      €r   r   z&StringKeyboardFractionFeature.__init__µ  sY   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ð=ˆÔà ˆÔØˆŒå$ Q™xœxˆÔÐÐr   r*   rÏ  r2   s   @r   r  r  ¤  óN   ø€ € € € € ðð ð 
€Bð	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(r   r  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚAcousticGuitarFractionFeatureaµ  
    A feature extractor that extracts the fraction of all Note Ons belonging to
    acoustic guitar patches (General MIDI patches 25 and 26).

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.AcousticGuitar())
    >>> s1.repeatAppend(note.Note(), 3)
    >>> s1.append(instrument.Tuba())
    >>> s1.append(note.Note())
    >>> fe = features.jSymbolic.AcousticGuitarFractionFeature(s1)
    >>> fe.extract().vector
    [0.75]
    ÚI12Nc                óˆ   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        ddg| _        d S )	Nr   zAcoustic Guitar Fractionz_Fraction of all Note Ons belonging to acoustic guitar patches (General MIDI patches 25 and 26).Tr7   r¤   é   r   ©r   r   r   r   r   r   r  r   s      €r   r   z&AcousticGuitarFractionFeature.__init__Ò  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ð@ˆÔà ˆÔØˆŒà " B˜xˆÔÐÐr   r*   rÏ  r2   s   @r   r$  r$  Á  r"  r   r$  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚElectricGuitarFractionFeaturea.  
    >>> s1 = stream.Stream()
    >>> s1.append(instrument.ElectricGuitar())
    >>> s1.repeatAppend(note.Note(), 4)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 4)
    >>> fe = features.jSymbolic.ElectricGuitarFractionFeature(s1)
    >>> fe.extract().vector
    [0.5]
    ÚI13Nc                óº   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        t          t          dd¦  «        ¦  «        | _        d S )	Nr   zElectric Guitar Fractionz^Fraction of all Note Ons belonging to electric guitar patches (General MIDI patches 27 to 32).Tr7   é   é    r   ©	r   r   r   r   r   r   Úlistr<   r  r   s      €r   r   z&ElectricGuitarFractionFeature.__init__ì  sd   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ðWˆÔà ˆÔØˆŒå#¥E¨"¨b¡M¤MÑ2Ô2ˆÔÐÐr   r*   rÏ  r2   s   @r   r*  r*  Þ  sN   ø€ € € € € ð	ð 	ð 
€Bð	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3r   r*  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚViolinFractionFeaturea�  
    Fraction of all Note Ons belonging to violin patches (General MIDI
    patches 41 or 111).

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.Violin())
    >>> s1.repeatAppend(note.Note(), 2)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 8)
    >>> fe = features.jSymbolic.ViolinFractionFeature(s1)
    >>> fe.extract().vector
    [0.2...]
    ÚI14Nc                óˆ   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        ddg| _        d S )	Nr   zViolin FractionzVFraction of all Note Ons belonging to violin patches (General MIDI patches 41 or 111).Tr7   é(   én   r   r(  r   s      €r   r   zViolinFractionFeature.__init__	  sX   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à%ˆŒ	ð@ˆÔà ˆÔØˆŒà " C˜yˆÔÐÐr   r*   rÏ  r2   s   @r   r2  r2  ø  sN   ø€ € € € € ðð ð 
€Bð	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)r   r2  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚSaxophoneFractionFeaturea°  
    Fraction of all Note Ons belonging to saxophone patches (General MIDI
    patches 65 through 68).
    # NOTE: incorrect

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.SopranoSaxophone())
    >>> s1.repeatAppend(note.Note(), 6)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 4)
    >>> fe = features.jSymbolic.SaxophoneFractionFeature(s1)
    >>> print(fe.extract().vector[0])
    0.6
    ÚI15Nc                óˆ   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        g d¢| _        d S )Nr   zSaxophone Fractionz]Fraction of all Note Ons belonging to saxophone patches (General MIDI patches 65 through 68).Tr7   )é@   éA   éB   éC   r   r(  r   s      €r   r   z!SaxophoneFractionFeature.__init__&  sZ   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à(ˆŒ	ðDˆÔà ˆÔØˆŒà/Ð/Ð/ˆÔÐÐr   r*   rÏ  r2   s   @r   r8  r8    sN   ø€ € € € € ðð ð 
€Bð	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0r   r8  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚBrassFractionFeatureaè  
    A feature extractor that extracts the fraction of all Note Ons
    belonging to brass patches (General MIDI patches 57 through 68).

    TODO: Conflict in source: only does 57-62?

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.SopranoSaxophone())
    >>> s1.repeatAppend(note.Note(), 6)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 4)
    >>> fe = features.jSymbolic.BrassFractionFeature(s1)
    >>> print(fe.extract().vector[0])
    0.4
    ÚI16Nc                óº   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        t          t          dd¦  «        ¦  «        | _        d S )	Nr   zBrass FractionzYFraction of all Note Ons belonging to brass patches (General MIDI patches 57 through 68).Tr7   é8   é>   r   r/  r   s      €r   r   zBrassFractionFeature.__init__E  sd   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à$ˆŒ	ðDˆÔà ˆÔØˆŒå#¥E¨"¨b¡M¤MÑ2Ô2ˆÔÐÐr   r*   rÏ  r2   s   @r   r@  r@  2  óN   ø€ € € € € ðð ð  
€Bð	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3r   r@  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚWoodwindsFractionFeaturea¹  
    Fraction of all Note Ons belonging to woodwind patches
    (General MIDI patches 69 through 76).

    TODO: Conflict in source: does 69-79?

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.Flute())
    >>> s1.repeatAppend(note.Note(), 3)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 7)
    >>> fe = features.jSymbolic.WoodwindsFractionFeature(s1)
    >>> print(fe.extract().vector[0])
    0.3
    ÚI17Nc                óº   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        t          t          dd¦  «        ¦  «        | _        d S )	Nr   zWoodwinds Fractionz\Fraction of all Note Ons belonging to woodwind patches (General MIDI patches 69 through 76).Tr7   éD   éP   r   r/  r   s      €r   r   z!WoodwindsFractionFeature.__init__d  sd   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à(ˆŒ	ðDˆÔà ˆÔØˆŒå#¥E¨"¨b¡M¤MÑ2Ô2ˆÔÐÐr   r*   rÏ  r2   s   @r   rG  rG  Q  rE  r   rG  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú OrchestralStringsFractionFeaturea¡  
    Fraction of all Note Ons belonging to orchestral strings patches
    (General MIDI patches 41 or 47).

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.Violoncello())
    >>> s1.repeatAppend(note.Note(), 4)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 6)
    >>> fe = features.jSymbolic.OrchestralStringsFractionFeature(s1)
    >>> print(fe.extract().vector[0])
    0.4
    ÚI18Nc                óº   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        t          t          dd¦  «        ¦  «        | _        d S )	Nr   zOrchestral Strings FractionzaFraction of all Note Ons belonging to orchestral strings patches (General MIDI patches 41 or 47).Tr7   é)   é.   r   r/  r   s      €r   r   z)OrchestralStringsFractionFeature.__init__�  sc   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à1ˆŒ	ð?ˆÔà ˆÔØˆŒå#¥E¨"¨b¡M¤MÑ2Ô2ˆÔÐÐr   r*   rÏ  r2   s   @r   rM  rM  p  sN   ø€ € € € € ðð ð 
€Bð	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3ð 	3r   rM  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )ÚStringEnsembleFractionFeaturez�
    Not implemented

    Fraction of all Note Ons belonging to string ensemble patches
    (General MIDI patches 49 to 52).
    ÚI19Nc                óˆ   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        g d¢| _        d S )Nr   zString Ensemble Fractionz^Fraction of all Note Ons belonging to string ensemble patches (General MIDI patches 49 to 52).Tr7   )r¥   é1   é2   é3   r   r(  r   s      €r   r   z&StringEnsembleFractionFeature.__init__˜  sY   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à.ˆŒ	ð?ˆÔà ˆÔØˆŒà/Ð/Ð/ˆÔÐÐr   r*   rÏ  r2   s   @r   rS  rS  �  sN   ø€ € € € € ðð ð 
€Bð	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0ð 	0r   rS  c                  ó(   ‡ — e Zd ZdZdZdˆ fd„	Zˆ xZS )Ú!ElectricInstrumentFractionFeatureaÇ  
    Fraction of all Note Ons belonging to electric instrument patches
    (General MIDI patches 5, 6, 17, 19, 27 through 32, 24 through 40).

    >>> s1 = stream.Stream()
    >>> s1.append(instrument.ElectricOrgan())
    >>> s1.repeatAppend(note.Note(), 8)
    >>> s1.append(instrument.Tuba())
    >>> s1.repeatAppend(note.Note(), 2)
    >>> fe = features.jSymbolic.ElectricInstrumentFractionFeature(s1)
    >>> print(fe.extract().vector[0])
    0.8
    ÚI20Nc                óˆ   •—  t          ¦   «         j        dd|i|¤Ž d| _        d| _        d| _        d| _        g d¢| _        d S )Nr   zElectric Instrument Fractionz|Fraction of all Note Ons belonging to electric instrument patches (General MIDI patches 5, 6, 17, 19, 27 to 32 or 34 to 40).Tr7   )rq   rp  rw   é   r-  é   é   é   é   é   é!   é"   é#   é$   é%   é&   é'   r   r(  r   s      €r   r   z*ElectricInstrumentFractionFeature.__init__´  sc   ø€ Ø�‰ŒÔÐ?Ð? lÐ?°hÐ?Ð?Ð?à2ˆŒ	ðYˆÔà ˆÔØˆŒð Dð  Dð  DˆÔÐÐr   r*   rÏ  r2   s   @r   rZ  rZ  ¤  sX   ø€ € € € € ðð ð 
€Bð
Dð 
Dð 
Dð 
Dð 
Dð 
Dð 
Dð 
Dð 
Dð 
Dr   rZ  c                  ó   — e Zd ZdS )r>   N)r,   r-   r.   r   r   r   r>   r>   Â  s   € € € € € Ø€Dr   r>   ÚDÚIÚMÚPÚRÚTÚC)NNNNNNNNNNNNNNNNNNNNNNNNNNNNNc                ó¦   — 	 t           |          |         S # t          $ r t          d| › �¦  «        ‚t          $ r t          d| › d|› �¦  «        ‚w xY w)aa  
    Typical usage:

    >>> t5 = features.jSymbolic.getExtractorByTypeAndNumber('T', 5)
    >>> t5.__name__
    'VoiceEqualityNoteDurationFeature'
    >>> bachExample = corpus.parse('bach/bwv66.6')
    >>> fe = t5(bachExample)

    Features unimplemented in jSymbolic but documented in the dissertation return None

    >>> features.jSymbolic.getExtractorByTypeAndNumber('C', 20) is None
    True

    Totally unknown features return an exception:

    >>> features.jSymbolic.getExtractorByTypeAndNumber('L', 900)
    Traceback (most recent call last):
    music21.features.jSymbolic.JSymbolicFeatureException: Could not find
        any jSymbolic features of type L

    >>> features.jSymbolic.getExtractorByTypeAndNumber('C', 200)
    Traceback (most recent call last):
    music21.features.jSymbolic.JSymbolicFeatureException: jSymbolic
        features of type C do not have number 200

    You could also find all the feature extractors this way:

    >>> fs = features.jSymbolic.extractorsById
    >>> for k in fs:
    ...     for i in range(len(fs[k])):
    ...       if fs[k][i] is not None:
    ...         n = fs[k][i].__name__
    ...         if fs[k][i] not in features.jSymbolic.featureExtractors:
    ...            n += ' (not implemented)'
    ...         print(f'{k} {i} {n}')
    D 1 OverallDynamicRangeFeature (not implemented)
    D 2 VariationOfDynamicsFeature (not implemented)
    D 3 VariationOfDynamicsInEachVoiceFeature (not implemented)
    D 4 AverageNoteToNoteDynamicsChangeFeature (not implemented)
    I 1 PitchedInstrumentsPresentFeature
    I 2 UnpitchedInstrumentsPresentFeature (not implemented)
    I 3 NotePrevalenceOfPitchedInstrumentsFeature
    I 4 NotePrevalenceOfUnpitchedInstrumentsFeature (not implemented)
    I 5 TimePrevalenceOfPitchedInstrumentsFeature (not implemented)
    I 6 VariabilityOfNotePrevalenceOfPitchedInstrumentsFeature
    I 7 VariabilityOfNotePrevalenceOfUnpitchedInstrumentsFeature (not implemented)
    I 8 NumberOfPitchedInstrumentsFeature
    I 9 NumberOfUnpitchedInstrumentsFeature (not implemented)
    I 10 PercussionPrevalenceFeature (not implemented)
    I 11 StringKeyboardFractionFeature
    I 12 AcousticGuitarFractionFeature
    I 13 ElectricGuitarFractionFeature
    I 14 ViolinFractionFeature
    I 15 SaxophoneFractionFeature
    I 16 BrassFractionFeature
    I 17 WoodwindsFractionFeature
    I 18 OrchestralStringsFractionFeature
    I 19 StringEnsembleFractionFeature
    I 20 ElectricInstrumentFractionFeature
    M 1 MelodicIntervalHistogramFeature
    M 2 AverageMelodicIntervalFeature
    M 3 MostCommonMelodicIntervalFeature
    M 4 DistanceBetweenMostCommonMelodicIntervalsFeature
    M 5 MostCommonMelodicIntervalPrevalenceFeature
    M 6 RelativeStrengthOfMostCommonIntervalsFeature
    M 7 NumberOfCommonMelodicIntervalsFeature
    M 8 AmountOfArpeggiationFeature
    M 9 RepeatedNotesFeature
    M 10 ChromaticMotionFeature
    M 11 StepwiseMotionFeature
    M 12 MelodicThirdsFeature
    M 13 MelodicFifthsFeature
    M 14 MelodicTritonesFeature
    M 15 MelodicOctavesFeature
    M 17 DirectionOfMotionFeature
    M 18 DurationOfMelodicArcsFeature
    M 19 SizeOfMelodicArcsFeature
    P 1 MostCommonPitchPrevalenceFeature
    P 2 MostCommonPitchClassPrevalenceFeature
    P 3 RelativeStrengthOfTopPitchesFeature
    P 4 RelativeStrengthOfTopPitchClassesFeature
    P 5 IntervalBetweenStrongestPitchesFeature
    P 6 IntervalBetweenStrongestPitchClassesFeature
    P 7 NumberOfCommonPitchesFeature
    P 8 PitchVarietyFeature
    P 9 PitchClassVarietyFeature
    P 10 RangeFeature
    P 11 MostCommonPitchFeature
    P 12 PrimaryRegisterFeature
    P 13 ImportanceOfBassRegisterFeature
    P 14 ImportanceOfMiddleRegisterFeature
    P 15 ImportanceOfHighRegisterFeature
    P 16 MostCommonPitchClassFeature
    P 17 DominantSpreadFeature (not implemented)
    P 18 StrongTonalCentresFeature (not implemented)
    P 19 BasicPitchHistogramFeature
    P 20 PitchClassDistributionFeature
    P 21 FifthsPitchHistogramFeature
    P 22 QualityFeature
    P 23 GlissandoPrevalenceFeature (not implemented)
    P 24 AverageRangeOfGlissandosFeature (not implemented)
    P 25 VibratoPrevalenceFeature (not implemented)
    R 1 StrongestRhythmicPulseFeature (not implemented)
    R 2 SecondStrongestRhythmicPulseFeature (not implemented)
    R 3 HarmonicityOfTwoStrongestRhythmicPulsesFeature (not implemented)
    R 4 StrengthOfStrongestRhythmicPulseFeature (not implemented)
    R 5 StrengthOfSecondStrongestRhythmicPulseFeature (not implemented)
    R 6 StrengthRatioOfTwoStrongestRhythmicPulsesFeature (not implemented)
    R 7 CombinedStrengthOfTwoStrongestRhythmicPulsesFeature (not implemented)
    R 8 NumberOfStrongPulsesFeature (not implemented)
    R 9 NumberOfModeratePulsesFeature (not implemented)
    R 10 NumberOfRelativelyStrongPulsesFeature (not implemented)
    R 11 RhythmicLoosenessFeature (not implemented)
    R 12 PolyrhythmsFeature (not implemented)
    R 13 RhythmicVariabilityFeature (not implemented)
    R 14 BeatHistogramFeature (not implemented)
    R 15 NoteDensityFeature
    R 17 AverageNoteDurationFeature
    R 18 VariabilityOfNoteDurationFeature
    R 19 MaximumNoteDurationFeature
    R 20 MinimumNoteDurationFeature
    R 21 StaccatoIncidenceFeature
    R 22 AverageTimeBetweenAttacksFeature
    R 23 VariabilityOfTimeBetweenAttacksFeature
    R 24 AverageTimeBetweenAttacksForEachVoiceFeature
    R 25 AverageVariabilityOfTimeBetweenAttacksForEachVoiceFeature
    R 30 InitialTempoFeature
    R 31 InitialTimeSignatureFeature
    R 32 CompoundOrSimpleMeterFeature
    R 33 TripleMeterFeature
    R 34 QuintupleMeterFeature
    R 35 ChangesOfMeterFeature
    R 36 DurationFeature
    T 1 MaximumNumberOfIndependentVoicesFeature
    T 2 AverageNumberOfIndependentVoicesFeature
    T 3 VariabilityOfNumberOfIndependentVoicesFeature
    T 4 VoiceEqualityNumberOfNotesFeature (not implemented)
    T 5 VoiceEqualityNoteDurationFeature (not implemented)
    T 6 VoiceEqualityDynamicsFeature (not implemented)
    T 7 VoiceEqualityMelodicLeapsFeature (not implemented)
    T 8 VoiceEqualityRangeFeature (not implemented)
    T 9 ImportanceOfLoudestVoiceFeature (not implemented)
    T 10 RelativeRangeOfLoudestVoiceFeature (not implemented)
    T 12 RangeOfHighestLineFeature (not implemented)
    T 13 RelativeNoteDensityOfHighestLineFeature (not implemented)
    T 15 MelodicIntervalsInLowestLineFeature (not implemented)
    T 20 VoiceSeparationFeature (not implemented)
    z.Could not find any jSymbolic features of type zjSymbolic features of type z do not have number )ÚextractorsByIdÚKeyErrorr>   rì   )ÚextractorTypeÚnumbers     r   ÚgetExtractorByTypeAndNumberrw  z  s•   € ðlWÝ˜mÔ,¨VÔ4Ð4øÝð Nð Nð NÝ'ØL¸]ÐLÐLñNô Nð 	Nåð Wð Wð WÝ'ØU¨-ÐUÐUÈVÐUÐUñWô Wð 	WðWøøøs	   ‚ •;Ac            	     ó  — d} d}t           D ]\}t           |         }t          t          |¦  «        ¦  «        D ]0}||         �&||         j        }| dz  } ||         t          v r|dz  }Œ1Œ]t          d|› d| › d|| z  › d�¦  «         dS )z^
    >>> features.jSymbolic.getCompletionStats()
    completion stats: 72/112 (0.6428...)
    r   Nr7   zcompletion stats: ú/z (ú))rs  r<   r@   r,   ÚfeatureExtractorsÚprint)Ú
countTotalÚcountCompleteÚkÚgroupr'   Úunused_ns         r   ÚgetCompletionStatsr‚  t  sº   € ð
 €JØ€MÝð 'ð 'ˆÝ˜qÔ!ˆÝ•s˜5‘z”zÑ"Ô"ð 	'ð 	'ˆAØ�QŒxÐ#Ø  œ8Ô,�Ø˜a‘�
Ø˜”8Õ0Ð0Ð0Ø! QÑ&�Møð	'õ 
Ð
Z˜}Ð
ZÐ
Z¨zÐ
ZÐ
Z¸]ÈZÑ=WÐ
ZÐ
ZÐ
ZÑ[Ô[Ð[Ð[Ð[r   c                  ó†   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚTestc                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   ©Ústream©Úpitch©Únote©ÚfeaturesÚc2)Úp5r�  r�  Úp4r�  r�  g      @)Úmusic21r‡  r‰  r‹  r�  ÚStreamÚPitchr=   ÚNoterS   rT   Ú	transposeÚ	jSymbolicr4   ÚextractÚassertEqualr&   ©
r   r‡  r‰  r‹  r�  rå  r/  r'   ÚfeÚfs
             r   Ú!testAverageMelodicIntervalFeaturez&Test.testAverageMelodicIntervalFeature‰  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×=Ò=¸aÑ@Ô@ˆØ�JŠJ‰LŒLˆà×Ò˜œ C 5Ñ)Ô)Ð)Ð)Ð)r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )r�  r�  r�  r�  r�  r�  r�  rp  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rE   r—  r˜  r&   r™  s
             r   Ú$testMostCommonMelodicIntervalFeaturez)Test.testMostCommonMelodicIntervalFeature›  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à;ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×@Ò@ÀÑCÔCˆØ�JŠJ‰LŒLˆà×Ò˜œ A 3Ñ'Ô'Ð'Ð'Ð'r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  ©	r�  r�  r�  r�  r�  r�  r�  Úm2Úm3r�   )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rO   r—  r˜  r&   r™  s
             r   Ú4testDistanceBetweenMostCommonMelodicIntervalsFeaturez9Test.testDistanceBetweenMostCommonMelodicIntervalsFeature­  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-àGð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×PÒPÐQRÑSÔSˆØ�JŠJ‰LŒLˆØ×Ò˜œ A 3Ñ'Ô'Ð'Ð'Ð'r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )r�  r�  r�  r�  r�  r�  r¡  r¢  ç      à?)r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rY   r—  r˜  r&   r™  s
             r   Ú.testMostCommonMelodicIntervalPrevalenceFeaturez3Test.testMostCommonMelodicIntervalPrevalenceFeature¾  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-àAð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×JÒJÈ1ÑMÔMˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)Ð)Ð)r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  r   g      è?)r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r_   r—  r˜  r&   r™  s
             r   Ú0testRelativeStrengthOfMostCommonIntervalsFeaturez5Test.testRelativeStrengthOfMostCommonIntervalsFeatureÏ  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-àGð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×LÒLÈQÑOÔOˆØ�JŠJ‰LŒLˆØ×Ò˜œ D 6Ñ*Ô*Ð*Ð*Ð*r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )r�  r�  r�  r�  r�  r�  r�  r�  r�  r�  r�  r¡  r¢  r7   )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rd   r—  r˜  r&   r™  s
             r   Ú)testNumberOfCommonMelodicIntervalsFeaturez.Test.testNumberOfCommonMelodicIntervalsFeatureà  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à_ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×EÒEÀaÑHÔHˆØ�JŠJ‰LŒLˆØ×Ò˜œ A 3Ñ'Ô'Ð'Ð'Ð'r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )r¡  r¡  r5   rF   r�  Úp8r¥  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rl   r—  r˜  r&   r™  s
             r   ÚtestAmountOfArpeggiationFeaturez$Test.testAmountOfArpeggiationFeatureñ  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×;Ò;¸AÑ>Ô>ˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)Ð)Ð)r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )Úp1r¯  r¯  r5   rF   r�  r¥  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r}   r—  r˜  r&   r™  s
             r   ÚtestRepeatedNotesFeaturezTest.testRepeatedNotesFeature  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×4Ò4°QÑ7Ô7ˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)Ð)Ð)r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  ©r¡  r¡  r¡  r5   rF   r�  r¥  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r‚   r—  r˜  r&   r™  s
             r   ÚtestChromaticMotionFeaturezTest.testChromaticMotionFeature  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×6Ò6°qÑ9Ô9ˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)Ð)Ð)r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  r²  gUUUUUUå?)r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r‰   r—  r˜  r&   r™  s
             r   ÚtestStepwiseMotionFeaturezTest.testStepwiseMotionFeature$  ó  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×5Ò5°aÑ8Ô8ˆØ�JŠJ‰LŒLˆØ×Ò˜œ E 7Ñ+Ô+Ð+Ð+Ð+r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  r²  çUUUUUUÅ?)r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r�   r—  r˜  r&   r™  s
             r   ÚtestMelodicThirdsFeaturezTest.testMelodicThirdsFeature5  ó  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×4Ò4°QÑ7Ô7ˆØ�JŠJ‰LŒLˆØ×Ò˜œ E 7Ñ+Ô+Ð+Ð+Ð+r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )r¡  r¡  r¡  r5   r�  r�  gUUUUUUÕ?)r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r•   r—  r˜  r&   r™  s
             r   ÚtestMelodicFifthsFeaturezTest.testMelodicFifthsFeatureF  rº  r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  )r¡  r¡  r¡  r5   r�  Úd5r¸  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rš   r—  r˜  r&   r™  s
             r   ÚtestMelodicTritonesFeaturezTest.testMelodicTritonesFeatureW  s  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-à5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1àÔ×6Ò6°qÑ9Ô9ˆØ�JŠJ‰LŒLˆØ×Ò˜œ E 7Ñ+Ô+Ð+Ð+Ð+r   c                ó8  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  ©r¡  r¡  r¡  r5   r�  r¬  r¸  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r    r—  r˜  r&   r™  s
             r   ÚtestMelodicOctavesFeaturezTest.testMelodicOctavesFeatureh  r¶  r   c                ó<  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         d	D ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        d
g¦  «         |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         d S )Nr   r†  rˆ  rŠ  rŒ  rŽ  rÁ  ç      ð?)r¡  r¡  ú-m2ú-M2ú-p5r¬  r¥  )rÅ  rÅ  rÅ  rÆ  rÇ  ú-p8rè   )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  r­   r—  r˜  r&   r™  s
             r   ÚtestDirectionOfMotionFeaturez!Test.testDirectionOfMotionFeaturey  s¸  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$à�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-Ø5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×8Ò8¸Ñ;Ô;ˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)ð �MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-Ø8ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×8Ò8¸Ñ;Ô;ˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)ð �MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-Ø;ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×8Ò8¸Ñ;Ô;ˆØ�JŠJ‰LŒLˆØ×Ò˜œ C 5Ñ)Ô)Ð)Ð)Ð)r   c                óD  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        dg¦  «         |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                      |	j        d         d	¦  «         d S )
Nr   r†  rˆ  rŠ  rŒ  rŽ  rÁ  ©r¡  r¡  rÈ  r5   r�  rÈ  r¬  rÈ  gš™™™™™ù?)r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rº   r—  r˜  r&   ÚassertAlmostEqualr™  s
             r   Ú testDurationOfMelodicArcsFeaturez%Test.testDurationOfMelodicArcsFeatureŸ  sì  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$ð
 �MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-Ø5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×<Ò<¸QÑ?Ô?ˆØ�JŠJ‰LŒLˆØ×Ò˜œ A 3Ñ'Ô'Ð'à�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-ØDð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×<Ò<¸QÑ?Ô?ˆØ�JŠJ‰LŒLˆØ×Ò˜qœx¨œ{¨EÑ2Ô2Ð2Ð2Ð2r   c                óÊ  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	|                     ¦   «         }|                     d¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         dD ]Q}|                     |¦  «        }|                     |                     t          j
        |¦  «        ¦  «        ¦  «         ŒR|j                             |¦  «        }|                     ¦   «         }	d S )	Nr   r†  rˆ  rŠ  rŒ  rŽ  rÁ  rË  )r‘  r‡  r‰  r‹  r�  r’  r“  r=   r”  rS   rT   r•  r–  rÉ   r—  )
r   r‡  r‰  r‹  r�  rå  r/  r'   rš  Úunused_fs
             r   ÚtestSizeOfMelodicArcsFeaturez!Test.testSizeOfMelodicArcsFeature¼  s´  € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø Ð Ð Ð Ð Ð Ø$Ð$Ð$Ð$Ð$Ð$à�MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-Ø5ð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×8Ò8¸Ñ;Ô;ˆØ—:’:‘<”<ˆð �MŠM‰OŒOˆØ�KŠK˜ÑÔˆØ	�Š�—’�4œ=¨Ñ+Ô+Ñ,Ô,Ñ-Ô-Ð-ØDð 	2ð 	2ˆAØ—’˜A‘”ˆAØ�HŠH�T—Y’Y�tœ}¨QÑ/Ô/Ñ0Ô0Ñ1Ô1Ð1Ð1ØÔ×8Ò8¸Ñ;Ô;ˆØ—:’:‘<”<ˆˆˆr   c                óª  — ddl m} ddl m} ddl m} ddl m} |                     ¦   «         }|                     d|                     d¬¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d
|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d
¬	¦  «        ¦  «         |j	         
                    |¦  «        }|                     ¦   «         }|                      |j        d         d¦  «         |                     ¦   «         }|                     d|                     d¬¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d
|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d¬	¦  «        ¦  «         |                     d|                     d
¬	¦  «        ¦  «         |j	         
                    |¦  «        }|                     ¦   «         }|                      |j        d         d¦  «         d S )Nr   r†  rŠ  ©ÚtemporŒ  r¦   )rv  r!  )ÚquarterLengthr7   rr   r�   rž   rp   rp  rq   rÄ  éð   g      @)r‘  r‡  r‹  rÓ  r�  r’  ÚinsertÚMetronomeMarkr”  r–  rê  r—  rÌ  r&   )r   r‡  r‹  rÓ  r�  rå  rš  r›  s           r   ÚtestNoteDensityFeatureAzTest.testNoteDensityFeatureAÖ  sT  € Ø"Ð"Ð"Ð"Ð"Ð"Ø Ð Ð Ð Ð Ð Ø!Ð!Ð!Ð!Ð!Ð!Ø$Ð$Ð$Ð$Ð$Ð$Ø�MŠM‰OŒOˆØ	�Š��E×'Ò'¨rÐ'Ñ2Ô2Ñ3Ô3Ð3Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/àÔ×2Ò2°1Ñ5Ô5ˆØ�JŠJ‰LŒLˆà×Ò˜qœx¨œ{¨CÑ0Ô0Ð0à�MŠM‰OŒOˆØ	�Š��E×'Ò'¨sÐ'Ñ3Ô3Ñ4Ô4Ð4Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/Ø	�Š��D—I’I¨A�IÑ.Ô.Ñ/Ô/Ð/ð Ô×2Ò2°1Ñ5Ô5ˆØ�JŠJ‰LŒLˆØ×Ò˜qœx¨œ{¨CÑ0Ô0Ð0Ð0Ð0r   c           	     ó0  — ddl m} |j        j        }d}d}|D ]Y}t	          t          ||         ¦  «        ¦  «        D ]4}||         |         �$|dz  }||         |         |j        j        v r|dz  }Œ5ŒZt                               d|d|d||z  g¦  «         d S )Nr   rŒ  r7   z	fe total:zfe implementedÚpercent)	r‘  r�  r–  rs  r<   r@   r{  rU  rV  )r   r�  ÚfsÚfeTotalÚfeImplementedr  r'   s          r   ÚtestFeatureCountzTest.testFeatureCountû  sÛ   € Ø$Ð$Ð$Ð$Ð$Ð$ØÔÔ.ˆØˆØˆØð 	+ð 	+ˆAÝ�3˜r !œu™:œ:Ñ&Ô&ð +ð +�Ø�a”5˜”8Ð'Ø˜q‘L�GØ˜!”u˜Q”x 8Ô#5Ô#GÐGÐGØ%¨Ñ*˜øð	+õ
 	×Ò ¨gÐ7GØ!.°	¸=È7Ñ;Rð!Tñ 	Uô 	Uð 	Uð 	Uð 	Ur   c                ó:  — ddl m} ddl m} |                     dd¦  «        }|j        D ],}|                     d|                     dd¦  «        ¦  «         Œ-t          |¦  «        }|                     ¦   «         }|  	                    d|j
        d         ¦  «         d S )	Nr   )ÚcorpusrÒ  zschoenberg/opus19r�   ÚLangsaméF   g     €a@)r‘  rà  rÓ  Úparser±   rÖ  r×  r˜  r—  r˜  r&   )r   rà  rÓ  Úschr/  rš  r›  s          r   ÚtestBeatHistogramzTest.testBeatHistogram	  s®   € Ø"Ð"Ð"Ð"Ð"Ð"Ø!Ð!Ð!Ð!Ð!Ð!Ø�lŠlÐ.°Ñ2Ô2ˆØ”ð 	<ð 	<ˆAØ�HŠH�Q˜×+Ò+¨I°rÑ:Ô:Ñ;Ô;Ð;Ð;Ý*¨3Ñ/Ô/ˆØ�JŠJ‰LŒLˆØ×Ò˜ ¤¨¤Ñ,Ô,Ð,Ð,Ð,r   N)r,   r-   r.   rœ  rž  r£  r¦  r¨  rª  r­  r°  r³  rµ  r¹  r¼  r¿  rÂ  rÉ  rÍ  rÐ  rØ  rÞ  rå  r   r   r   r„  r„  ‡  sE  € € € € € ð*ð *ð *ð$(ð (ð (ð$(ð (ð (ð"*ð *ð *ð"+ð +ð +ð"(ð (ð (ð"*ð *ð *ð"*ð *ð *ð"*ð *ð *ð",ð ,ð ,ð",ð ,ð ,ð",ð ,ð ,ð",ð ,ð ,ð",ð ,ð ,ð"$*ð $*ð $*ðL3ð 3ð 3ð: ð  ð  ð4#1ð #1ð #1ðJUð Uð Uð-ð -ð -ð -ð -r   r„  Ú__main__)“r/   Ú
__future__r   Úcollectionsr   rS   r  r   r1  Útextwrapr   Úunittestr‘  r   r   r	   Úmusic21.featuresrÛ  Úmusic21.instrumentr
   ÚEnvironmentrU  rÜ  r   r4   rE   rO   rY   r_   rd   rl   r}   r‚   r‰   r�   r•   rš   r    r­   rº   rÉ   rÑ   rÜ   rä   rò   rû   r   r  r  r  r  r!  r'  r4  rA  rG  rM  rS  r]  rb  rh  rp  rv  r‚  r‡  r�  r“  r˜  r   r¦  r¬  r±  r·  r½  rÂ  rÇ  rÌ  rÑ  r×  rß  rä  rê  rú  r  r	  r  r  r  r-  r3  r?  rG  rP  r\  re  rl  rr  rz  r�  r…  r‰  r�  r‘  r�  r¢  r§  r«  r±  rµ  r¹  r½  rÂ  rÇ  rË  rÐ  rÔ  rØ  rè  rî  rô  rø  rü  r  r  r  r  r  r  r$  r*  r2  r8  r@  rG  rM  rS  rZ  ÚFeatureExceptionr>   rs  rw  r{  r‚  ÚTestCaser„  r,   ÚmainTestr   r   r   ú<module>rñ     sK  ððð ð #Ð "Ð "Ð "Ð "Ð "à #Ð #Ð #Ð #Ð #Ð #Ø €€€Ø €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø )Ð )Ð )Ð )Ð )Ð )à&ˆ{Ô&Ð';Ñ<Ô<€ð+ð +ð +ð +ð + nÔ&Eñ +ô +ð +ð@ ;ð  ;ð  ;ð  ;ð  ; NÔ$Cñ  ;ô  ;ð  ;ðF*ð *ð *ð *ð * ~Ô'Fñ *ô *ð *ð<"=ð "=ð "=ð "=ð "=ØÔ'ñ"=ô "=ð "=ðJ2ð 2ð 2ð 2ð 2ØÔ'ñ2ô 2ð 2ðD$Lð $Lð $Lð $Lð $LØÔ'ñ$Lô $Lð $LðN!&ð !&ð !&ð !&ð !&¨NÔ,Kñ !&ô !&ð !&ðH)/ð )/ð )/ð )/ð )/ .Ô"Añ )/ô )/ð )/ðX$/ð $/ð $/ð $/ð $/˜>Ô:ñ $/ô $/ð $/ðN!/ð !/ð !/ð !/ð !/˜^Ô<ñ !/ô !/ð !/ðH"/ð "/ð "/ð "/ð "/˜NÔ;ñ "/ô "/ð "/ðJ!/ð !/ð !/ð !/ð !/˜>Ô:ñ !/ô !/ð !/ðH!/ð !/ð !/ð !/ð !/˜>Ô:ñ !/ô !/ð !/ðH!/ð !/ð !/ð !/ð !/˜^Ô<ñ !/ô !/ð !/ðH!/ð !/ð !/ð !/ð !/˜NÔ;ñ !/ô !/ð !/ðH,=ð ,=ð ,=ð ,=ð ,=˜~Ô>ñ ,=ô ,=ð ,=ð^S:ð S:ð S:ð S:ð S: >Ô#Bñ S:ô S:ð S:ðli6ð i6ð i6ð i6ð i6˜~Ô>ñ i6ô i6ð i6ð` 1ð  1ð  1ð  1ð  1 ~Ô'Fñ  1ô  1ð  1ðF 5ð  5ð  5ð  5ð  5¨NÔ,Kñ  5ô  5ð  5ðF")ð ")ð ")ð ")ð ")¨.Ô*Iñ ")ô ")ð ")ðJ%:ð %:ð %:ð %:ð %:¨~Ô/Nñ %:ô %:ð %:ðP )ð  )ð  )ð  )ð  )¨^Ô-Lñ  )ô  )ð  )ðF!?ð !?ð !?ð !?ð !?ØÔ'ñ!?ô !?ð !?ðH&ð &ð &ð &ð & >Ô#Bñ &ô &ð &ðB&ð &ð &ð &ð &˜.Ô9ñ &ô &ð &ð>&ð &ð &ð &ð &˜~Ô>ñ &ô &ð &ð>5ð 5ð 5ð 5ð 5�>Ô2ñ 5ô 5ð 5ð@)ð )ð )ð )ð )˜^Ô<ñ )ô )ð )ð@Hð Hð Hð Hð H˜^Ô<ñ Hô Hð Hð<"Bð "Bð "Bð "Bð "B nÔ&Eñ "Bô "Bð "BðJ"Bð "Bð "Bð "Bð "B¨Ô(Gñ "Bô "Bð "BðJ"Bð "Bð "Bð "Bð "B nÔ&Eñ "Bô "Bð "BðJ+ð +ð +ð +ð + .Ô"Añ +ô +ð +ð8?ð ?ð ?ð ?ð ?˜NÔ;ñ ?ô ?ð ?ð.?ð ?ð ?ð ?ð ? Ô ?ñ ?ô ?ð ?ð.'+ð '+ð '+ð '+ð '+ Ô!@ñ '+ô '+ð '+ðT*Að *Að *Að *Að *A NÔ$Cñ *Aô *Að *AðZ&:ð &:ð &:ð &:ð &: .Ô"Añ &:ô &:ð &:ðR4,ð 4,ð 4,ð 4,ð 4,�^Ô4ñ 4,ô 4,ð 4,ðn?ð ?ð ?ð ?ð ? Ô!@ñ ?ô ?ð ?ð.?ð ?ð ?ð ?ð ? nÔ&Eñ ?ô ?ð ?ð8?ð ?ð ?ð ?ð ?˜~Ô>ñ ?ô ?ð ?ð2?ð ?ð ?ð ?ð ? NÔ$Cñ ?ô ?ð ?ð8Að Að Að Að A NÔ$Cñ Aô Að AðD#Að #Að #Að #Að #A¨.Ô*Iñ #Aô #Að #AðL'Eð 'Eð 'Eð 'Eð 'EØÔ'ñ'Eô 'Eð 'EðTAð Að Að Að A¨nÔ.Mñ Aô Að Að4:ð :ð :ð :ð :ØÔ'ñ:ô :ð :ðD"<ð "<ð "<ð "<ð "<ØÔ'ñ"<ô "<ð "<ðJ Ið  Ið  Ið  Ið  IØÔ'ñ Iô  Ið  IðF?ð ?ð ?ð ?ð ? .Ô"Añ ?ô ?ð ?ð,?ð ?ð ?ð ?ð ? NÔ$Cñ ?ô ?ð ?ð*ð ð ð ð ¨NÔ,Kñ ô ð ð&?ð ?ð ?ð ?ð ?˜~Ô>ñ ?ô ?ð ?ð8?ð ?ð ?ð ?ð ?˜Ô8ñ ?ô ?ð ?ðD?ð ?ð ?ð ?ð ? Ô!@ñ ?ô ?ð ?ð*?ð ?ð ?ð ?ð ?˜>Ô:ñ ?ô ?ð ?ð4#Kð #Kð #Kð #Kð #K˜Ô8ñ #Kô #Kð #KðL"9ð "9ð "9ð "9ð "9 Ô!@ñ "9ô "9ð "9ðJ%Cð %Cð %Cð %Cð %C ~Ô'Fñ %Cô %Cð %CðP,ð ,ð ,ð ,ð , Ô!@ñ ,ô ,ð ,ð@,ð ,ð ,ð ,ð , Ô!@ñ ,ô ,ð ,ð@9ð 9ð 9ð 9ð 9˜~Ô>ñ 9ô 9ð 9ðD(Eð (Eð (Eð (Eð (E ~Ô'Fñ (Eô (Eð (EðV&@ð &@ð &@ð &@ð &@¨^Ô-Lñ &@ô &@ð &@ðR6Að 6Að 6Að 6Að 6AØÔ'ñ6Aô 6Að 6Aðr9=ð 9=ð 9=ð 9=ð 9=ØÔ'ñ9=ô 9=ð 9=ðv4ð 4ð 4ð 4ð 4˜.Ô9ñ 4ô 4ð 4ð:'9ð '9ð '9ð '9ð '9 .Ô"Añ '9ô '9ð '9ðT/+ð /+ð /+ð /+ð /+ >Ô#Bñ /+ô /+ð /+ðd&'ð &'ð &'ð &'ð &'˜Ô8ñ &'ô &'ð &'ðR%'ð %'ð %'ð %'ð %'˜NÔ;ñ %'ô %'ð %'ðP+ð +ð +ð +ð +˜NÔ;ñ +ô +ð +ð\/ð /ð /ð /ð /�nÔ5ñ /ô /ð /ðLð ð ð ð  Ô!@ñ ô ð ð&ð ð ð ð  Ô!@ñ ô ð ð(ð ð ð ð ¨NÔ,Kñ ô ð ð,ð ð ð ð ¨^Ô-Lñ ô ð ð6('ð ('ð ('ð ('ð ('¨nÔ.Mñ ('ô ('ð ('ðV*9ð *9ð *9ð *9ð *9¨nÔ.Mñ *9ô *9ð *9ðZ&Að &Að &Að &Að &AØÔ'ñ&Aô &Að &AðRð ð ð ð ¨Ô(Gñ ô ð ð*ð ð ð ð  ~Ô'Fñ ô ð ð&ð ð ð ð  >Ô#Bñ ô ð ð&ð ð ð ð  ~Ô'Fñ ô ð ð*ð ð ð ð  Ô ?ñ ô ð ð(ð ð ð ð  nÔ&Eñ ô ð ð(ð ð ð ð ¨Ô)Hñ ô ð ð(ð ð ð ð  Ô ?ñ ô ð ð(ð ð ð ð ¨nÔ.Mñ ô ð ð*ð ð ð ð ¨.Ô*Iñ ô ð ð(ð ð ð ð ˜^Ô<ñ ô ð ð2@7ð @7ð @7ð @7ð @7 ~Ô'Fñ @7ô @7ð @7ðF?ð ?ð ?ð ?ð ?¨Ô)Hñ ?ô ?ð ?ðD;Ið ;Ið ;Ið ;Ið ;IØÔ'ñ;Iô ;Ið ;Ið|ð ð ð ð ØÔ'ñô ð ð6ð ð ð ð ØÔ'ñô ð ð>1Hð 1Hð 1Hð 1Hð 1HØÔ'ñ1Hô 1Hð 1Hðhð ð ð ð ØÔ'ñô ð ð8%'ð %'ð %'ð %'ð %'¨Ô(Gñ %'ô %'ð %'ðPð ð ð ð ¨.Ô*Iñ ô ð ð2ð ð ð ð  .Ô"Añ ô ð ð(/ð /ð /ð /ð / Ô ?ñ /ô /ð /ð@(ð (ð (ð (ð (Ð$=ñ (ô (ð (ð:(ð (ð (ð (ð (Ð$=ñ (ô (ð (ð:3ð 3ð 3ð 3ð 3Ð$=ñ 3ô 3ð 3ð4)ð )ð )ð )ð )Ð5ñ )ô )ð )ð:0ð 0ð 0ð 0ð 0Ð8ñ 0ô 0ð 0ð:3ð 3ð 3ð 3ð 3Ð4ñ 3ô 3ð 3ð>3ð 3ð 3ð 3ð 3Ð8ñ 3ô 3ð 3ð>3ð 3ð 3ð 3ð 3Ð'@ñ 3ô 3ð 3ð:0ð 0ð 0ð 0ð 0Ð$=ñ 0ô 0ð 0ð.Dð Dð Dð Dð DÐ(Añ Dô Dð Dð<	ð 	ð 	ð 	ð 	 Ô ?ñ 	ô 	ð 	ð �ØØØ"Ø"Ø-Ø.ðð ð 	ØØ(Ø*Ø1Ø3Ø1Ø>Ø@Ø)Ø+Ø#Ø%Ø%Ø%ØØ ØØ Ø(Ø%Ø)ð+ð ð. 	ØØ'Ø%Ø(Ø8Ø2Ø4Ø-Ø#ØØØØØØØØØ Ø$Ø Øð+ð ð. 	ØØ(Ø-Ø+Ø0Ø.Ø3Ø$ØØ ØØØØ'Ø)Ø'Ø#ØØ!Ø"Ø%Ø#ØØ"Ø'Ø Øð7ð ð: 	ð &Øð&à%ð&ð 	,ð&ð 	7ð	&ð
 	0ð&ð 	6ð&ð 	9ð&ð 	<ð&ð 	$ð&ð 	&ð&ð 	.ð&ð 	!ð&ð 	ð&ð 	#ð&ð 	ð&ð  	ð!&ð" 	ð#&ð$ 	#ð%&ð& 	)ð'&ð( 	#ð)&ð* 	#ð+&ð, 	!ð-&ð. 	)ð/&ð0 	/ð1&ð2 	5ð3&ð4 	Bð5&ð6 	ð7&ð8 	ð9&ð: 	ð;&ð< 	ð=&ð> 	ð?&ð@ 	$ðA&ðB 	%ðC&ðD 	ðE&ðF 	ðG&ðH 	ðI&ðJ 	ðK&ð &ðN 	ØØ/Ø/Ø5Ø)Ø(Ø$Ø(Ø!Ø'Ø*ØØ!Ø/ØØ+ØØØØØð+ð ð. 	ð ð ð ð ðcqñ qô q€ðh]Wð ]Wð ]Wð@Wà#ðWð "ðWð %ð	Wð
 5ðWð /ðWð 1ðWð *ðWð  ðWð ðWð ðWð ðWð ðWð ðWð ðWð  ð!Wð" ð#Wð$ !ð%Wð& ð'Wð* %ð+Wð, .ð-Wð. ;ð/Wð0 &ð1Wð2 "ð3Wð4 "ð5Wð6 "ð7Wð8 ð9Wð: ð;Wð< ð=Wð> ð?Wð@ %ðAWðB "ðCWðD &ðEWðN ðOWðP ðQWðR %ðSWðT ðUWðV ðWWðX ðYWðZ %ð[Wð\ +ð]Wð^ 1ð_Wð` >ðaWðd ðeWðf  ðgWðh !ðiWðj ðkWðl ðmWðn ðoWðp ðqWðt ,ðuWðv ,ðwWðx 2ðyWð| %ð}Wð~ *ðWð@ (ðAWðB -ðCWðD +ðEWðF 0ðGWðH !ðIWðJ ðKWðL ðMWðN ðOWðP ðQWðR ðSWðT $ðUWðV &ðWWðX $ðYWðZ  ð[Wð\ ð]Wð^ "ð_Wð`  ðaWðb ðcWÐ ðt\ð \ð \ð&J-ð J-ð J-ð J-ð J-ˆ8Ôñ J-ô J-ð J-ðZ ˆzÒÐØ€N€N€NØ€GÔ�TÑÔÐÐÐð Ðr   