A key defines a relationship between a set of pitch classes in a composition. E.g. the "key of D major".
Get the tonic pitch class for a key:
tonic gMinor == PitchClass.gGet the scale for a key:
scale aFlat == Scale.major PitchClass.aFlatCheck whether a key is major:
isMajor bFlat == TrueCheck whether a key is minor:
isMinor cSharpMinor == TrueGet the key signature for a key as a list of the pitch classes that are sharpened or flattened:
signature bFlat == [ PitchClass.bFlat, PitchClass.eFlat ]Get the relative minor or relative major of a key:
relative f == dMinor
relative cSharpMinor == eGet the parallel minor or parallel major of a key:
parallel f == fMinor
parallel cSharpMinor == cSharpGet the name of a key:
toString eFlat == "E♭"
toString aMinor == "Am"