RootlessChordClass

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

Rootless chord class.

>>> from abjad.tools import tonalanalysistools

Major triad in root position:

>>> tonalanalysistools.RootlessChordClass('major')
MajorTriadInRootPosition('P1', '+M3', '+P5')

Dominant seventh in root position:

>>> tonalanalysistools.RootlessChordClass('dominant', 7)
DominantSeventhInRootPosition('P1', '+M3', '+P5', '+m7')

German augmented sixth in root position:

>>> tonalanalysistools.RootlessChordClass('German', 'augmented sixth')
GermanAugmentedSixthInRootPosition('P1', '+M3', '+m3', '+aug2')

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.TypedTuple.TypedTuple" [color=3, group=2, label=TypedTuple, shape=box]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" -> "abjad.tools.datastructuretools.TypedTuple.TypedTuple"; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.IntervalSegment.IntervalSegment" [color=4, group=3, label=IntervalSegment, shape=box]; "abjad.tools.pitchtools.Segment.Segment" [color=4, group=3, label=Segment, shape=oval, style=bold]; "abjad.tools.pitchtools.Segment.Segment" -> "abjad.tools.pitchtools.IntervalSegment.IntervalSegment"; } subgraph cluster_tonalanalysistools { graph [label=tonalanalysistools]; "abjad.tools.tonalanalysistools.RootlessChordClass.RootlessChordClass" [color=black, fontcolor=white, group=4, label=<<B>RootlessChordClass</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.TypedTuple.TypedTuple" -> "abjad.tools.pitchtools.Segment.Segment"; "abjad.tools.pitchtools.IntervalSegment.IntervalSegment" -> "abjad.tools.tonalanalysistools.RootlessChordClass.RootlessChordClass"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

cardinality Gets cardinality.
count(item) Counts item in collection.
extent Gets extent.
extent_name Gets extent name.
from_interval_class_segment(segment) Makes new rootless chord-class from segment.
from_selection(selection[, item_class]) Makes interval segment from component selection.
has_duplicates() True if segment has duplicate items.
index(item) Gets index of item in collection.
inversion Gets inversion.
item_class Gets item class of collection.
items Gets items in collection.
position Gets position.
quality_string Gets quality string.
rotate([n]) Rotates interval segment by index n.
rotation Gets rotation.
slope Slope of interval segment.
spread Gets spread of interval segment.
__add__(argument) Adds typed tuple to argument.
__contains__(item) Is true if typed tuple contains item.
__eq__(argument) Is true when argument is a typed collection with items that compare equal to those of this typed collection.
__format__([format_specification]) Formats Abjad object.
__getitem__(argument) Gets item or slice identified by argument.
__hash__() Hashes typed tuple.
__illustrate__([markup_direction, figure_name]) Illustrates segment.
__iter__() Iterates typed collection.
__len__() Gets length of typed collection.
__mul__(argument) Multiplies typed tuple by argument.
__ne__(argument) Is true when Abjad object does not equal argument.
__radd__(argument) Right-adds argument to typed tuple.
__repr__() Gets interpreter representation of rootless chord-class.
__rmul__(argument) Multiplies argument by typed tuple.
__str__() Gets string representation of segment.

Read-only properties

RootlessChordClass.cardinality

Gets cardinality.

>>> tonalanalysistools.RootlessChordClass('dominant', 7).cardinality
4

Returns nonnegative integer.

RootlessChordClass.extent

Gets extent.

>>> tonalanalysistools.RootlessChordClass('dominant', 7).extent
7

Returns nonnegative integer.

RootlessChordClass.extent_name

Gets extent name.

>>> tonalanalysistools.RootlessChordClass('dominant', 7).extent_name
'seventh'
RootlessChordClass.inversion

Gets inversion.

>>> tonalanalysistools.RootlessChordClass('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.

RootlessChordClass.position

Gets position.

>>> tonalanalysistools.RootlessChordClass('dominant', 7).position
'root position'

Returns string.

RootlessChordClass.quality_string

Gets quality string.

>>> tonalanalysistools.RootlessChordClass('dominant', 7).quality_string
'dominant'

Returns string.

RootlessChordClass.rotation

Gets rotation.

>>> tonalanalysistools.RootlessChordClass('dominant', 7).rotation
0

Returns nonnegative integer.

(IntervalSegment).slope

Slope of interval segment.

The slope of a interval segment is the sum of its intervals divided by its length:

>>> abjad.IntervalSegment([1, 2]).slope
Multiplier(3, 2)

Returns multiplier.

(IntervalSegment).spread

Gets spread of interval segment.

The maximum interval spanned by any combination of the intervals within a numbered interval segment.

>>> abjad.IntervalSegment([1, 2, -3, 1, -2, 1]).spread
NumberedInterval(4)
>>> abjad.IntervalSegment([1, 1, 1, 2, -3, -2]).spread
NumberedInterval(5)

Returns numbered interval.

Methods

(TypedTuple).count(item)

Counts item in collection.

Coerces item.

Returns nonnegative integer.

(IntervalSegment).has_duplicates()

True if segment has duplicate items. Otherwise false.

>>> intervals = 'm2 M3 -aug4 m2 P5'
>>> segment = abjad.IntervalSegment(intervals)
>>> segment.has_duplicates()
True
>>> intervals = 'M3 -aug4 m2 P5'
>>> segment = abjad.IntervalSegment(intervals)
>>> segment.has_duplicates()
False

Returns true or false.

(TypedTuple).index(item)

Gets index of item in collection.

Coerces item.

Returns nonnegative integer.

(IntervalSegment).rotate(n=0)

Rotates interval segment by index n.

Returns new interval segment.

Class & static methods

static RootlessChordClass.from_interval_class_segment(segment)

Makes new rootless chord-class from segment.

>>> segment = abjad.IntervalClassSegment([
...     abjad.NamedInversionEquivalentIntervalClass('m3'),
...     abjad.NamedInversionEquivalentIntervalClass('m3'),
...     ])
>>> class_ = tonalanalysistools.RootlessChordClass
>>> class_.from_interval_class_segment(segment)
DiminishedTriadInRootPosition('P1', '+m3', '+dim5')
>>> segment = abjad.IntervalClassSegment([
...     abjad.NamedInversionEquivalentIntervalClass('m3'),
...     abjad.NamedInversionEquivalentIntervalClass('M3'),
...     ])
>>> class_ = tonalanalysistools.RootlessChordClass
>>> class_.from_interval_class_segment(segment)
MinorTriadInRootPosition('P1', '+m3', '+P5')
>>> segment = abjad.IntervalClassSegment([
...     abjad.NamedInversionEquivalentIntervalClass('M3'),
...     abjad.NamedInversionEquivalentIntervalClass('m3'),
...     ])
>>> class_ = tonalanalysistools.RootlessChordClass
>>> class_.from_interval_class_segment(segment)
MajorTriadInRootPosition('P1', '+M3', '+P5')

Returns new rootless chord-class.

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

Makes interval segment from component selection.

>>> staff = abjad.Staff("c'8 d'8 e'8 f'8 g'8 a'8 b'8 c''8")
>>> abjad.IntervalSegment.from_selection(
...     staff,
...     item_class=abjad.NumberedInterval,
...     )
IntervalSegment([2, 2, 1, 2, 2, 2, 1])

Returns interval segment.

Special methods

(TypedTuple).__add__(argument)

Adds typed tuple to argument.

Returns new typed tuple.

(TypedTuple).__contains__(item)

Is true if typed tuple contains item.

Coerces item.

Returns none.

(TypedCollection).__eq__(argument)

Is true when argument is a typed collection with items that compare equal to those of this typed collection. 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.

(TypedTuple).__getitem__(argument)

Gets item or slice identified by argument.

Returns item or new typed tuple.

(TypedTuple).__hash__()

Hashes typed tuple.

Returns integer.

(Segment).__illustrate__(markup_direction=Up, figure_name=None, **keywords)

Illustrates segment.

Returns LilyPond file.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedCollection).__len__()

Gets length of typed collection.

Returns nonnegative integer.

(TypedTuple).__mul__(argument)

Multiplies typed tuple by argument.

Returns new typed tuple.

(AbjadObject).__ne__(argument)

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

Returns true or false.

(TypedTuple).__radd__(argument)

Right-adds argument to typed tuple.

RootlessChordClass.__repr__()

Gets interpreter representation of rootless chord-class.

Returns string.

(TypedTuple).__rmul__(argument)

Multiplies argument by typed tuple.

Returns new typed tuple.

(Segment).__str__()

Gets string representation of segment.

Returns string.