
    rh #                       S SK Jr  S SKrS SKJr  SrSrSrS\4S\4S	\4/r\R                  5         S
r
SrSrSrSrSrS\
4S\4S\4S\4S\4S\4/r\R                  5         SrSrSrSrSrSrSrS\4S\4S\4S \4S!\4S"\4S#\4/r\R                  5          " S$ S%\R2                  5      r " S& S'\R6                  5      r\S(:X  a  S SKr\R<                  " \5        gg))    )annotationsN)prebasezTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.isIncomplete` is applied to all possibA,
    and all those possibilities for which the method returns False are retained.a   12 by default. A number, in semitones,
    representing the maxSemitoneSeparation argument provided to
    :meth:`~music21.figuredBass.possibility.upperPartsWithinLimit`.
    Method is applied to all possibA, and all those possibilities for which the method returns
    True are retained.zTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.voiceCrossing` is applied to all possibA,
    and all those possibilities for which the method returns False are retained.forbidIncompletePossibilitiesupperPartsMaxSemitoneSeparationforbidVoiceCrossingzTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.parallelFifths` is applied to all
    (possibA, possibB) pairs, and all those pairs for which the method returns
    False are retained.zTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.parallelOctaves` is applied to all
    (possibA, possibB) pairs, and all those pairs for which the method returns
    False are retained.zTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.hiddenFifth` is applied to all
    (possibA, possibB) pairs, and all those pairs for which the method returns
    False are retained.zTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.hiddenOctave` is applied to all
    (possibA, possibB) pairs, and all those pairs for which the method returns
    False are retained.zTrue by default. If True,
    :meth:`~music21.figuredBass.possibility.voiceOverlap` is applied to all
    (possibA, possibB) pairs, and all those pairs for which the method returns
    False are retained.a*  [] (empty list) by default. Contains (partNumber, maxSeparation)
    pairs provided as arguments
    to :meth:`~music21.figuredBass.possibility.partMovementsWithinLimits`.
    Method is applied to all (possibA, possibB) pairs, and all those pairs
    for which the method returns True are retained.forbidParallelFifthsforbidParallelOctavesforbidHiddenFifthsforbidHiddenOctavesforbidVoiceOverlappartMovementLimitszTrue by default. If True, Segments
    whose :attr:`~music21.figuredBass.segment.Segment.segmentChord` spells out a
    dominant seventh chord are resolved properly by
    using :meth:`~music21.figuredBass.segment.Segment.resolveDominantSeventhSegment`.a  True by default. If True, Segments
    whose :attr:`~music21.figuredBass.segment.Segment.segmentChord` spells out
    a fully-diminished seventh chord are resolved properly by
    using :meth:`~music21.figuredBass.segment.Segment.resolveDiminishedSeventhSegment`.zTrue by default. If True, Segments
    whose :attr:`~music21.figuredBass.segment.Segment.segmentChord` spells out an
    augmented sixth chord are resolved properly by
    using :meth:`~music21.figuredBass.segment.Segment.resolveAugmentedSixthSegment`.a  False by default. If True, Diminished seventh resolutions to the
    tonic will contain a doubled *root*, as opposed to a doubled *third*.
    Rule is ignored (determined in context)
    if :attr:`~music21.figuredBass.segment.Segment.segmentChord` is in first inversion.z`False by default. If True, single possibility rules are applied to
    resolution possibilities.zrFalse by default. If True, consecutive possibility rules are applied
    between (specialPossib, resPossib) pairs.a  True by default. If True, then doublings in the It+6 chord are limited to the
     tonic, or fifth. Setting this to False allows doubling of the root or third, most likely
    through parallel unisons if :attr:`~music21.figuredBass.rules.Rules.forbidParallelOctaves`
    is set to True.resolveDominantSeventhProperly resolveDiminishedSeventhProperlyresolveAugmentedSixthProperlydoubledRootInDim7"applySinglePossibRulesToResolution'applyConsecutivePossibRulesToResolution&restrictDoublingsInItalianA6Resolutionc                      \ rS rSr% Sr\ V Vs/ s H  oS   PM	     snn \ V Vs/ s H  o"S   PM	     snn -   \ V Vs/ s H  o3S   PM	     snn -   r\	" \\-   \-   5      r
S\S'   S rS rSrg	s  snn f s  snn f s  snn f )
Rulesf   a  
A Rules object is provided as an input to a :class:`~music21.figuredBass.segment.Segment`,
and controls the application of methods designed to filter out undesired possibilities in
a single Segment or undesired progressions between two consecutive Segments.


The rules are categorized in an identical manner to methods
in :mod:`~music21.figuredBass.possibility`:


1) Single Possibility Rules. These rules apply to any possibility within a
single Segment (possibA), and
are applied in finding correct possibilities for a Segment
in :meth:`~music21.figuredBass.segment.Segment.allCorrectSinglePossibilities`.


2) Consecutive Possibility Rules. These rules apply between any correct
single possibility in segmentA
(possibA) and any correct single possibility in segmentB (possibB),
segmentB coming directly after segmentA.
They are applied in finding correct (possibA, possibB) pairs between
two Segments
in :meth:`~music21.figuredBass.segment.Segment.allCorrectConsecutivePossibilities`.


3) Special Resolution Rules. These rules apply to Segments
whose :attr:`~music21.figuredBass.segment.Segment.segmentChord` is an
augmented sixth, dominant seventh, or diminished seventh chord, and are
applied as necessary in
:meth:`~music21.figuredBass.segment.Segment.allCorrectConsecutivePossibilities`.


>>> from music21.figuredBass import rules
>>> fbRules = rules.Rules()
>>> fbRules
<music21.figuredBass.rules.Rules>
>>> fbRules.forbidParallelFifths = False
>>> fbRules.upperPartsMaxSemitoneSeparation = None
r   zdict[str, str]	_DOC_ATTRc                   SU l         SU l        SU l        SU l        SU l        SU l        SU l        SU l        / U l        SU l	        SU l
        SU l        SU l        SU l        SU l        SU l        SU l        / U l        / U l        g )NT   F)r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   _upperPartsRemainSame_partPitchLimits_partsToCheckselfs    S/home/james-whalen/.local/lib/python3.13/site-packages/music21/figuredBass/rules.py__init__Rules.__init__   s    -1*/1,#'  %)!%)""&#' "&"$ /3+04--1*!&27/7<46:3%*" "    c                    g)N  r   s    r    _reprInternalRules._reprInternal   s    r#   )r   r   r   r   r   r   r
   r   r   r   r	   r   r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__singlePossibilityDocconsecutivePossibilityDocspecialResDoc
_DOC_ORDERdictr   __annotations__r!   r'   __static_attributes__).0_x_y_zs   0000r    r   r   f   s    &P $88#7Ra5#78%>?%>rU%>?@%23]rU]34J !%
#	$
	!I~  6I 9?3s   A-A3A9r   c                      \ rS rSrSrg)Test   r&   N)r)   r*   r+   r,   r4   r&   r#   r    r:   r:      s    r#   r:   __main__)
__future__r   unittestmusic21r   !doc_forbidIncompletePossibilities#doc_upperPartsMaxSemitoneSeparationdoc_forbidVoiceCrossingr.   sortdoc_parallelFifthsdoc_parallelOctavesdoc_hiddenFifthsdoc_hiddenOctavesdoc_voiceOverlapdoc_partMovementLimitsr/   doc_domSeventhdoc_dimSeventhdoc_augSixthdoc_doubledRootInDim7doc_singleToResdoc_consecutiveToResdoc_doublingsr0   ProtoM21Objectr   TestCaser:   r)   mainTestr&   r#   r    <module>rT      s   #  %T !' #
T  9:[\:<_`.0GHJ          7  /012+,-.+,12      Y[X[ !1  3NC4nE1<@%'<=6H;=QR:MJL    NG"" Nd	8 	 zT r#   