NamedInversionEquivalentIntervalClass

class pitchtools.NamedInversionEquivalentIntervalClass(name='P1')

Named inversion-equivalent interval-class.

>>> import abjad

Initializes from string:

>>> abjad.NamedInversionEquivalentIntervalClass('-m14')
NamedInversionEquivalentIntervalClass('+M2')

Initializes from pair:

>>> abjad.NamedInversionEquivalentIntervalClass(('perfect', 1))
NamedInversionEquivalentIntervalClass('P1')
>>> abjad.NamedInversionEquivalentIntervalClass(('perfect', -1))
NamedInversionEquivalentIntervalClass('P1')
>>> abjad.NamedInversionEquivalentIntervalClass(('augmented', 4))
NamedInversionEquivalentIntervalClass('+aug4')
>>> abjad.NamedInversionEquivalentIntervalClass(('augmented', -4))
NamedInversionEquivalentIntervalClass('+aug4')
>>> abjad.NamedInversionEquivalentIntervalClass(('augmented', 11))
NamedInversionEquivalentIntervalClass('+aug4')
>>> abjad.NamedInversionEquivalentIntervalClass(('augmented', -11))
NamedInversionEquivalentIntervalClass('+aug4')

Initializes from other interval-class:

>>> interval_class = abjad.NamedInversionEquivalentIntervalClass(
...     'P1',
...     )
>>> abjad.NamedInversionEquivalentIntervalClass(interval_class)
NamedInversionEquivalentIntervalClass('P1')

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.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.IntervalClass.IntervalClass" [color=3, group=2, label=IntervalClass, shape=oval, style=bold]; "abjad.tools.pitchtools.NamedIntervalClass.NamedIntervalClass" [color=3, group=2, label=NamedIntervalClass, shape=box]; "abjad.tools.pitchtools.NamedInversionEquivalentIntervalClass.NamedInversionEquivalentIntervalClass" [color=black, fontcolor=white, group=2, label=<<B>NamedInversionEquivalentIntervalClass</B>>, shape=box, style="filled, rounded"]; "abjad.tools.pitchtools.IntervalClass.IntervalClass" -> "abjad.tools.pitchtools.NamedIntervalClass.NamedIntervalClass"; "abjad.tools.pitchtools.NamedIntervalClass.NamedIntervalClass" -> "abjad.tools.pitchtools.NamedInversionEquivalentIntervalClass.NamedInversionEquivalentIntervalClass"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.pitchtools.IntervalClass.IntervalClass"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

direction_number Gets direction number of named interval-class.
direction_string Gets direction string of named interval-class.
direction_symbol Gets direction symbol of named interval-class.
from_pitch_carriers(pitch_carrier_1, …) Makes named inversion-equivalent interval-class from pitch_carrier_1 and pitch_carrier_2.
from_quality_and_number(quality, number) Makes named inversion-equivalent interval-class from quality string and number.
name Gets name of named interval-class.
number Gets number of interval-class.
quality_and_number_to_name(quality, number) Changes quality and number to name.
quality_string Gets quality string of named interval-class.
__abs__() Gets absolute value of named interval-class.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when argument is a named inversion-equivalent interval-class with name equal to that of this named inversion-equivalent interval-class.
__float__() Coerce to float.
__format__([format_specification]) Formats Abjad object.
__ge__(other[, NotImplemented]) Return a >= b.
__gt__(other[, NotImplemented]) Return a > b.
__hash__() Hashes named inversion-equivalent interval-class.
__le__(other[, NotImplemented]) Return a <= b.
__lt__(argument) Is true when argument is a named interval class with a number greater than that of this named interval.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.
__str__() Gets string representation of named interval-class.

Read-only properties

(NamedIntervalClass).direction_number

Gets direction number of named interval-class.

>>> abjad.NamedIntervalClass('P1').direction_number
0
>>> abjad.NamedIntervalClass('+M2').direction_number
1
>>> abjad.NamedIntervalClass('-M2').direction_number
-1

Returns -1, 0 or 1.

(NamedIntervalClass).direction_string

Gets direction string of named interval-class.

>>> abjad.NamedIntervalClass('P1').direction_string is None
True
>>> abjad.NamedIntervalClass('+M2').direction_string
'ascending'
>>> abjad.NamedIntervalClass('-M2').direction_string
'descending'

Returns string.

(NamedIntervalClass).direction_symbol

Gets direction symbol of named interval-class.

>>> abjad.NamedIntervalClass('P1').direction_symbol
''
>>> abjad.NamedIntervalClass('+M2').direction_symbol
'+'
>>> abjad.NamedIntervalClass('-M2').direction_symbol
'-'

Returns string.

(NamedIntervalClass).name

Gets name of named interval-class.

>>> abjad.NamedIntervalClass('-M9').name
'-M2'

Returns string.

(IntervalClass).number

Gets number of interval-class.

Returns number.

(NamedIntervalClass).quality_string

Gets quality string of named interval-class.

>>> abjad.NamedIntervalClass('P1').quality_string
'perfect'
>>> abjad.NamedIntervalClass('+M2').quality_string
'major'
>>> abjad.NamedIntervalClass('-M2').quality_string
'major'

Returns string.

Class & static methods

classmethod NamedInversionEquivalentIntervalClass.from_pitch_carriers(pitch_carrier_1, pitch_carrier_2)

Makes named inversion-equivalent interval-class from pitch_carrier_1 and pitch_carrier_2.

>>> class_ = abjad.NamedInversionEquivalentIntervalClass
>>> class_.from_pitch_carriers(
...     abjad.NamedPitch(-2),
...     abjad.NamedPitch(12),
...     )
NamedInversionEquivalentIntervalClass('+M2')

Returns new named inversion-equivalent interval-class.

classmethod NamedInversionEquivalentIntervalClass.from_quality_and_number(quality, number)

Makes named inversion-equivalent interval-class from quality string and number.

>>> class_ = abjad.NamedInversionEquivalentIntervalClass
>>> class_.from_quality_and_number('perfect', 1)
NamedInversionEquivalentIntervalClass('P1')

Returns new named inversion-equivalent interval-class.

(NamedIntervalClass).quality_and_number_to_name(quality, number)

Changes quality and number to name.

>>> class_ = abjad.NamedIntervalClass
>>> class_.quality_and_number_to_name('minor', 2)
'+m2'
>>> class_.quality_and_number_to_name('major', 2)
'+M2'
>>> class_.quality_and_number_to_name('minor', 3)
'+m3'
>>> class_.quality_and_number_to_name('major', 3)
'+M3'

Returns string.

Special methods

(NamedIntervalClass).__abs__()

Gets absolute value of named interval-class.

>>> abs(abjad.NamedIntervalClass('-M9'))
NamedIntervalClass('+M2')

Returns new named interval-class.

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

NamedInversionEquivalentIntervalClass.__eq__(argument)

Is true when argument is a named inversion-equivalent interval-class with name equal to that of this named inversion-equivalent interval-class. Otherwise false.

>>> class_ = abjad.NamedInversionEquivalentIntervalClass
>>> interval_class_1 = class_('P1')
>>> interval_class_2 = class_('P1')
>>> interval_class_3 = class_('m2')
>>> interval_class_1 == interval_class_1
True
>>> interval_class_1 == interval_class_2
True
>>> interval_class_1 == interval_class_3
False
>>> interval_class_2 == interval_class_1
True
>>> interval_class_2 == interval_class_2
True
>>> interval_class_2 == interval_class_3
False
>>> interval_class_3 == interval_class_1
False
>>> interval_class_3 == interval_class_2
False
>>> interval_class_3 == interval_class_3
True

Returns true or false.

(NamedIntervalClass).__float__()

Coerce to float.

Returns float.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

(IntervalClass).__ge__(other, NotImplemented=NotImplemented)

Return a >= b. Computed by @total_ordering from (not a < b).

(IntervalClass).__gt__(other, NotImplemented=NotImplemented)

Return a > b. Computed by @total_ordering from (not a < b) and (a != b).

NamedInversionEquivalentIntervalClass.__hash__()

Hashes named inversion-equivalent interval-class.

Returns integer.

(IntervalClass).__le__(other, NotImplemented=NotImplemented)

Return a <= b. Computed by @total_ordering from (a < b) or (a == b).

(NamedIntervalClass).__lt__(argument)

Is true when argument is a named interval class with a number greater than that of this named interval.

>>> interval_class_1 = abjad.NamedIntervalClass('P1')
>>> interval_class_2 = abjad.NamedIntervalClass('P1')
>>> interval_class_3 = abjad.NamedIntervalClass('m2')
>>> interval_class_1 < interval_class_1
False
>>> interval_class_1 < interval_class_2
False
>>> interval_class_1 < interval_class_3
True
>>> interval_class_2 < interval_class_1
False
>>> interval_class_2 < interval_class_2
False
>>> interval_class_2 < interval_class_3
True
>>> interval_class_3 < interval_class_1
False
>>> interval_class_3 < interval_class_2
False
>>> interval_class_3 < interval_class_3
False

Returns true or false.

(AbjadObject).__ne__(argument)

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

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(NamedIntervalClass).__str__()

Gets string representation of named interval-class.

>>> str(abjad.NamedIntervalClass('-M9'))
'-M2'

Returns string.