music21.figuredBass.harmony

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.

FiguredBass

class music21.figuredBass.harmony.FiguredBass(figureString: str = '', *, figureStrings: Iterable[str] = (), **keywords)

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

FiguredBass bases

FiguredBass read-only properties

Read-only properties inherited from Chord:

Read-only properties inherited from Music21Object:

Read-only properties inherited from ProtoM21Object:

FiguredBass read/write properties

FiguredBass.figureString

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>
FiguredBass.figureStrings

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>
FiguredBass.notation

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'

Read/write properties inherited from Harmony:

Read/write properties inherited from Chord:

Read/write properties inherited from ChordBase:

Read/write properties inherited from NotRest:

Read/write properties inherited from GeneralNote:

Read/write properties inherited from Music21Object:

FiguredBass methods

Methods inherited from Harmony:

Methods inherited from Chord:

Methods inherited from ChordBase:

Methods inherited from NotRest:

Methods inherited from GeneralNote:

Methods inherited from Music21Object:

Methods inherited from ProtoM21Object:

FiguredBass instance variables

Instance variables inherited from Chord:

Instance variables inherited from ChordBase:

Instance variables inherited from NotRest:

Instance variables inherited from GeneralNote:

Instance variables inherited from Music21Object: