
    rh                        S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      r	\
S:X  a  SS	Kr\R                  " 5         g	g	)
z
The FiguredBass object is a subclass of Harmony that will (eventually) be able
to represent figured bass symbols in music notation and also realize it.

BETA at this point.

Based on work by Jose Cabal-Ugaz.
    )annotations)Iterable)Harmony)notationc                     ^  \ rS rSrSr SSS.   SU 4S jjjjr\SS j5       r\R                  SS j5       r\SS j5       r	\	R                  SS	 j5       r	\SS
 j5       r
\
R                  SS j5       r
S rSrU =r$ )FiguredBass   a  
*BETA*: FiguredBass objects are currently in beta and may change without warning.

The FiguredBass objects store information about thorough bass figures.
It is created as a representation for <fb> tags in MEI and <figured-bass> tags in MusicXML.
The FiguredBass object derives from the Harmony object and can be used
in the following way:

>>> fb = figuredBass.FiguredBass('#,6#')
>>> fb
<music21.figuredBass.harmony.FiguredBass #,6#>

(note that the FiguredBass object can be found in either music21.figuredBass.FiguredBass
or music21.figuredBass.harmony.FiguredBass.  It is the same class)

The single figures are stored as figuredBass.notation.Figure objects:

>>> fb.notation.figures[0]
<music21.figuredBass.notation.Figure 3 <Modifier # sharp>>

The figures can be accessed and manipulated individually by passing in `figureStrings`
(plural), and extenders are allowed as with `_`:

>>> fb2 = figuredBass.FiguredBass(figureStrings=['#_', '6#'])
>>> fb2
<music21.figuredBass.harmony.FiguredBass #_,6#>
>>> fb2.notation.hasExtenders
True

Currently, figured bass objects do not have associated pitches.  This will change.

>>> fb.pitches
()

* new in v9.3
 )figureStringsc                  > [         TU ]  " S0 UD6  SU l        US:w  a  Xl        OU(       a  SR	                  U5      U l        [
        R                  " U R                  5      U l        g )N ,r
   )super__init___figsfigureStringjoinr   Notation_figNotation)selfr   r   keywords	__class__s       U/home/james-whalen/.local/lib/python3.13/site-packages/music21/figuredBass/harmony.pyr   FiguredBass.__init__A   sU    
 	$8$
2 , # 7D/7/@/@/L    c                    U R                   $ )a  
Gets or sets the notation property of the FiguresBass object

>>> fb = figuredBass.FiguredBass('6,#')
>>> fb.figureString
'6,#'
>>> fb.notation
<music21.figuredBass.notation.Notation 6,#>

When setting, this updates the figureString property as well.

>>> fb.notation = figuredBass.notation.Notation('7b,b')
>>> fb.notation
<music21.figuredBass.notation.Notation 7b,b>
>>> fb.figureString
'7b,b'
)r   r   s    r   r   FiguredBass.notationQ   s    &    r   c                2    Xl         UR                  U l        g N)r   notationColumnr   )r   figureNotations     r   r   r   f   s    *#22
r   c                    U R                   $ )ar  
Get the figures as strings of the FiguresBass object.

>>> fb = figuredBass.FiguredBass('6,#')
>>> fb.figureString
'6,#'
>>> fb.notation
<music21.figuredBass.notation.Notation 6,#>

When setting the figureString the notation property is updated as well:

>>> fb.figureString = '5,b'
>>> fb.figureString
'5,b'
>>> fb.notation
<music21.figuredBass.notation.Notation 5,b>
)r   r   s    r   r   FiguredBass.figureStringk   s    & zzr   c                Z    Xl         [        R                  " U R                   5      U l        g r    )r   r   r   )r   r   s     r   r   r$      s    !
 ))$**5r   c                8    U R                   R                  S5      $ )aT  
Does the same as figureStrings but returns a list:

>>> fb = figuredBass.FiguredBass('6,#')
>>> fb.figureStrings
['6', '#']

Like figureString, figureStrings can be set as well and updates the notation property:

>>> fb.figureStrings = ['5', 'b']
>>> fb.figureStrings
['5', 'b']
>>> fb.notation
<music21.figuredBass.notation.Notation 5,b>
r   )r   splitr   s    r   r   FiguredBass.figureStrings   s    "   &&s++r   c                0    SR                  U5      U l        g )Nr   )r   r   )r   r   s     r   r   r(      s    HH]3r   c                .    U R                   R                  $ r    )r   r!   r   s    r   _reprInternalFiguredBass._reprInternal   s    }}+++r   )r   r   r   r   )r   )r   strr   Iterable[str])returnnotation.Notation)r"   r0   )r/   r-   )r   r-   )r/   z	list[str])r   r.   r/   None)__name__
__module____qualname____firstlineno____doc__r   propertyr   setterr   r   r+   __static_attributes____classcell__)r   s   @r   r   r      s    #J &(M 13M"M !.M M  ! !( __3 3  ( 6 6 , ,$ 4 4, ,r   r   __main__N)r6   
__future__r   collections.abcr   music21.harmonyr   music21.figuredBassr   r   r2   music21mainTestr
   r   r   <module>rB      sE    # $ # (A,' A,J z r   