RootedChordClass

class tonalanalysistools.RootedChordClass(root=None, quality_string='major', extent='triad', inversion='root')

Rooted chord class.

>>> from abjad.tools import tonalanalysistools

Initializes from pair:

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

Initializes from triple:

>>> tonalanalysistools.RootedChordClass('g', 'dominant', 7)
GDominantSeventhInRootPosition

G dominant seventh represents a class of chords because there are many different spacings 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 Gets bass.
cardinality Gets cardinality.
cardinality_to_extent(cardinality) Change cardinality to extent.
chord_quality Gets chord quality.
copy() Copies typed frozen set.
difference(argument) Typed frozen set set-minus argument.
extent Gets extent.
extent_to_cardinality(extent) Changes extent to cardinality.
extent_to_extent_name(extent) Changes extent to extent name.
figured_bass Gets figured bass.
from_selection(selection[, item_class]) Makes pitch-class set from selection.
get_normal_order() Gets normal order.
get_prime_form([transposition_only]) Gets prime form.
intersection(argument) Set-theoretic intersection of typed frozen set and argument.
inversion Gets inversion.
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(argument) Is true when typed frozen set shares no elements with argument.
issubset(argument) Is true when typed frozen set is a subset of argument.
issuperset(argument) Is true when typed frozen set is a superset of argument.
item_class Gets item class of collection.
items Gets items in collection.
markup Markup of rooted chord-class.
multiply(n) Multiplies pitch-class set by n.
order_by(segment) Orders pitch-class set by pitch-class segment.
quality_pair Gets quality pair.
root Gets root.
root_string Gets root string.
symmetric_difference(argument) Symmetric difference of typed frozen set and argument.
transpose() Transposes rooted chord-class.
union(argument) Union of typed frozen set and argument.
__and__(argument) Logical AND of typed frozen set and argument.
__contains__(argument) Is true when pitch-class set contains argument.
__eq__(argument) Is true when argument 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__(argument) Is true when typed frozen set is greater than or equal to argument.
__gt__(argument) Is true when typed frozen set is greater than argument.
__hash__() Hashes rooted chord-class.
__illustrate__() Illustrates pitch-class set.
__iter__() Iterates typed collection.
__le__(argument) Is true when typed frozen set is less than or equal to argument.
__len__() Gets length of typed collection.
__lt__(argument) Is true when typed frozen set is less than argument.
__ne__(argument) Is true when Abjad object does not equal argument.
__or__(argument) Logical OR of typed frozen set and argument.
__repr__() Gets interpreter representation of rooted chord-class.
__str__() Gets string representation of pitch-class set.
__sub__(argument) Subtracts argument from typed frozen set.
__xor__(argument) Logical XOR of typed frozen set and argument.

Read-only properties

RootedChordClass.bass

Gets bass.

>>> tonalanalysistools.RootedChordClass('g', 'major').bass
NamedPitchClass('g')

Returns named pitch-class.

RootedChordClass.cardinality

Gets cardinality.

>>> tonalanalysistools.RootedChordClass('g', 'dominant', 7).cardinality
4

Returns nonnegative integer.

RootedChordClass.chord_quality

Gets chord quality.

>>> tonalanalysistools.RootedChordClass('g', 'dominant', 7).chord_quality
DominantSeventhInRootPosition('P1', '+M3', '+P5', '+m7')

Returns chord quality.

RootedChordClass.extent

Gets extent.

>>> tonalanalysistools.RootedChordClass('g', 'dominant', 7).extent
ChordExtent(7)

Returns chord extent.

RootedChordClass.figured_bass

Gets figured bass.

>>> tonalanalysistools.RootedChordClass('g', 'dominant', 7).extent
ChordExtent(7)

Returns string.

RootedChordClass.inversion

Gets inversion.

>>> tonalanalysistools.RootedChordClass('g', 'dominant', 7).inversion
0

Returns nonnegative integer.

(TypedCollection).item_class

Gets item class of collection.

Collection coerces items according to item_class.

Returns class.

(TypedCollection).items

Gets items in collection.

Returns list.

RootedChordClass.markup

Markup of rooted chord-class.

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

Returns markup.

RootedChordClass.quality_pair

Gets quality pair.

>>> chord_class = tonalanalysistools.RootedChordClass(
...     'c',
...     'major',
...     'triad',
...     'root',
...     )
>>> chord_class.quality_pair
('major', 'triad')
>>> chord_class = tonalanalysistools.RootedChordClass(
...     'g',
...     'dominant',
...     7,
...     'second',
...     )
>>> chord_class.quality_pair
('dominant', 'seventh')

Returns pair.

RootedChordClass.root

Gets root.

>>> chord_class = tonalanalysistools.RootedChordClass(
...     'c',
...     'major',
...     'triad',
...     'root',
...     )
>>> chord_class.root
NamedPitchClass('c')
>>> chord_class = tonalanalysistools.RootedChordClass(
...     'g',
...     'dominant',
...     7,
...     'second',
...     )
>>> chord_class.root
NamedPitchClass('g')

Returns named pitch-class.

RootedChordClass.root_string

Gets root string.

>>> chord_class = tonalanalysistools.RootedChordClass(
...     'c',
...     'major',
...     'triad',
...     'root',
...     )
>>> chord_class.root_string
'C'
>>> chord_class = tonalanalysistools.RootedChordClass(
...     'g',
...     'dominant',
...     7,
...     'second',
...     )
>>> chord_class.root_string
'G'

Returns string.

Methods

(TypedFrozenset).copy()

Copies typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).difference(argument)

Typed frozen set set-minus argument.

Returns new typed frozen set.

(PitchClassSet).get_normal_order()

Gets normal order.

Gets normal order of empty pitch-class set:

>>> pc_set = abjad.PitchClassSet()
>>> pc_set.get_normal_order()
PitchClassSegment([])

Gets normal order:

>>> pc_set = abjad.PitchClassSet([0, 1, 10, 11])
>>> pc_set.get_normal_order()
PitchClassSegment([10, 11, 0, 1])

Gets normal order:

>>> pc_set = abjad.PitchClassSet([2, 8, 9])
>>> pc_set.get_normal_order()
PitchClassSegment([8, 9, 2])

Gets normal order of pitch-class set with degree of symmetry equal to 2:

>>> pc_set = abjad.PitchClassSet([1, 2, 7, 8])
>>> pc_set.get_normal_order()
PitchClassSegment([1, 2, 7, 8])

Gets normal order of pitch-class set with degree of symmetry equal to 4:

>>> pc_set = abjad.PitchClassSet([0, 3, 6, 9])
>>> pc_set.get_normal_order()
PitchClassSegment([0, 3, 6, 9])

Returns pitch-class segment.

(PitchClassSet).get_prime_form(transposition_only=False)

Gets prime form.

Gets prime form of empty pitch-class set:

>>> pc_set = abjad.PitchClassSet()
>>> pc_set.get_prime_form()
PitchClassSet([])
>>> pc_set = abjad.PitchClassSet()
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([])

Gets prime form:

>>> pc_set = abjad.PitchClassSet([0, 1, 10, 11])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 2, 3])
>>> pc_set = abjad.PitchClassSet([0, 1, 10, 11])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 1, 2, 3])

Gets prime form:

>>> pc_set = abjad.PitchClassSet([2, 8, 9])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 6])
>>> pc_set = abjad.PitchClassSet([2, 8, 9])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 1, 6])

Gets prime form of pitch-class set with degree of symmetry equal to 2:

>>> pc_set = abjad.PitchClassSet([1, 2, 7, 8])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 6, 7])
>>> pc_set = abjad.PitchClassSet([1, 2, 7, 8])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 1, 6, 7])

Gets prime form of pitch-class set with degree of symmetry equal to 4:

>>> pc_set = abjad.PitchClassSet([0, 3, 6, 9])
>>> pc_set.get_prime_form()
PitchClassSet([0, 3, 6, 9])
>>> pc_set = abjad.PitchClassSet([0, 3, 6, 9])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 3, 6, 9])

Gets prime form of pitch-class that is not inversion-equivalent:

>>> pc_set = abjad.PitchClassSet([0, 4, 6, 7])
>>> pc_set.get_prime_form()
PitchClassSet([0, 1, 3, 7])
>>> pc_set = abjad.PitchClassSet([0, 4, 6, 7])
>>> pc_set.get_prime_form(transposition_only=True)
PitchClassSet([0, 4, 6, 7])

Returns new pitch-class set.

(TypedFrozenset).intersection(argument)

Set-theoretic intersection of typed frozen set and argument.

Returns new typed frozen set.

(PitchClassSet).invert(axis=None)

Inverts pitch-class set.

>>> abjad.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 = abjad.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7],
...     )
>>> pitch_class_set_2 = abjad.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 = abjad.PitchClassSet(
...     [-2, -1.5, 6, 7, -1.5, 7],
...     )
>>> pitch_class_set_2 = abjad.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(argument)

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

Returns true or false.

(TypedFrozenset).issubset(argument)

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

Returns true or false.

(TypedFrozenset).issuperset(argument)

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

Returns true or false.

(PitchClassSet).multiply(n)

Multiplies pitch-class set by n.

>>> abjad.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(segment)

Orders pitch-class set by pitch-class segment.

>>> set_ = abjad.PitchClassSet(['c', 'e', 'b'])
>>> segment = abjad.PitchClassSegment(['e', 'a', 'f'])
>>> set_.order_by(segment)
PitchClassSegment("b e c")

Returns pitch-class segment.

(TypedFrozenset).symmetric_difference(argument)

Symmetric difference of typed frozen set and argument.

Returns new typed frozen set.

RootedChordClass.transpose()

Transposes rooted chord-class.

Not yet implemented.

Will return new rooted chord-class.

(TypedFrozenset).union(argument)

Union of typed frozen set and argument.

Returns new typed frozen set.

Class & static methods

static RootedChordClass.cardinality_to_extent(cardinality)

Change cardinality to extent.

>>> tonalanalysistools.RootedChordClass.cardinality_to_extent(3)
5
>>> tonalanalysistools.RootedChordClass.cardinality_to_extent(4)
7
>>> tonalanalysistools.RootedChordClass.cardinality_to_extent(5)
9
>>> tonalanalysistools.RootedChordClass.cardinality_to_extent(6)
11
>>> tonalanalysistools.RootedChordClass.cardinality_to_extent(7)
13

Returns integer.

static RootedChordClass.extent_to_cardinality(extent)

Changes extent to cardinality.

>>> tonalanalysistools.RootedChordClass.extent_to_cardinality(5)
3
>>> tonalanalysistools.RootedChordClass.extent_to_cardinality(7)
4
>>> tonalanalysistools.RootedChordClass.extent_to_cardinality(9)
5
>>> tonalanalysistools.RootedChordClass.extent_to_cardinality(11)
6
>>> tonalanalysistools.RootedChordClass.extent_to_cardinality(13)
7

Returns integer.

static RootedChordClass.extent_to_extent_name(extent)

Changes extent to extent name.

>>> tonalanalysistools.RootedChordClass.extent_to_extent_name(5)
'triad'
>>> tonalanalysistools.RootedChordClass.extent_to_extent_name(7)
'seventh'
>>> tonalanalysistools.RootedChordClass.extent_to_extent_name(9)
'ninth'
>>> tonalanalysistools.RootedChordClass.extent_to_extent_name(11)
'eleventh'
>>> tonalanalysistools.RootedChordClass.extent_to_extent_name(13)
'thirteenth'

Returns string.

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

Makes pitch-class set from selection.

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

Returns pitch-class set.

Special methods

(TypedFrozenset).__and__(argument)

Logical AND of typed frozen set and argument.

Returns new typed frozen set.

(PitchClassSet).__contains__(argument)

Is true when pitch-class set contains argument. Otherwise false.

Initializes numbered pitch-class set:

>>> set_ = abjad.PitchClassSet(
...     items=[-2, -1.5, 6, 7, -1.5, 7],
...     item_class=abjad.NumberedPitchClass,
...     )
>>> set_
PitchClassSet([6, 7, 10, 10.5])
>>> abjad.NamedPitch('fs') in set_
True
>>> abjad.NamedPitch('f') in set_
False
>>> 6 in set_
True
>>> 5 in set_
False

Returns true or false.

RootedChordClass.__eq__(argument)

Is true when argument 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__(argument)

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

Returns true or false.

(TypedFrozenset).__gt__(argument)

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

Returns true or false.

RootedChordClass.__hash__()

Hashes rooted chord-class.

Returns integer.

(PitchClassSet).__illustrate__()

Illustrates pitch-class set.

Illustrates numbered segment:

>>> setting = abjad.PitchClassSet([-2, -1.5, 6, 7, -1.5, 7])
>>> show(setting) 

Illustrates named set:

>>> items = ['c', 'ef', 'bqs,', 'd']
>>> setting = abjad.PitchClassSet(
...     items=items,
...     item_class=abjad.NamedPitchClass,
...     )
>>> show(setting) 

Returns LilyPond file:

>>> prototype = abjad.LilyPondFile
>>> isinstance(setting.__illustrate__(), prototype)
True
(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedFrozenset).__le__(argument)

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

Returns true or false.

(TypedCollection).__len__()

Gets length of typed collection.

Returns nonnegative integer.

(TypedFrozenset).__lt__(argument)

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

Returns true or false.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

(TypedFrozenset).__or__(argument)

Logical OR of typed frozen set and argument.

Returns new typed frozen set.

RootedChordClass.__repr__()

Gets interpreter representation of rooted chord-class.

Returns string.

(PitchClassSet).__str__()

Gets string representation of pitch-class set.

Gets string of set sorted at initialization:

>>> pc_set = abjad.PitchClassSet([6, 7, 10, 10.5])
>>> str(pc_set)
'PC{6, 7, 10, 10.5}'

Gets string of set not sorted at initialization:

>>> pc_set = abjad.PitchClassSet([10.5, 10, 7, 6])
>>> str(pc_set)
'PC{6, 7, 10, 10.5}'

Returns string.

(TypedFrozenset).__sub__(argument)

Subtracts argument from typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).__xor__(argument)

Logical XOR of typed frozen set and argument.

Returns new typed frozen set.