RootedChordClass

class tonalanalysistools.RootedChordClass(root=None, *args)

A rooted chord class.

G major triad in root position:

>>> tonalanalysistools.RootedChordClass('g', 'major')
GMajorTriadInRootPosition

G dominant seventh in root position:

>>> chord_class = tonalanalysistools.RootedChordClass('g', 'dominant', 7)

Note that notions like a G dominant seventh represent an entire class of chords because there are many different spacings and registrations of a G dominant seventh.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_datastructuretools { graph [label=datastructuretools]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" [color=3, group=2, label=TypedCollection, shape=oval, style=bold]; "abjad.tools.datastructuretools.TypedFrozenset.TypedFrozenset" [color=3, group=2, label=TypedFrozenset, shape=box]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" -> "abjad.tools.datastructuretools.TypedFrozenset.TypedFrozenset"; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.PitchClassSet.PitchClassSet" [color=4, group=3, label=PitchClassSet, shape=box]; "abjad.tools.pitchtools.Set.Set" [color=4, group=3, label=Set, shape=oval, style=bold]; "abjad.tools.pitchtools.Set.Set" -> "abjad.tools.pitchtools.PitchClassSet.PitchClassSet"; } subgraph cluster_tonalanalysistools { graph [label=tonalanalysistools]; "abjad.tools.tonalanalysistools.RootedChordClass.RootedChordClass" [color=black, fontcolor=white, group=4, label=<<B>RootedChordClass</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.datastructuretools.TypedCollection.TypedCollection"; "abjad.tools.datastructuretools.TypedFrozenset.TypedFrozenset" -> "abjad.tools.pitchtools.Set.Set"; "abjad.tools.pitchtools.PitchClassSet.PitchClassSet" -> "abjad.tools.tonalanalysistools.RootedChordClass.RootedChordClass"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

bass Bass of rooted chord-class.
cardinality Cardinality of rooted chord-class.
cardinality_to_extent(cardinality) Change cardinality to extent.
chord_quality Chord quality of rooted chord-class.
copy() Copies typed frozen set.
difference(expr) Typed frozen set set-minus expr.
extent Extent of rooted chord-class.
extent_to_cardinality(extent) Change extent to cardinality.
extent_to_extent_name(extent) Change extent to extent name.
figured_bass Figured bass of rooted chord-class.
from_selection(class_, selection[, item_class]) Makes pitch-class set from selection.
intersection(expr) Set-theoretic intersection of typed frozen set and expr.
inversion Inversion of rooted chord-class.
invert([axis]) Inverts pitch-class set.
is_transposed_subset(pcset) Is true when pitch-class set is transposed subset of pcset.
is_transposed_superset(pcset) Is true when pitch-class set is transposed superset of pcset.
isdisjoint(expr) Is true when typed frozen set shares no elements with expr.
issubset(expr) Is true when typed frozen set is a subset of expr.
issuperset(expr) Is true when typed frozen set is a superset of expr.
item_class Item class to coerce items into.
items Gets collection items.
markup Markup of rooted chord-class.
multiply(n) Multiplies pitch-class set by n.
order_by(pitch_class_segment) Orders pitch-class set by pitch_class_segment.
quality_pair Quality pair of rooted chord-class.
root Root of rooted chord-class.
root_string Root string of rooted chord-class.
symmetric_difference(expr) Symmetric difference of typed frozen set and expr.
transpose() Transpose rooted chord-class.
union(expr) Union of typed frozen set and expr.
__and__(expr) Logical AND of typed frozen set and expr.
__contains__(item) Is true when typed collection container item.
__eq__(arg) Is true when arg is a rooted chord-class with root, chord quality and inversion equal to those of this rooted chord-class.
__format__([format_specification]) Formats Abjad object.
__ge__(expr) Is true when typed frozen set is greater than or equal to expr.
__gt__(expr) Is true when typed frozen set is greater than expr.
__hash__() Hashes rooted chord-class.
__iter__() Iterates typed collection.
__le__(expr) Is true when typed frozen set is less than or equal to expr.
__len__() Length of typed collection.
__lt__(expr) Is true when typed frozen set is less than expr.
__ne__(arg) Is true when rooted chord-class does not equal arg.
__or__(expr) Logical OR of typed frozen set and expr.
__repr__() Gets interpreter representation of rooted chord-class.
__str__() String representation of set.
__sub__(expr) Subtracts expr from typed frozen set.
__xor__(expr) Logical XOR of typed frozen set and expr.

Read-only properties

RootedChordClass.bass

Bass of rooted chord-class.

>>> chord_class.bass
NamedPitchClass('g')

Returns named pitch-class.

RootedChordClass.cardinality

Cardinality of rooted chord-class.

>>> chord_class.cardinality
4

Returns nonnegative integer.

RootedChordClass.chord_quality

Chord quality of rooted chord-class.

>>> chord_class.chord_quality
DominantSeventhInRootPosition('P1', '+M3', '+P5', '+m7')

Returns chord quality.

RootedChordClass.extent

Extent of rooted chord-class.

>>> chord_class.extent
ChordExtent(number=7)

Returns chord extent.

RootedChordClass.figured_bass

Figured bass of rooted chord-class.

>>> chord_class.figured_bass
'7'

Returns string.

RootedChordClass.inversion

Inversion of rooted chord-class.

>>> chord_class.inversion
0

Returns nonnegative integer.

(TypedCollection).item_class

Item class to coerce items into.

(TypedCollection).items

Gets collection items.

RootedChordClass.markup

Markup of rooted chord-class.

>>> show(chord_class.markup) 

Returns markup.

RootedChordClass.quality_pair

Quality pair of rooted chord-class.

>>> chord_class.quality_pair
('dominant', 'seventh')

Returns pair.

RootedChordClass.root

Root of rooted chord-class.

>>> chord_class.root
NamedPitchClass('g')

Returns

RootedChordClass.root_string

Root string of rooted chord-class.

>>> chord_class.root_string
'G'

Returns string.

Methods

(TypedFrozenset).copy()

Copies typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).difference(expr)

Typed frozen set set-minus expr.

Returns new typed frozen set.

(TypedFrozenset).intersection(expr)

Set-theoretic intersection of typed frozen set and expr.

Returns new typed frozen set.

(PitchClassSet).invert(axis=None)

Inverts pitch-class set.

>>> pitchtools.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7],
...     ).invert()
PitchClassSet([1.5, 2, 5, 6])

Returns numbered pitch-class set.

(PitchClassSet).is_transposed_subset(pcset)

Is true when pitch-class set is transposed subset of pcset. Otherwise false:

>>> pitch_class_set_1 = pitchtools.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7],
...     )
>>> pitch_class_set_2 = pitchtools.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7, 7.5, 8],
...     )
>>> pitch_class_set_1.is_transposed_subset(pitch_class_set_2)
True

Returns true or false.

(PitchClassSet).is_transposed_superset(pcset)

Is true when pitch-class set is transposed superset of pcset. Otherwise false:

>>> pitch_class_set_1 = pitchtools.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7],
...     )
>>> pitch_class_set_2 = pitchtools.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7, 7.5, 8],
...     )
>>> pitch_class_set_2.is_transposed_superset(pitch_class_set_1)
True

Returns true or false.

(TypedFrozenset).isdisjoint(expr)

Is true when typed frozen set shares no elements with expr. Otherwise false.

Returns true or false.

(TypedFrozenset).issubset(expr)

Is true when typed frozen set is a subset of expr. Otherwise false.

Returns true or false.

(TypedFrozenset).issuperset(expr)

Is true when typed frozen set is a superset of expr. Otherwise false.

Returns true or false.

(PitchClassSet).multiply(n)

Multiplies pitch-class set by n.

>>> pitchtools.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7],
...     ).multiply(5)
PitchClassSet([2, 4.5, 6, 11])

Returns new pitch-class set.

(PitchClassSet).order_by(pitch_class_segment)

Orders pitch-class set by pitch_class_segment.

Returns pitch-class segment.

(TypedFrozenset).symmetric_difference(expr)

Symmetric difference of typed frozen set and expr.

Returns new typed frozen set.

RootedChordClass.transpose()

Transpose rooted chord-class.

Not yet implemented.

Will return new rooted chord-class.

(TypedFrozenset).union(expr)

Union of typed frozen set and expr.

Returns new typed frozen set.

Class & static methods

static RootedChordClass.cardinality_to_extent(cardinality)

Change cardinality to extent.

Tertian chord with four pitch classes qualifies as a seventh chord:

>>> tonalanalysistools.RootedChordClass.cardinality_to_extent(4)
7

Returns integer.

static RootedChordClass.extent_to_cardinality(extent)

Change extent to cardinality.

Tertian chord with extent of seven comprises four pitch-clases:

>>> tonalanalysistools.RootedChordClass.extent_to_cardinality(7)
4

Returns integer.

static RootedChordClass.extent_to_extent_name(extent)

Change extent to extent name.

Extent of seven is a seventh:

>>> tonalanalysistools.RootedChordClass.extent_to_extent_name(7)
'seventh'

Returns string.

(PitchClassSet).from_selection(class_, selection, item_class=None)

Makes pitch-class set from selection.

>>> staff_1 = Staff("c'4 <d' fs' a'>4 b2")
>>> staff_2 = Staff("c4. r8 g2")
>>> selection = select((staff_1, staff_2))
>>> pitchtools.PitchClassSet.from_selection(selection)
PitchClassSet(['c', 'd', 'fs', 'g', 'a', 'b'])

Returns pitch-class set.

Special methods

(TypedFrozenset).__and__(expr)

Logical AND of typed frozen set and expr.

Returns new typed frozen set.

(TypedCollection).__contains__(item)

Is true when typed collection container item. Otherwise false.

Returns true or false.

RootedChordClass.__eq__(arg)

Is true when arg is a rooted chord-class with root, chord quality and inversion equal to those of this rooted chord-class. Otherwise false.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(TypedFrozenset).__ge__(expr)

Is true when typed frozen set is greater than or equal to expr. Otherwise false.

Returns true or false.

(TypedFrozenset).__gt__(expr)

Is true when typed frozen set is greater than expr. Otherwise false.

Returns true or false.

RootedChordClass.__hash__()

Hashes rooted chord-class.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedFrozenset).__le__(expr)

Is true when typed frozen set is less than or equal to expr. Otherwise false.

Returns true or false.

(TypedCollection).__len__()

Length of typed collection.

Returns nonnegative integer.

(TypedFrozenset).__lt__(expr)

Is true when typed frozen set is less than expr. Otherwise false.

Returns true or false.

RootedChordClass.__ne__(arg)

Is true when rooted chord-class does not equal arg. Otherwise false.

Returns true or false.

(TypedFrozenset).__or__(expr)

Logical OR of typed frozen set and expr.

Returns new typed frozen set.

RootedChordClass.__repr__()

Gets interpreter representation of rooted chord-class.

Returns string.

(Set).__str__()

String representation of set.

Returns string.

(TypedFrozenset).__sub__(expr)

Subtracts expr from typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).__xor__(expr)

Logical XOR of typed frozen set and expr.

Returns new typed frozen set.