Previous topic

music21.graph

Next topic

music21.humdrum.spineParser

Table Of Contents

Table Of Contents

music21.harmony

An object representation of harmony, as encountered as chord symbols or other chord representations with a defined root.

music21.harmony.realizeChordSymbolDurations(piece)

Returns Music21 score object with duration attribute of chord symbols correctly set. Duration of chord symbols is based on the surrounding chord symbols; The chord symbol continues duration until another chord symbol is located or the piece ends.

>>> from music21 import *
>>> s = stream.Score()
>>> s.append(harmony.ChordSymbol('C'))
>>> s.repeatAppend(note.Note('C'), 4)
>>> s.append(harmony.ChordSymbol('C'))
>>> s.repeatAppend(note.Note('C'), 4)
>>> s = s.makeMeasures()

>>> harmony.realizeChordSymbolDurations(s).show('text')
{0.0} <music21.clef.TrebleClef>
{0.0} <music21.meter.TimeSignature 4/4>
{0.0} <music21.harmony.ChordSymbol C>
{0.0} <music21.note.Note C>
{1.0} <music21.note.Note C>
{2.0} <music21.note.Note C>
{3.0} <music21.note.Note C>
{4.0} <music21.harmony.ChordSymbol C>
{4.0} <music21.note.Note C>
{5.0} <music21.note.Note C>
{6.0} <music21.note.Note C>
{7.0} <music21.note.Note C>
{8.0} <music21.bar.Barline style=final>

If only one chord symbol object is present:

>>> s = stream.Score()
>>> s.append(harmony.ChordSymbol('C'))
>>> s.repeatAppend(note.Note('C'), 4)
>>> s = s.makeMeasures()
>>> harmony.realizeChordSymbolDurations(s).show('text')
{0.0} <music21.clef.TrebleClef>
{0.0} <music21.meter.TimeSignature 4/4>
{0.0} <music21.harmony.ChordSymbol C>
{0.0} <music21.note.Note C>
{1.0} <music21.note.Note C>
{2.0} <music21.note.Note C>
{3.0} <music21.note.Note C>
{4.0} <music21.bar.Barline style=final>

If a ChordSymbol object exists followed by many notes, duration represents all those notes (how else can the computer know to end the chord? if there’s not chord following it other than end the chord at the end of the piece?)

>>> s = stream.Score()
>>> s.repeatAppend(note.Note('C'), 4)
>>> s.append(harmony.ChordSymbol('C'))
>>> s.repeatAppend(note.Note('C'), 8)
>>> s = s.makeMeasures()
>>> harmony.realizeChordSymbolDurations(s).show('text')
{0.0} <music21.clef.TrebleClef>
{0.0} <music21.meter.TimeSignature 4/4>
{0.0} <music21.note.Note C>
{1.0} <music21.note.Note C>
{2.0} <music21.note.Note C>
{3.0} <music21.note.Note C>
{4.0} <music21.harmony.ChordSymbol C>
{4.0} <music21.note.Note C>
{5.0} <music21.note.Note C>
{6.0} <music21.note.Note C>
{7.0} <music21.note.Note C>
{8.0} <music21.note.Note C>
{9.0} <music21.note.Note C>
{10.0} <music21.note.Note C>
{11.0} <music21.note.Note C>
{12.0} <music21.bar.Barline style=final>

Harmony

Inherits from: Music21Object, JSONSerializer

class music21.harmony.Harmony(figure=None, **keywords)
>>> from music21 import *
>>> h = harmony.ChordSymbol()
>>> h.XMLroot = 'b-'
>>> h.XMLbass = 'd'
>>> h.XMLinversion = 1
>>> h.addChordStepModification(harmony.ChordStepModification('add', 4))
>>> h
<music21.harmony.ChordSymbol B-/D add 4>
>>> p = harmony.ChordSymbol(root='C', bass='E', inversion=1, duration=4.0)
>>> p
<music21.harmony.ChordSymbol C/E>

Harmony objects in music21 are special types of chords. Although on a page of music they exist as symbols rather than notes, musicians consider them to be chords. Thus, harmony objects in music21 are not a subclass of Chord, although they do contain a chord object within them and all of the methods of class chord can be used to operate directly on the harmony object. NB - h.root() is analogous to calling h.chord.root()

For example,

>>> from music21 import *
>>> h = harmony.ChordSymbol('C7/E')
>>> h.root()
C4
>>> h.bass()
E3
>>> h.inversion()
1
>>> h.isSeventh()
True
>>> h.pitches
[E3, G3, B-3, C4]

Harmony attributes

Attributes without Documentation: chordStepModifications

Attributes inherited from Music21Object: classSortOrder, hideObjectOnPrint, id, isSpanner, isStream, groups

Harmony properties

XMLbass

Get or set the XMLbass of the Harmony as a Pitch object. String representations accepted by Pitch are also accepted. Also updates the associated chord object’s bass. If the bass is ‘None’ (commonly read in from music xml) then it returns the root pitch.

>>> from music21 import *
>>> h = harmony.ChordSymbol()
>>> h.XMLbass = 'a#'
>>> h.XMLbass
A#
>>> h.XMLbass = pitch.Pitch('d-')
>>> h.XMLbass
D-
>>> h.XMLbass = 'juicy'
Traceback (most recent call last):
HarmonyException: not a valid pitch specification: juicy
XMLinversion

Get or set the inversion of this Harmony as a positive integer. Also updates the associated chord object’s bass.

>>> from music21 import *
>>> h = harmony.ChordSymbol()
>>> h.XMLinversion = 2
>>> h.XMLinversion
2
XMLroot

Get or set the XMLroot attribute of the Harmony as a Pitch object. String representations accepted by Pitch are also accepted. Also updates the associated chord object’s root

>>> from music21 import *
>>> h = harmony.ChordSymbol()
>>> h.XMLroot= 'a#'
>>> h.XMLroot
A#
>>> h.XMLroot= pitch.Pitch('c#')
>>> h.XMLroot
C#
>>> h.XMLroot= 'juicy'
Traceback (most recent call last):
HarmonyException: not a valid pitch specification: juicy
chord

Get or set the chord object of this harmony object. The chord object will be returned with the realized pitches as an attribute. The user could override these pitches by manually setting the chord.pitches.

chordTablesAddress

directly references music21.chord.Chord.chordTablesAddress

color

directly references music21.chord.Chord.color

commonName

directly references music21.chord.Chord.commonName

duration

directly references music21.chord.Chord.duration

fifth

directly references music21.chord.Chord.fifth

figure

Get or set the figure of the harmony object. The figure is the character (string) representation of the object. For example, ‘I’, ‘CM’, ‘3#’

when you instantiate a harmony object, if you pass in a figure it is stored internally and returned when you access the figure property. if you don’t instantiate the object with a figure, this property calls music21.harmony.findFigure() method which deduces the figure provided other information about the object, especially the chord

if the pitches of the harmony object have been modified after being instantiated, call music21.harmony.findFigure() to deduce the new figure

>>> from music21 import *
>>> h = harmony.ChordSymbol('CM')
>>> h.figure
'CM'
>>> harmony.ChordSymbol(root = 'C', bass = 'A', kind = 'minor').figure
'Cm/A'
>>> h.bass(note.Note('E'))
>>> h.figure
'CM'
forteClass

directly references music21.chord.Chord.forteClass

forteClassNumber

directly references music21.chord.Chord.forteClassNumber

forteClassTn

directly references music21.chord.Chord.forteClassTn

forteClassTnI

directly references music21.chord.Chord.forteClassTnI

fullName

directly references music21.chord.Chord.fullName

hasZRelation

directly references music21.chord.Chord.hasZRelation

intervalVector

directly references music21.chord.Chord.intervalVector

intervalVectorString

directly references music21.chord.Chord.intervalVectorString

isPrimeFormInversion

directly references music21.chord.Chord.isPrimeFormInversion

midiEvents

directly references music21.chord.Chord.midiEvents

midiFile

directly references music21.chord.Chord.midiFile

multisetCardinality

directly references music21.chord.Chord.multisetCardinality

normalForm

directly references music21.chord.Chord.normalForm

normalFormString

directly references music21.chord.Chord.normalFormString

orderedPitchClasses

directly references music21.chord.Chord.orderedPitchClasses

orderedPitchClassesString

directly references music21.chord.Chord.orderedPitchClassesString

pitchClassCardinality

directly references music21.chord.Chord.pitchClassCardinality

pitchClasses

directly references music21.chord.Chord.pitchClasses

pitchNames

directly references music21.chord.Chord.pitchNames

pitchedCommonName

directly references music21.chord.Chord.pitchedCommonName

pitches

directly references music21.chord.Chord.pitches

primeForm

directly references music21.chord.Chord.primeForm

primeFormString

directly references music21.chord.Chord.primeFormString

quality

directly references music21.chord.Chord.quality

romanNumeral

Get or set the romanNumeral numeral function of the Harmony as a RomanNumeral object. String representations accepted by RomanNumeral are also accepted.

>>> from music21 import *
>>> h = harmony.ChordSymbol()
>>> h.romanNumeral = 'III'
>>> h.romanNumeral
<music21.roman.RomanNumeral III>
>>> h.romanNumeral = roman.RomanNumeral('vii')
>>> h.romanNumeral
<music21.roman.RomanNumeral vii>
scaleDegrees

directly references music21.chord.Chord.scaleDegrees

seventh

directly references music21.chord.Chord.seventh

third

directly references music21.chord.Chord.third

tie

directly references music21.chord.Chord.tie

volume

directly references music21.chord.Chord.volume

Properties inherited from Music21Object: activeSite, beat, beatDuration, beatStr, beatStrength, classes, derivationHierarchy, measureNumber, offset, priority, seconds

Properties inherited from JSONSerializer: json

Harmony methods

addChordStepModification(degree)

Add a harmony degree specification to this Harmony as a ChordStepModification object.

>>> from music21 import *
>>> hd = harmony.ChordStepModification('add', 4)
>>> h = harmony.ChordSymbol()
>>> h.addChordStepModification(hd)
>>> h.addChordStepModification('juicy')
Traceback (most recent call last):
HarmonyException: cannot add this object as a degree: juicy
annotateIntervals(inPlace=True, stripSpecifiers=True, sortPitches=True)

directly calls annotateIntervals()

areZRelations(other)

directly calls areZRelations()

bass(newbass=0)

directly calls bass()

canBeDominantV()

directly calls canBeDominantV()

canBeTonic()

directly calls canBeTonic()

closedPosition(forceOctave=None, inPlace=False)

directly calls closedPosition()

containsSeventh()

directly calls containsSeventh()

containsTriad()

directly calls containsTriad()

findFigure()

No documentation.

findRoot()

directly calls findRoot()

getChordStep(chordStep, testRoot=None)

directly calls getChordStep()

getChordStepModifications()

Return all harmony degrees as a list.

getColor(pitchTarget)

directly calls getColor()

getDegrees()

Return list of all the degrees associated with the pitches of the Harmony Chord

>>> from music21 import *
>>> h = harmony.ChordSymbol('Dm7/F')
>>> h.getDegrees()
['1', '-3', '5', '-7']
getNotehead(p)

directly calls getNotehead()

getPitchesAndDegrees()

pitchesAndDegrees is the compiled list of the pitches in the chord and their respective degrees (with alterations, a ‘-‘ for flat, a ‘#’ for sharp, and an ‘A’ for altered. It is a list of lists of two units, the pitch and the degree. The list is not ordered.

>>> from music21 import *
>>> h = harmony.ChordSymbol('CMaj7')
>>> h.getPitchesAndDegrees()
[[C3, '1'], [E3, '3'], [G3, '5'], [B3, '7']]

>>> h = harmony.ChordSymbol('Dm7/Fomit5')
>>> h.getPitchesAndDegrees()
[[D4, '1'], [F3, '-3'], [C4, '-7']]
>>> h = harmony.ChordSymbol('Dm7/F')
>>> h.getPitchesAndDegrees()
[[D4, '1'], [F3, '-3'], [A3, '5'], [C4, '-7']]
getStemDirection(p)

directly calls getStemDirection()

getTie(p)

directly calls getTie()

getVolume(p)

directly calls getVolume()

getZRelation()

directly calls getZRelation()

hasAnyRepeatedDiatonicNote(testRoot=None)

directly calls hasAnyRepeatedDiatonicNote()

hasComponentVolumes()

directly calls hasComponentVolumes()

hasRepeatedChordStep(chordStep, testRoot=None)

directly calls hasRepeatedChordStep()

intervalFromChordStep(chordStep, testRoot=None)

directly calls intervalFromChordStep()

inversion()

directly calls inversion()

inversionName()

directly calls inversionName()

isAugmentedSixth()

directly calls isAugmentedSixth()

isAugmentedTriad()

directly calls isAugmentedTriad()

isConsonant()

directly calls isConsonant()

isDiminishedSeventh()

directly calls isDiminishedSeventh()

isDiminishedTriad()

directly calls isDiminishedTriad()

isDominantSeventh()

directly calls isDominantSeventh()

isFalseDiminishedSeventh()

directly calls isFalseDiminishedSeventh()

isFrenchAugmentedSixth()

directly calls isFrenchAugmentedSixth()

isGermanAugmentedSixth()

directly calls isGermanAugmentedSixth()

isHalfDiminishedSeventh()

directly calls isHalfDiminishedSeventh()

isIncompleteMajorTriad()

directly calls isIncompleteMajorTriad()

isIncompleteMinorTriad()

directly calls isIncompleteMinorTriad()

isItalianAugmentedSixth(restrictDoublings=False)

directly calls isItalianAugmentedSixth()

isMajorTriad()

directly calls isMajorTriad()

isMinorTriad()

directly calls isMinorTriad()

isSeventh()

directly calls isSeventh()

isSwissAugmentedSixth()

directly calls isSwissAugmentedSixth()

isTriad()

directly calls isTriad()

removeRedundantPitchClasses(inPlace=True)

directly calls removeRedundantPitchClasses()

removeRedundantPitchNames(inPlace=True)

directly calls removeRedundantPitchNames()

removeRedundantPitches(inPlace=True)

directly calls removeRedundantPitches()

root(newroot=False)

directly calls root()

seekChordTablesAddress()

directly calls seekChordTablesAddress()

semitonesFromChordStep(chordStep, testRoot=None)

directly calls semitonesFromChordStep()

setColor(value, pitchTarget=None)

directly calls setColor()

setNotehead(nh, pitchTarget)

directly calls setNotehead()

setStemDirection(stem, pitchTarget)

directly calls setStemDirection()

setTie(t, pitchTarget)

directly calls setTie()

setVolume(vol, pitchTarget=None)

directly calls setVolume()

sortAscending(inPlace=False)

directly calls sortAscending()

sortChromaticAscending()

directly calls sortChromaticAscending()

sortDiatonicAscending(inPlace=False)

directly calls sortDiatonicAscending()

sortFrequencyAscending()

directly calls sortFrequencyAscending()

transpose(value, inPlace=False)

directly calls transpose()

Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSpannerSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), removeLocationBySite(), removeLocationBySiteId(), removeNonContainedLocations(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()

Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()

ChordStepModification

class music21.harmony.ChordStepModification(modType=None, degree=None, interval=None)

ChordStepModification objects define the specification of harmony degree alterations, subtractions, or additions, used in Harmony objects, which includes harmony.ChordSymbol objects (and will include harmony.RomanNumeral objects)

degree-value element: indicates degree in chord, positive integers only degree-alter: indicates semitone alteration of degree, positive and negative integers only degree-type: add, alter, or subtract

if add: degree-alter is relative to a dominant chord (major and perfect intervals except for a minor seventh)

if alter or subtract: degree-alter is relative to degree already in the chord based on its kind element

<!– FROM XML DOCUMENTATION http://www.google.com/codesearch#AHKd_kdk32Q/trunk/musicXML/dtd/direction.mod&q=Chord%20Symbols%20package:http://bmml%5C.googlecode%5C.com&l=530 The degree element is used to add, alter, or subtract individual notes in the chord. The degree-value element is a number indicating the degree of the chord (1 for the root, 3 for third, etc). The degree-alter element is like the alter element in notes: 1 for sharp, -1 for flat, etc. The degree-type element can be add, alter, or subtract. If the degree-type is alter or subtract, the degree-alter is relative to the degree already in the chord based on its kind element. If the degree-type is add, the degree-alter is relative to a dominant chord (major and perfect intervals except for a minor seventh). The print-object attribute can be used to keep the degree from printing separately when it has already taken into account in the text attribute of the kind element. The plus-minus attribute is used to indicate if plus and minus symbols should be used instead of sharp and flat symbols to display the degree alteration; it is no by default. The degree-value and degree-type text attributes specify how the value and type of the degree should be displayed.

A harmony of kind “other” can be spelled explicitly by using a series of degree elements together with a root. –>

>>> from music21 import *
>>> hd = harmony.ChordStepModification('add', 4)
>>> hd
<music21.harmony.ChordStepModification modType=add degree=4 interval=None>
>>> hd = harmony.ChordStepModification('alter', 3, 1)
>>> hd
<music21.harmony.ChordStepModification modType=alter degree=3 interval=<music21.interval.Interval A1>>

ChordStepModification properties

degree
>>> from music21 import *
>>> hd = harmony.ChordStepModification()
>>> hd.degree = 3
>>> hd.degree
3
>>> hd.degree = 'juicy'
Traceback (most recent call last):
ChordStepModificationException: not a valid degree: juicy
interval

Get or set the alteration of this degree as a Interval object.

>>> from music21 import *
>>> hd = harmony.ChordStepModification()
>>> hd.interval = 1
>>> hd.interval
<music21.interval.Interval A1>
>>> hd.interval = -2
>>> hd.interval
<music21.interval.Interval AA-1>
modType

Get or set the ChordStepModification modification type, where permitted types are the strings add, subtract, or alter.

>>> from music21 import *
>>> hd = harmony.ChordStepModification()
>>> hd.modType = 'add'
>>> hd.modType
'add'
>>> hd.modType = 'juicy'
Traceback (most recent call last):
ChordStepModificationException: not a valid degree modification type: juicy

ChordSymbol

Inherits from: Harmony, Music21Object, JSONSerializer

class music21.harmony.ChordSymbol(figure=None, **keywords)

Class representing the Chord Symbols commonly found on lead sheets. Chord Symbol objects can be instantiated one of two main ways: 1) when music xml is parsed by the music21 converter, xml Chord Symbol tags are interpreted as Chord Symbol objects with a root and kind attribute. If bass is not specified, the bass is assumed to be the root

2) by creating a chord symbol object with music21 by passing in the expression commonly found on leadsheets. Due to the relative diversity of lead sheet chord syntax, not all expressions are supported. Consult the examples for the supported syntax, or email us for help.

When a Chord Symbol object is instantiated, it creates a ‘chord’ property, which is the chord representation of the Chord Symbol object. This chord is of Chord and can be manipulated in the same was as any other chord object. However, when you access the chord attribute of the Chord Symbol, the pitches associated with that chord symbol are realized. This is true for both Chord Symbol objects instantiated from music xml and directly with music21.

The music xml-based approach to instantiating Chord Symbol objects:

>>> from music21 import *
>>> cs = harmony.ChordSymbol(kind='minor',kindStr = 'm', root='C', bass = 'E-')
>>> cs
<music21.harmony.ChordSymbol Cm/E->
>>> cs.XMLkind
'minor'
>>> cs.XMLroot
C
>>> cs.XMLbass
E-

The second approach to creating a Chord Symbol object, by passing a regular expression:

>>> harmony.ChordSymbol('C').pitches
[C3, E3, G3]
>>> harmony.ChordSymbol('Cm').pitches
[C3, E-3, G3]
>>> harmony.ChordSymbol('C+').pitches
[C3, E3, G#3]
>>> harmony.ChordSymbol('Cdim').pitches
[C3, E-3, G-3]
>>> harmony.ChordSymbol('C7').pitches
[C3, E3, G3, B-3]
>>> harmony.ChordSymbol('CM7').pitches
[C3, E3, G3, B3]
>>> harmony.ChordSymbol('Cm7').pitches
[C3, E-3, G3, B-3]
>>> harmony.ChordSymbol('Cdim7').pitches
[C3, E-3, G-3, B--3]
>>> harmony.ChordSymbol('C7+').pitches
[C3, E3, G#3, B-3]
>>> harmony.ChordSymbol('Cm7b5').pitches #half-diminished
[C3, E3, G-3, B-3]
>>> harmony.ChordSymbol('CmMaj7').pitches
[C3, E-3, G3, B3]
>>> harmony.ChordSymbol('C6').pitches
[C3, E3, G3, A3]
>>> harmony.ChordSymbol('Cm6').pitches
[C3, E-3, G3, A3]
>>> harmony.ChordSymbol('C9').pitches
[C3, E3, G3, B-3, D4]
>>> harmony.ChordSymbol('CMaj9').pitches
[C3, E3, G3, B3, D4]
>>> harmony.ChordSymbol('Cm9').pitches
[C3, E-3, G3, B-3, D4]
>>> harmony.ChordSymbol('C11').pitches
[C2, E2, G2, B-2, D3, F3]
>>> harmony.ChordSymbol('CMaj11').pitches
[C2, E2, G2, B2, D3, F3]
>>> harmony.ChordSymbol('Cm11').pitches
[C2, E-2, G2, B-2, D3, F3]
>>> harmony.ChordSymbol('C13').pitches
[C2, E2, G2, B-2, D3, F3, A3]
>>> harmony.ChordSymbol('CMaj13').pitches
[C2, E2, G2, B2, D3, F3, A3]
>>> harmony.ChordSymbol('Cm13').pitches
[C2, E-2, G2, B-2, D3, F3, A3]
>>> harmony.ChordSymbol('Csus2').pitches
[C3, D3, G3]
>>> harmony.ChordSymbol('Csus4').pitches
[C3, F3, G3]
>>> harmony.ChordSymbol('CN6').pitches
[C3, D-3, E3, G-3]
>>> harmony.ChordSymbol('CIt+6').pitches
[C3, F#3, A-3]
>>> harmony.ChordSymbol('CFr+6').pitches
[C3, D3, F#3, A-3]
>>> harmony.ChordSymbol('CGr+6').pitches
[C3, E-3, F#3, A-3]
>>> harmony.ChordSymbol('Cpedal').pitches
[C3]
>>> harmony.ChordSymbol('Cpower').pitches
[C3, G3]
>>> harmony.ChordSymbol('Ftristan').pitches
[F3, G#3, B3, D#4]
>>> harmony.ChordSymbol('C/E').pitches
[E3, G3, C4]
>>> harmony.ChordSymbol('Dm7/F').pitches
[F3, A3, C4, D4]
>>> harmony.ChordSymbol('Cadd2').pitches
[C3, D3, E3, G3]
>>> harmony.ChordSymbol('C7omit3').pitches
[C3, G3, B-3]

You can also create a Chord Symbol by writing out each degree, and any alterations to that degree: You must explicitly indicate EACH degree (a triad is NOT necessarily implied)

>>> harmony.ChordSymbol('C35b7b9#11b13').pitches
[C3, D-3, E3, F#3, G3, A-3, B-3]

>>> harmony.ChordSymbol('C35911').pitches
[C3, D3, E3, F3, G3]

Ambiguity in notation: if the expression is ambiguous, for example ‘Db35’ (is this the key of Db with a third and a fifth, or is this key of D with a flat 3 and normal fifth?) To prevent ambiguity, insert a comma after the root.

>>> harmony.ChordSymbol('Db,35').pitches
[D-3, F3, A-3]
>>> harmony.ChordSymbol('D,b35').pitches
[D3, F3, A3]
>>> harmony.ChordSymbol('D,35b7b9#11b13').pitches
[D3, E-3, F#3, G#3, A3, B-3, C4]

ChordSymbol attributes

Attributes without Documentation: XMLkindStr, XMLkind

Attributes inherited from Harmony: chordStepModifications

Attributes inherited from Music21Object: classSortOrder, hideObjectOnPrint, id, isSpanner, isStream, groups

ChordSymbol properties

ChordSymbol methods

findFigure()

return the chord symbol figure associated with this chord. the XMLroot, XMLbass and XMLkind attributes must be specified

Needs development - TODO: chord step modifications need actually pitches rather than numeric degrees

>>> from music21 import *
>>> h = harmony.ChordSymbol(root = 'F', bass = 'D-', kind = 'Neapolitan')
>>> h.figure
'FN6/D-'
inversionIsValid(inversion)

returns true if the provided inversion is exists for the given pitches of the chord. If not, it returns false and the getPitches method then appends the bass pitch to the chord.

Methods inherited from Harmony: addChordStepModification(), annotateIntervals(), areZRelations(), bass(), canBeDominantV(), canBeTonic(), closedPosition(), containsSeventh(), containsTriad(), findRoot(), getChordStep(), getChordStepModifications(), getColor(), getDegrees(), getNotehead(), getPitchesAndDegrees(), getStemDirection(), getTie(), getVolume(), getZRelation(), hasAnyRepeatedDiatonicNote(), hasComponentVolumes(), hasRepeatedChordStep(), intervalFromChordStep(), inversion(), inversionName(), isAugmentedSixth(), isAugmentedTriad(), isConsonant(), isDiminishedSeventh(), isDiminishedTriad(), isDominantSeventh(), isFalseDiminishedSeventh(), isFrenchAugmentedSixth(), isGermanAugmentedSixth(), isHalfDiminishedSeventh(), isIncompleteMajorTriad(), isIncompleteMinorTriad(), isItalianAugmentedSixth(), isMajorTriad(), isMinorTriad(), isSeventh(), isSwissAugmentedSixth(), isTriad(), removeRedundantPitchClasses(), removeRedundantPitchNames(), removeRedundantPitches(), root(), seekChordTablesAddress(), semitonesFromChordStep(), setColor(), setNotehead(), setStemDirection(), setTie(), setVolume(), sortAscending(), sortChromaticAscending(), sortDiatonicAscending(), sortFrequencyAscending(), transpose()

Methods inherited from Music21Object: searchActiveSiteByAttr(), getContextAttr(), setContextAttr(), addContext(), addLocation(), addLocationAndActiveSite(), freezeIds(), getAllContextsByClass(), getCommonSiteIds(), getCommonSites(), getContextByClass(), getOffsetBySite(), getSiteIds(), getSites(), getSpannerSites(), hasContext(), hasSpannerSite(), isClassOrSubclass(), mergeAttributes(), next(), previous(), purgeLocations(), removeLocationBySite(), removeLocationBySiteId(), removeNonContainedLocations(), setOffsetBySite(), show(), splitAtDurations(), splitAtQuarterLength(), splitByQuarterLengths(), unfreezeIds(), unwrapWeakref(), wrapWeakref(), write()

Methods inherited from JSONSerializer: jsonAttributes(), jsonComponentFactory(), jsonPrint(), jsonRead(), jsonWrite()